Opened 3 years ago

Closed 3 years ago

#10253 closed bug (invalid)

Variable name with special characters

Reported by: songzh Owned by:
Priority: normal Milestone:
Component: Compiler Version: 7.10.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Declaring a variable in GHCi with $ . is allowed, but they are not referable. I suppose that the parser should impose more restrictions at this.

*Main> let a$1 = 10
*Main> a$1
<interactive>:20:1: Not in scope: a

Prelude> let a.1 = 10
Prelude> a.1

<interactive>:9:1: Not in scope: a

Prelude> let a%1 = 1
Prelude> a%1
1
Prelude> let a^1 = 1
Prelude> a^1
1
Prelude> a^1 + 1
2

Change History (1)

comment:1 Changed 3 years ago by nomeata

Resolution: invalid
Status: newclosed

You are not defining a there, but rather the operator $:

Prelude> :t ($)
($) :: (a -> b) -> a -> b
Prelude> let a$1 = 10
Prelude> :t ($)
($) :: (Num a1, Num a, Eq a) => t -> a -> a1
Note: See TracTickets for help on using tickets.