Re: [Haskell-cafe] ∀ lexing in ghc and ghci
Sean McLaughlin
seanmcl at gmail.com
Thu Sep 17 21:51:40 EDT 2009
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 <daniel.is.fischer at web.de>wrote:
> 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090917/38bec3e6/attachment.html
More information about the Haskell-Cafe
mailing list