4c9a44802d50bffae81cda407747f4399f56872b
[ghc-hetmet.git] / ghc / tests / programs / lex / Main.hs
1 module Main where
2
3 main = interact ( \ s -> shows (lex' s) "\n")
4      where lex' "" = []
5            lex' s = tok : lex' s' where -- [(tok,s')] = lex s
6                                         (tok,s') = case lex s of
7                                                     [r]   -> r
8                                                     []    -> error ("Empty: " ++ s) 
9                                                     other -> error ("Multi: " ++ s)