Language.Haskell.Parser and layout rules
Mirko Rahn
rahn at ira.uka.de
Thu Feb 17 07:40:31 EST 2005
The function Language.Haskell.Parser.parseModule behaves somehow strange and
disagrees with ghc-6.* about the set of accepted inputs. An example:
-- file T1.hs:
main = do args <- getArgs
if null args then return [] else do
ps <- mapM process args
mapM print ps
-- file T2.h2
main = do args <- getArgs
if null args then return [] else do
ps <- mapM process args
mapM print ps
Note the difference is an additional whitespace in T2.
I think both codes are perfectly valid, but parseModule fails on T1. Is anyone
able to explain why?
Thanks, Mirko Rahn
----
mirak at loop:~> ghci
___ ___ _
/ _ \ /\ /\/ __(_)
/ /_\// /_/ / / | | GHC Interactive, version 6.4.20050211, for Haskell
98
More information about the Libraries
mailing list