Skip to content

Commit

Permalink
Flip arguments to bindParser issue #6
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorris committed Sep 9, 2013
1 parent b6598ea commit ef05981
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/Parser/Parser.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,23 +107,23 @@ character =
--
-- /Tip:/ Use @withResultInput@.
--
-- >>> parse (bindParser character (\c -> if c == 'x' then character else valueParser 'v')) "abc"
-- >>> parse (bindParser (\c -> if c == 'x' then character else valueParser 'v') character) "abc"
-- Result >bc< 'v'
--
-- >>> parse (bindParser character (\c -> if c == 'x' then character else valueParser 'v')) "a"
-- >>> parse (bindParser (\c -> if c == 'x' then character else valueParser 'v') character) "a"
-- Result >< 'v'
--
-- >>> parse (bindParser character (\c -> if c == 'x' then character else valueParser 'v')) "xabc"
-- >>> parse (bindParser (\c -> if c == 'x' then character else valueParser 'v') character) "xabc"
-- Result >bc< 'a'
--
-- >>> isErrorResult (parse (bindParser character (\c -> if c == 'x' then character else valueParser 'v')) "")
-- >>> isErrorResult (parse (bindParser (\c -> if c == 'x' then character else valueParser 'v') character) "")
-- True
--
-- >>> isErrorResult (parse (bindParser character (\c -> if c == 'x' then character else valueParser 'v')) "x")
-- >>> isErrorResult (parse (bindParser (\c -> if c == 'x' then character else valueParser 'v') character) "x")
-- True
bindParser ::
Parser a
-> (a -> Parser b)
(a -> Parser b)
-> Parser a
-> Parser b
bindParser =
error "todo"
Expand Down

0 comments on commit ef05981

Please sign in to comment.