Skip to content

Instantly share code, notes, and snippets.

@ab9rf
Created September 3, 2018 07:31
Show Gist options
  • Save ab9rf/97a729115ab75347d8d154631c0845ca to your computer and use it in GitHub Desktop.
Save ab9rf/97a729115ab75347d8d154631c0845ca to your computer and use it in GitHub Desktop.
src\Tokenizer.hs:471:9: error:
* Non type-variable argument in the constraint: Stream s m Char
(Use FlexibleContexts to permit this)
* When checking the inferred type
p :: forall t s (m :: * -> *) u.
(Eq t, Num t, Stream s m Char, Enum t) =>
t -> Int -> ParsecT s u m Int
In an equation for `intParser':
intParser base m'
= oneOf digits >>= (p (pred m') . value)
where
p 0 i = return i
p m i
= (try (oneOf digits)
>>= (\ j -> p (pred m) ((i * base) + value j)))
<|> return i
digitsL = take base (['0' .. '9'] ++ ['a' .. 'z'])
digitsU = take base (['0' .. '9'] ++ ['A' .. 'Z'])
digits = digitsL ++ digitsU
....
|
471 | p 0 i = return i
| ^^^^^^^^^^^^^^^^^...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment