GroteTrap-0.5.2: Parser and selection library for expression languages.

Safe HaskellSafe
LanguageHaskell98

Language.GroteTrap.Util

Description

Utility functions.

This module re-exports module Control.Monad.Error so that fromError can be used as Monad m => m a -> a.

Synopsis

Documentation

fromError :: Either String a -> a Source #

Either returns the value or throws an exception.

run :: Monad m => String -> GenParser tok () a -> [tok] -> m a Source #

run sourceName p input runs the specified parser on the input, returning the result in a monad.