blob: 9c535643eaad4e599f1120dfe9d98a0717f2dc81 (
plain)
1
2
3
4
5
6
7
8
9
|
module Main where
main = interact ( \ s -> shows (lex' s) "\n")
where lex' "" = []
lex' s = tok : lex' s' where -- [(tok,s')] = lex s
(tok,s') = case lex s of
[r] -> r
[] -> error ("Empty: " ++ s)
other -> error ("Multi: " ++ s)
|