Portability | portable |
---|---|
Stability | experimental |
Maintainer | ross@soi.city.ac.uk |
Safe Haskell | Safe-Inferred |
Prelude classes, lifted to unary type constructors.
- class Eq1 f where
- class Eq1 f => Ord1 f where
- class Read1 f where
- readsPrec1 :: Read a => Int -> ReadS (f a)
- class Show1 f where
- showsPrec1 :: Show a => Int -> f a -> ShowS
- readsData :: (String -> ReadS a) -> Int -> ReadS a
- readsUnary :: Read a => String -> (a -> t) -> String -> ReadS t
- readsUnary1 :: (Read1 f, Read a) => String -> (f a -> t) -> String -> ReadS t
- readsBinary1 :: (Read1 f, Read1 g, Read a) => String -> (f a -> g a -> t) -> String -> ReadS t
- showsUnary :: Show a => String -> Int -> a -> ShowS
- showsUnary1 :: (Show1 f, Show a) => String -> Int -> f a -> ShowS
- showsBinary1 :: (Show1 f, Show1 g, Show a) => String -> Int -> f a -> g a -> ShowS
Liftings of Prelude classes
Lifting of the Eq
class to unary type constructors.
Eq1 [] | |
Eq1 Maybe | |
Eq1 Identity | |
Eq a => Eq1 (Either a) | |
Eq a => Eq1 ((,) a) | |
Eq1 f => Eq1 (Reverse f) | |
Eq1 f => Eq1 (Backwards f) | |
Eq1 f => Eq1 (Lift f) | |
Eq a => Eq1 (Constant a) | |
Eq1 m => Eq1 (MaybeT m) | |
Eq1 m => Eq1 (ListT m) | |
Eq1 f => Eq1 (IdentityT f) | |
(Eq w, Eq1 m) => Eq1 (WriterT w m) | |
(Eq w, Eq1 m) => Eq1 (WriterT w m) | |
(Eq e, Eq1 m) => Eq1 (ErrorT e m) | |
(Functor f, Eq1 f, Eq1 g) => Eq1 (Compose f g) | |
(Eq1 f, Eq1 g) => Eq1 (Product f g) | |
(Eq1 f, Eq1 g) => Eq1 (Sum f g) | |
(Eq e, Eq1 m) => Eq1 (ExceptT e m) |
class Eq1 f => Ord1 f whereSource
Lifting of the Ord
class to unary type constructors.
Ord1 [] | |
Ord1 Maybe | |
Ord1 Identity | |
Ord a => Ord1 (Either a) | |
Ord a => Ord1 ((,) a) | |
Ord1 f => Ord1 (Reverse f) | |
Ord1 f => Ord1 (Backwards f) | |
Ord1 f => Ord1 (Lift f) | |
Ord a => Ord1 (Constant a) | |
Ord1 m => Ord1 (MaybeT m) | |
Ord1 m => Ord1 (ListT m) | |
Ord1 f => Ord1 (IdentityT f) | |
(Ord w, Ord1 m) => Ord1 (WriterT w m) | |
(Ord w, Ord1 m) => Ord1 (WriterT w m) | |
(Ord e, Ord1 m) => Ord1 (ErrorT e m) | |
(Functor f, Ord1 f, Ord1 g) => Ord1 (Compose f g) | |
(Ord1 f, Ord1 g) => Ord1 (Product f g) | |
(Ord1 f, Ord1 g) => Ord1 (Sum f g) | |
(Ord e, Ord1 m) => Ord1 (ExceptT e m) |
Lifting of the Read
class to unary type constructors.
readsPrec1 :: Read a => Int -> ReadS (f a)Source
Read1 [] | |
Read1 Maybe | |
Read1 Identity | |
Read a => Read1 (Either a) | |
Read a => Read1 ((,) a) | |
Read1 f => Read1 (Reverse f) | |
Read1 f => Read1 (Backwards f) | |
Read1 f => Read1 (Lift f) | |
Read a => Read1 (Constant a) | |
Read1 m => Read1 (MaybeT m) | |
Read1 m => Read1 (ListT m) | |
Read1 f => Read1 (IdentityT f) | |
(Read w, Read1 m) => Read1 (WriterT w m) | |
(Read w, Read1 m) => Read1 (WriterT w m) | |
(Read e, Read1 m) => Read1 (ErrorT e m) | |
(Functor f, Read1 f, Read1 g) => Read1 (Compose f g) | |
(Read1 f, Read1 g) => Read1 (Product f g) | |
(Read1 f, Read1 g) => Read1 (Sum f g) | |
(Read e, Read1 m) => Read1 (ExceptT e m) |
Lifting of the Show
class to unary type constructors.
showsPrec1 :: Show a => Int -> f a -> ShowSSource
Show1 [] | |
Show1 Maybe | |
Show1 Identity | |
Show a => Show1 (Either a) | |
Show a => Show1 ((,) a) | |
Show1 f => Show1 (Reverse f) | |
Show1 f => Show1 (Backwards f) | |
Show1 f => Show1 (Lift f) | |
Show a => Show1 (Constant a) | |
Show1 m => Show1 (MaybeT m) | |
Show1 m => Show1 (ListT m) | |
Show1 f => Show1 (IdentityT f) | |
(Show w, Show1 m) => Show1 (WriterT w m) | |
(Show w, Show1 m) => Show1 (WriterT w m) | |
(Show e, Show1 m) => Show1 (ErrorT e m) | |
(Functor f, Show1 f, Show1 g) => Show1 (Compose f g) | |
(Show1 f, Show1 g) => Show1 (Product f g) | |
(Show1 f, Show1 g) => Show1 (Sum f g) | |
(Show e, Show1 m) => Show1 (ExceptT e m) |
Helper functions
readsData :: (String -> ReadS a) -> Int -> ReadS aSource
is a parser for datatypes where each alternative
begins with a data constructor. It parses the constructor and
passes it to readsData
p dp
. Parsers for various constructors can be constructed
with readsUnary
, readsUnary1
and readsBinary1
, and combined with
mappend
from the Monoid
class.
readsUnary :: Read a => String -> (a -> t) -> String -> ReadS tSource
matches the name of a unary data constructor
and then parses its argument using readsUnary
n c n'readsPrec
.
readsUnary1 :: (Read1 f, Read a) => String -> (f a -> t) -> String -> ReadS tSource
matches the name of a unary data constructor
and then parses its argument using readsUnary1
n c n'readsPrec1
.
readsBinary1 :: (Read1 f, Read1 g, Read a) => String -> (f a -> g a -> t) -> String -> ReadS tSource
matches the name of a binary data constructor
and then parses its arguments using readsBinary1
n c n'readsPrec1
.
showsUnary :: Show a => String -> Int -> a -> ShowSSource
produces the string representation of a unary data
constructor with name showsUnary
n d xn
and argument x
, in precedence context d
.
showsUnary1 :: (Show1 f, Show a) => String -> Int -> f a -> ShowSSource
produces the string representation of a unary data
constructor with name showsUnary1
n d xn
and argument x
, in precedence context d
.
showsBinary1 :: (Show1 f, Show1 g, Show a) => String -> Int -> f a -> g a -> ShowSSource
produces the string representation of a binary
data constructor with name showsBinary1
n d xn
and arguments x
and y
, in precedence
context d
.