Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
class StrictContainer t where Source
For convenience, we export the names of the lazy types too
data Maybe a :: * -> *
The Maybe
type encapsulates an optional value. A value of type
either contains a value of type Maybe
aa
(represented as
),
or it is empty (represented as Just
aNothing
). Using Maybe
is a good way to
deal with errors or exceptional cases without resorting to drastic
measures such as error
.
The Maybe
type is also a monad. It is a simple kind of error
monad, where all errors are represented by Nothing
. A richer
error monad can be built using the Either
type.
Alternative Maybe | |
Monad Maybe | |
Functor Maybe | |
MonadPlus Maybe | |
Applicative Maybe | |
Foldable Maybe | |
Generic1 Maybe | |
MonadThrow Maybe | |
Eq1 Maybe | |
Ord1 Maybe | |
Read1 Maybe | |
Show1 Maybe | |
StrictContainer Maybe | |
Alternative (Strict Maybe) | |
Eq a => Eq (Maybe a) | |
Functor (Strict Maybe) | |
Ord a => Ord (Maybe a) | |
Read a => Read (Maybe a) | |
Show a => Show (Maybe a) | |
Applicative (Strict Maybe) | |
Generic (Maybe a) | |
FromJSON a => LookupField (Maybe a) | |
ToJSON a => ToJSON (Maybe a) | |
FromJSON a => FromJSON (Maybe a) | |
Monoid a => Monoid (Maybe a) | Lift a semigroup into |
Binary a => Binary (Maybe a) | |
Serialize a => Serialize (Maybe a) | |
PrettyVal a => PrettyVal (Maybe a) | |
Lift a => Lift (Maybe a) | |
Eq a => Eq (Strict Maybe a) | |
Ord a => Ord (Strict Maybe a) | |
Show a => Show (Strict Maybe a) | |
(Selector s, ToJSON a) => RecordToPairs (S1 s (K1 i (Maybe a))) | |
(Selector s, FromJSON a) => FromRecord (S1 s (K1 i (Maybe a))) | |
Binary a => Binary (Strict Maybe a) | |
PrettyVal a => PrettyVal (Strict Maybe a) | |
Typeable (* -> *) Maybe | |
type Rep1 Maybe = D1 D1Maybe ((:+:) (C1 C1_0Maybe U1) (C1 C1_1Maybe (S1 NoSelector Par1))) | |
data Strict Maybe = StrictMaybe {
| |
type Rep (Maybe a) = D1 D1Maybe ((:+:) (C1 C1_0Maybe U1) (C1 C1_1Maybe (S1 NoSelector (Rec0 a)))) | |
type (==) (Maybe k) a b = EqMaybe k a b |
data Map k a :: * -> * -> *
A Map from keys k
to values a
.
Functor (Map k) | |
Foldable (Map k) | |
Traversable (Map k) | |
StrictContainer (Map k) | |
(Eq k, Eq a) => Eq (Map k a) | |
(Data k, Data a, Ord k) => Data (Map k a) | |
(Ord k, Ord v) => Ord (Map k v) | |
(Ord k, Read k, Read e) => Read (Map k e) | |
(Show k, Show a) => Show (Map k a) | |
(Show k, Show v) => Show (Strict (Map k) v) | |
ToJSON v => ToJSON (Map String v) | |
ToJSON v => ToJSON (Map Text v) | |
ToJSON v => ToJSON (Map Text v) | |
FromJSON v => FromJSON (Map String v) | |
FromJSON v => FromJSON (Map Text v) | |
FromJSON v => FromJSON (Map Text v) | |
Ord k => Monoid (Map k v) | |
(Binary k, Binary e) => Binary (Map k e) | |
(Ord k, Binary k, Binary v) => Binary (Strict (Map k) v) | |
(Ord k, Serialize k, Serialize e) => Serialize (Map k e) | |
(NFData k, NFData a) => NFData (Map k a) | |
(PrettyVal k, PrettyVal a) => PrettyVal (Map k a) | |
(PrettyVal k, PrettyVal v) => PrettyVal (Strict (Map k) v) | |
Typeable (* -> * -> *) Map | |
data Strict (Map k) = StrictMap {} |
data IntMap a :: * -> *
A map of integers to values a
.
Functor IntMap | |
Foldable IntMap | |
Traversable IntMap | |
StrictContainer IntMap | |
Eq a => Eq (IntMap a) | |
Data a => Data (IntMap a) | |
Ord a => Ord (IntMap a) | |
Read e => Read (IntMap e) | |
Show a => Show (IntMap a) | |
ToJSON a => ToJSON (IntMap a) | |
FromJSON a => FromJSON (IntMap a) | |
Monoid (IntMap a) | |
Binary e => Binary (IntMap e) | |
Serialize e => Serialize (IntMap e) | |
NFData a => NFData (IntMap a) | |
PrettyVal a => PrettyVal (IntMap a) | |
Show v => Show (Strict IntMap v) | |
Binary v => Binary (Strict IntMap v) | |
PrettyVal v => PrettyVal (Strict IntMap v) | |
Typeable (* -> *) IntMap | |
data Strict IntMap = StrictIntMap {
|
data Trie a :: * -> *
A map from ByteString
s to a
. For all the generic functions,
note that tries are strict in the Maybe
but not in a
.
The Monad
instance is strange. If a key k1
is a prefix of
other keys, then results from binding the value at k1
will
override values from longer keys when they collide. If this is
useful for anything, or if there's a more sensible instance, I'd
be curious to know.
Monad Trie | |
Functor Trie | |
Applicative Trie | |
Foldable Trie | |
Traversable Trie | |
StrictContainer Trie | |
Eq a => Eq (Trie a) | |
Show a => Show (Trie a) | |
Monoid a => Monoid (Trie a) | |
Binary a => Binary (Trie a) | |
PrettyVal a => PrettyVal (Trie a) | |
Show a => Show (Strict Trie a) | |
PrettyVal a => PrettyVal (Strict Trie a) | |
data Strict Trie = StrictTrie {
|