Haskell Alex - error in wrapper template
I'm trying to understand Alex and lexers in general but I'm having trouble to run my lexer. I wrote lexers in "basic" and "posn" wrappers but I couldn't in "monad" wrapper. I think I have to use monad wrapper because I need to collect strings and token positions in input. I also need multiple states. For now I'm trying to run this simple exmaple: { module Main (main) where } %wrapper "monad" $whitespace = [\ \b\t\n\f\v\r] $digit = 0-9 $alpha = [a-zA-Z_] $upper = [A-Z] $lower = [a-z] @tidentifier = $upper($alpha|_|$digit)* @identifier = $lower($alpha|_|$digit)* tokens :- $whitespace+ ; $upper