:: LexerOutput :== Either String [Token]
-(===) :: TokenValue Token -> Bool
-
lexer :: [Char] -> LexerOutput
| isAlpha x = let (v, r) = span isIdent t in ret (IdentToken v) r
with isIdent c = isAlphanum c || c == '_'
| otherwise = err ("Unexpected character: " +++ toString x)
-
-
-derive gEq TokenValue
-
-(===) :: TokenValue Token -> Bool
-(===) (IdentToken _) (_, IdentToken _) = True
-(===) (NumberToken _) (_, NumberToken _) = True
-(===) (CharToken _) (_, CharToken _) = True
-(===) x (_, y) = gEq {|*|} x y
trans1 :: TokenValue a -> Parser Token a
trans1 t r = trans2 t $ const r
+derive gEq TokenValue
satTok :: TokenValue -> Parser Token Token
-satTok t = satisfy ((===) t)
+satTok t = satisfy $ eq t
+ where
+ eq (IdentToken _) (_, IdentToken _) = True
+ eq (NumberToken _) (_, NumberToken _) = True
+ eq (CharToken _) (_, CharToken _) = True
+ eq x (_, y) = gEq {|*|} x y
parseSepList :: TokenValue (Parser Token a) -> Parser Token [a]
parseSepList sep p =