lambda-options-0.7.0.0: A modern command-line parser for Haskell.

Safe HaskellSafe-Inferred
LanguageHaskell2010

Text.LambdaOptions.Parseable

Synopsis

Documentation

class Parseable a where

Class describing parseable values. Much like the Read class.

Methods

parse :: [String] -> (Maybe a, Int)

Given a sequence of strings, returns Nothing and the number of strings consumed if the parse failed. Otherwise, return Just the parsed value and the number of strings consumed. Element-wise, an entire string must be parsed in the sequence to be considered a successful parse.

Instances

Parseable Float

Parses a Float using its Read instance.

Parseable Int

Parses an Int using its ReadBounded instance.

Parseable Integer

Parses an Integer using its Read instance.

Parseable Word

Parses a Word using its ReadBounded instance.

Parseable String

Identity parser.

Parseable HelpDescription

Consumes nothing. Returns the options' help description. Never fails.

Parseable a => Parseable (Maybe a)

Greedily parses a single argument or no argument. Never fails.

Parseable a => Parseable (List a)

Greedily parses arguments item-wise. Never fails.