Make runFirstIO more generic
This commit is contained in:
parent
83afb8a7c4
commit
6afe8c2a4e
|
@ -110,7 +110,8 @@ Provide wrappers for `rundownFirst` for evaluating it in various contexts.
|
||||||
|
|
||||||
```idris
|
```idris
|
||||||
export
|
export
|
||||||
runFirstIO : (f : Parser a) -> String -> IO (Either ParseError a)
|
runFirstIO : HasIO io => MonadRec io =>
|
||||||
|
(f : Parser a) -> String -> io (Either ParseError a)
|
||||||
runFirstIO f str = do
|
runFirstIO f str = do
|
||||||
Just state <- newInternalIO str
|
Just state <- newInternalIO str
|
||||||
| _ => pure . Left $ BeforeParse "Empty input"
|
| _ => pure . Left $ BeforeParse "Empty input"
|
||||||
|
|
Loading…
Reference in a new issue