human-parse-0.1.0.3: A lawless typeclass for parsing text entered by humans.

Safe HaskellSafe
LanguageHaskell2010

Data.Text.Human.Parse

Synopsis

Documentation

class HumanParse e a | a -> e where Source #

An unprincipled best-effort informal attempt to figure out what a human is saying.

Type variables:

  • a - The type we're trying to parse into
  • e - The type of error we produce when we can't understand the human

Minimal complete definition

parseHuman

Methods

parseHuman :: Text -> Either e a Source #

Instances

HumanParse () Void Source # 

Methods

parseHuman :: Text -> Either () Void Source #

HumanParse e a => HumanParse e (Maybe a) Source #

We parse Maybe a by first attempting to parse a and wrap it in Just. If that fails but the input is only whitespace, then we accept the as Nothing. If there is some non-whitespace text that fails to parse as a, only then do we reject the input.

Methods

parseHuman :: Text -> Either e (Maybe a) Source #