Make runFirstIO more generic

This commit is contained in:
Nathan McCarty 2025-01-27 19:55:35 -05:00
parent 83afb8a7c4
commit 6afe8c2a4e

View file

@ -110,7 +110,8 @@ Provide wrappers for `rundownFirst` for evaluating it in various contexts.
```idris
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
Just state <- newInternalIO str
| _ => pure . Left $ BeforeParse "Empty input"