
Dear all, I run file Token.hs in hugs98\libraries\Text\ParserCombinator\Parsec\Token.hs, but it displays this error ERROR : 64 - Syntax error in data type definition (unexpected '.') Anyone know how to fix this? Thanks.

On Mon, 2005-11-07 at 21:32 -0500, Sara Kenedy wrote:
Dear all,
I run file Token.hs in hugs98\libraries\Text\ParserCombinator\Parsec\Token.hs, but it displays this error
ERROR : 64 - Syntax error in data type definition (unexpected '.')
Anyone know how to fix this? Thanks.
The problem is that module uses extended features which are not part of Haskell 98. In particular, on line 64 (and many others), it uses an explicit "forall a." in the type of a record constructor. You can get hugs to load it with the flag "-98", that is: hugs -98 <whatever module you want> This tells hugs to allow extended features which are not Haskell 98, such as the one mentioned above. If you later decide to use ghc or ghci then you will need to give it the "-f glasgow-exts" flag. Cheers, Bernie.

Hello, I ran into this as well, it's because the Token module uses the forall extension. just start Hugs with the -98 option and the error should go away. Cheers On 08/11/2005, at 1:32 PM, Sara Kenedy wrote:
Dear all,
I run file Token.hs in hugs98\libraries\Text\ParserCombinator\Parsec\Token.hs, but it displays this error
ERROR : 64 - Syntax error in data type definition (unexpected '.')
Anyone know how to fix this? Thanks. _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Sara,
I run file Token.hs in hugs98\libraries\Text\ParserCombinator\Parsec\Token.hs, but it displays this error
ERROR : 64 - Syntax error in data type definition (unexpected '.')
Anyone know how to fix this? Thanks.
Token.hs defines a data type TokenParser: data TokenParser st = = TokenParser{ ... , lexeme :: forall a . CharParser st a -> CharParser st a , ... } The forall construct here is not part of Haskell 98. Hence, you should interpret the file with extensions available. From the top of my head, you can enable extension by passing the -98 command line option to Hugs. HTH, Stefan
participants (4)
-
Bernard Pope
-
Sara Kenedy
-
Scott Weeks
-
Stefan Holdermans