[Haskell-beginners] ghci parse error on input

Chaddaï Fouché chaddai.fouche at gmail.com
Thu Mar 18 09:26:01 EDT 2010

On Thu, Mar 18, 2010 at 1:21 PM, Rick Murphy <rick at rickmurphy.org> wrote:
> Using GHCi, I am working from an existing example which surprisingly
> contains a parse error in an export statement. I have reproduced the parse
> error as follows:
>> module Export
>>       (
>>               (^)
>>       ,       (#)
>>       )
>> where
>> import Prelude hiding ((^))
> GHCi reports: parse error on input (#
> I read 5.2 Export Lists in the Haskell Report, but the syntax above does not
> appear to contradict the Haskell Report.

That's probably due to you using GHCi in a version where the
GHC-specific extension concerning # is active by default (with this
extension (# 2, 3 #) is an unboxed strict pair). While it's probably
possible to compile this code by making sure that the extension isn't
active (for instance, using ghc instead of ghci), it is probably a
better idea to avoid # as an operator name.


More information about the Beginners mailing list