
Hi, I'm getting different behavior in ghci and ghc with the identifier ∀. In ghc I need to wrap it with parens, as in
(∀) :: Var -> Base -> Formula -> Formula (∀) = All
In ghci, I get an error this way Formula.lhs:112:2: Invalid type signature In ghci I can do
∀ :: Var -> Base -> Formula -> Formula ∀ = All
fine. But then ghc complains. What's going on here? Thanks! Sean

Am Freitag 18 September 2009 03:31:13 schrieb Sean McLaughlin:
Hi, I'm getting different behavior in ghci and ghc with the identifier ∀. In ghc I need to wrap it with parens, as in
(∀) :: Var -> Base -> Formula -> Formula (∀) = All
In ghci, I get an error this way
Formula.lhs:112:2: Invalid type signature
In ghci I can do
∀ :: Var -> Base -> Formula -> Formula ∀ = All
fine. But then ghc complains. What's going on here?
Very odd: GHCi, version 6.10.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> let ∀ :: Int -> Int -> Int; ∀ x y = x*(y-x) <interactive>:1:4: parse error on input `∀' Prelude> let (∀) :: Int -> Int -> Int; x ∀ y = x*(y-x) Prelude> 3 ∀ 5 6 Maybe your encodings aren't UTF8?
Thanks!
Sean

Hi Daniel,
Would you try putting that in a file and loading it in ghci? Your
example also works for me.
Prelude> let (∀) = 5
Prelude> (∀)
5
Sean
On Thu, Sep 17, 2009 at 9:41 PM, Daniel Fischer
Am Freitag 18 September 2009 03:31:13 schrieb Sean McLaughlin:
Hi, I'm getting different behavior in ghci and ghc with the identifier ∀. In ghc I need to wrap it with parens, as in
(∀) :: Var -> Base -> Formula -> Formula (∀) = All
In ghci, I get an error this way
Formula.lhs:112:2: Invalid type signature
In ghci I can do
∀ :: Var -> Base -> Formula -> Formula ∀ = All
fine. But then ghc complains. What's going on here?
Very odd:
GHCi, version 6.10.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. Prelude> let ∀ :: Int -> Int -> Int; ∀ x y = x*(y-x)
<interactive>:1:4: parse error on input `∀' Prelude> let (∀) :: Int -> Int -> Int; x ∀ y = x*(y-x) Prelude> 3 ∀ 5 6
Maybe your encodings aren't UTF8?
Thanks!
Sean

Am Freitag 18 September 2009 03:51:40 schrieb Sean McLaughlin:
Hi Daniel, Would you try putting that in a file and loading it in ghci? Your example also works for me.
Prelude> let (∀) = 5 Prelude> (∀) 5
Sean
Sure: dafis@linux-mkk1:~/Haskell/CafeTesting> cat Forall.hs module Forall where (∀) :: Int -> Int -> Int x ∀ y = x*(y-x) dafis@linux-mkk1:~/Haskell/CafeTesting> ghci Forall GHCi, version 6.10.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Forall ( Forall.hs, interpreted ) Ok, modules loaded: Forall. *Forall> 7 ∀ 4 -21 *Forall> Works here.

Weird. OK, thanks a lot! I'm switching to ¥ until I get this figured out.
Sean
On Thu, Sep 17, 2009 at 10:00 PM, Daniel Fischer
Am Freitag 18 September 2009 03:51:40 schrieb Sean McLaughlin:
Hi Daniel, Would you try putting that in a file and loading it in ghci? Your example also works for me.
Prelude> let (∀) = 5 Prelude> (∀) 5
Sean
Sure: dafis@linux-mkk1:~/Haskell/CafeTesting> cat Forall.hs module Forall where
(∀) :: Int -> Int -> Int x ∀ y = x*(y-x) dafis@linux-mkk1:~/Haskell/CafeTesting> ghci Forall GHCi, version 6.10.3: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 1] Compiling Forall ( Forall.hs, interpreted ) Ok, modules loaded: Forall. *Forall> 7 ∀ 4 -21 *Forall>
Works here.

Hi Daniel,
Prelude> Data.Char.isSymbol (toEnum 8704)
True
On Thu, Sep 17, 2009 at 11:09 PM, Daniel Fischer
Am Friday 18 September 2009 04:41:13 schrieben Sie:
Weird. OK, thanks a lot! I'm switching to ¥ until I get this figured out. Sean
What does your ghci say for
Data.Char.isSymbol (toEnum 8704) ?

Daniel Fischer
In ghci I can do
∀ :: Var -> Base -> Formula -> Formula ∀ = All
fine. But then ghc complains. What's going on here?
Maybe your encodings aren't UTF8?
Or rather, one of them is UTF-8, and the other isn't. So that in one case, you get the 'forall' Unicode symbol, and in the other, you get a sequence of two (or more?) code-points between 128 and 255, which happen to not be declared as symbols. (This is just a guess, I haven't really checked) See also this thread: http://www.mail-archive.com/haskell-cafe@haskell.org/msg63555.html -k -- If I haven't seen further, it is by standing in the footprints of giants
participants (3)
-
Daniel Fischer
-
Ketil Malde
-
Sean McLaughlin