Cabal-3.10.1.0: A framework for packaging Haskell software

Copyright | Jose Iborra 2008
License | BSD3
Maintainer | cabal-devel@haskell.org
Portability | portable
Safe Haskell | Safe-Inferred
Language | Haskell2010

Distribution.ReadE

Contents

- ReadE
- Projections
- Parse Errors

Description

Simple parsing with failure

Synopsis

- newtype ReadE a = ReadE {
  - runReadE :: String -> Either ErrorMsg a
  }
- succeedReadE :: (String -> a) -> ReadE a
- failReadE :: ErrorMsg -> ReadE a
- parsecToReadE :: (String -> ErrorMsg) -> ParsecParser a -> ReadE a
- parsecToReadEErr :: (ParseError -> ErrorMsg) -> ParsecParser a -> ReadE a
- unexpectMsgString :: ParseError -> String

# ReadE

newtype ReadE a Source #

Parser with simple error reporting

Constructors

ReadE |

Fields

- runReadE :: String -> Either ErrorMsg a

#### Instances

Instances details

Functor ReadE Source # |
Instance details Defined in Distribution.ReadE Methods fmap :: (a -> b) -> ReadE a -> ReadE b Source # (<$) :: a -> ReadE b -> ReadE a Source #

succeedReadE :: (String -> a) -> ReadE a Source #

failReadE :: ErrorMsg -> ReadE a Source #

# Projections

parsecToReadE :: (String -> ErrorMsg) -> ParsecParser a -> ReadE a Source #

parsecToReadEErr :: (ParseError -> ErrorMsg) -> ParsecParser a -> ReadE a Source #

# Parse Errors

unexpectMsgString :: ParseError -> String Source #