File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1818 " package.json"
1919 ],
2020 "dependencies" : {
21- "purescript-transformers" : " ~0.1.0 " ,
22- "purescript-either" : " * " ,
23- "purescript-maybe" : " ~0.2.0 " ,
24- "purescript-arrays" : " ~0.2.0 " ,
25- "purescript-strings" : " * " ,
26- "purescript-foldable-traversable" : " * "
21+ "purescript-transformers" : " ~0.2.1 " ,
22+ "purescript-either" : " ~0.1.3 " ,
23+ "purescript-maybe" : " ~0.2.1 " ,
24+ "purescript-arrays" : " ~0.2.1 " ,
25+ "purescript-strings" : " ~0.3.0 " ,
26+ "purescript-foldable-traversable" : " ~0.1.3 "
2727 }
2828}
Original file line number Diff line number Diff line change 1010 type Parser s a = ParserT s Identity a
1111
1212 newtype ParserT s m a where
13- ParserT :: s -> m { consumed :: Boolean, result :: Either ParseError a, input :: s } -> ParserT s m a
13+ ParserT :: ( s -> m { consumed :: Boolean, result :: Either ParseError a, input :: s }) -> ParserT s m a
1414
1515
1616### Type Class Instances
Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import Data.String
44import Data.Either
55import Data.Foldable
66import Data.Monoid
7+ import Data.Maybe
8+ import Data.Char
79
810import Control.Alt
911import Control.Alternative
@@ -28,9 +30,9 @@ string s = ParserT $ \s' ->
2830
2931char :: forall m . (Monad m ) => ParserT String m String
3032char = ParserT $ \s' ->
31- return $ case s' of
32- " " -> { consumed: false , input: s', result: Left (strMsg " Unexpected EOF" ) }
33- _ -> { consumed: true , input: drop 1 s', result: Right (charAt 0 s' ) }
33+ return $ case charAt 0 s' of
34+ Nothing -> { consumed: false , input: s', result: Left (strMsg " Unexpected EOF" ) }
35+ Just c -> { consumed: true , input: drop 1 s', result: Right (charString c ) }
3436
3537satisfy :: forall m . (Monad m ) => (String -> Boolean ) -> ParserT String m String
3638satisfy f = try do
You can’t perform that action at this time.
0 commit comments