-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Minimal essentials -- -- A minimal yet powerful library of essentials, only depending on -- base. @package mini @version 1.0.1.0 -- | Representation of a structure mapping unique keys to values. The -- internal structure is an AVL tree. module Mini.Data.Map -- | A map from keys of type k to values of type a. -- -- The internal structure is an AVL tree; a tree that is always -- height-balanced (the absolute value of the level difference between -- the left and right subtrees is at most 1). data Map k a -- | <math> Map difference (matching only on keys) difference :: Ord k => Map k a -> Map k b -> Map k a -- | <math> Left-biased map intersection (matching only on keys) intersection :: Ord k => Map k a -> Map k b -> Map k a -- | <math> Left-biased map union (matching only on keys) union :: Ord k => Map k a -> Map k a -> Map k a -- | <math> The empty map empty :: Map k a -- | <math> From a tail-biased list of (key, value) pairs to -- a map with bins containing the keys and values fromList :: Ord k => [(k, a)] -> Map k a -- | <math> From a key and a value to a map with a single bin singleton :: k -> a -> Map k a -- | <math> From a map to a list of (key, value) pairs in -- key-ascending order toAscList :: Map k a -> [(k, a)] -- | <math> From a map to a list of (key, value) pairs in -- key-descending order toDescList :: Map k a -> [(k, a)] -- | <math> From a left-associative operation on keys and values, a -- starting accumulator and a map to a thing foldlWithKey :: (b -> k -> a -> b) -> b -> Map k a -> b -- | <math> From a right-associative operation on keys and values, a -- starting accumulator and a map to a thing foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b -- | <math> From an operation, a key and a map to the map adjusted by -- applying the operation to the value associated with the key adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a -- | <math> From a key and a map to the map without the key delete :: Ord k => k -> Map k a -> Map k a -- | <math> From a predicate and a map to the map with values -- satisfying the predicate filter :: Ord k => (a -> Bool) -> Map k a -> Map k a -- | <math> From a predicate and a map to the map with keys and -- values satisfying the predicate filterWithKey :: Ord k => (k -> a -> Bool) -> Map k a -> Map k a -- | <math> From a key, a value and a map to the map including a bin -- containing the key and the value insert :: Ord k => k -> a -> Map k a -> Map k a -- | <math> From an operation, a key and a map to the map updated by -- applying the operation to the value associated with the key (setting -- if Just, deleting if Nothing) update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a -- | <math> From a map and another map to whether the former is a -- submap of the latter (matching on keys and values) isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool -- | <math> From a key and a map to the value associated with the key -- in the map lookup :: Ord k => k -> Map k a -> Maybe a -- | <math> From a map to the value associated with the maximum key -- in the map lookupMax :: Map k a -> Maybe a -- | <math> From a map to the value associated with the minimum key -- in the map lookupMin :: Map k a -> Maybe a -- | <math> From a key and a map to whether the key is in the map member :: Ord k => k -> Map k a -> Bool -- | <math> From a map to whether the map is empty null :: Map k a -> Bool -- | <math> From a map to the size of the map size :: Map k a -> Int -- | <math> From a lifting operation on keys and values and a map to -- a lifted map traverseWithKey :: Applicative f => (k -> a -> f b) -> Map k a -> f (Map k b) -- | <math> From a map to whether its internal structure is valid, -- i.e. height-balanced and ordered valid :: Ord k => Map k a -> Bool instance (GHC.Classes.Ord k, GHC.Classes.Ord a) => GHC.Classes.Ord (Mini.Data.Map.Map k a) instance (GHC.Classes.Eq k, GHC.Classes.Eq a) => GHC.Classes.Eq (Mini.Data.Map.Map k a) instance (GHC.Show.Show k, GHC.Show.Show a) => GHC.Show.Show (Mini.Data.Map.Map k a) instance GHC.Base.Functor (Mini.Data.Map.Map k) instance Data.Foldable.Foldable (Mini.Data.Map.Map k) instance Data.Traversable.Traversable (Mini.Data.Map.Map k) instance GHC.Classes.Ord k => GHC.Base.Semigroup (Mini.Data.Map.Map k a) instance GHC.Classes.Ord k => GHC.Base.Monoid (Mini.Data.Map.Map k a) -- | Representation of a structure containing unique elements. The internal -- structure is an AVL tree. module Mini.Data.Set -- | A set containing elements of type a. -- -- The internal structure is an AVL tree; a tree that is always -- height-balanced (the absolute value of the level difference between -- the left and right subtrees is at most 1). data Set a -- | <math> Set difference difference :: Ord a => Set a -> Set a -> Set a -- | <math> Set intersection intersection :: Ord a => Set a -> Set a -> Set a -- | <math> Set union union :: Ord a => Set a -> Set a -> Set a -- | <math> The empty set empty :: Set a -- | <math> From a tail-biased list of elements to a set containing -- the elements fromList :: Ord a => [a] -> Set a -- | <math> From an element to a set with a single element singleton :: a -> Set a -- | <math> From a set to a list of elements in ascending order toAscList :: Set a -> [a] -- | <math> From a set to a list of elements in descending order toDescList :: Set a -> [a] -- | <math> From an element and a set to the set without the element delete :: Ord a => a -> Set a -> Set a -- | <math> From a predicate and a set to the set with elements -- satisfying the predicate filter :: Ord a => (a -> Bool) -> Set a -> Set a -- | <math> From an element and a set to the set including the -- element insert :: Ord a => a -> Set a -> Set a -- | <math> From a set and another set to whether the former is a -- subset of the latter isSubsetOf :: Ord a => Set a -> Set a -> Bool -- | <math> From a set to the maximum element of the set lookupMax :: Set a -> Maybe a -- | <math> From a set to the minimum element of the set lookupMin :: Set a -> Maybe a -- | <math> From an element and a set to whether the element is in -- the set member :: Ord a => a -> Set a -> Bool -- | <math> From a set to whether the set is empty null :: Set a -> Bool -- | <math> From a set to the size of the set size :: Set a -> Int -- | <math> From a set to whether its internal structure is valid, -- i.e. height-balanced and ordered valid :: Ord a => Set a -> Bool instance GHC.Classes.Ord a => GHC.Classes.Ord (Mini.Data.Set.Set a) instance GHC.Classes.Eq a => GHC.Classes.Eq (Mini.Data.Set.Set a) instance GHC.Show.Show a => GHC.Show.Show (Mini.Data.Set.Set a) instance Data.Foldable.Foldable Mini.Data.Set.Set -- | Minimal library of van Laarhoven lenses: composable polymorphic -- record updates module Mini.Lens -- | A purely functional reference for updating structures of type s -- with fields of type a to structures of type t with -- fields of type b type Lens s t a b = forall f. (Functor f) => (a -> f b) -> (s -> f t) -- | From a getter and a setter to a lens -- --
--   data Foo = Foo { _bar :: Bar } deriving Show
--   data Bar = Bar { _baz :: Int } deriving Show
--   
--   bar :: Lens Foo Foo Bar Bar
--   bar = lens _bar $ \s b -> s { _bar = b }
--   
--   baz :: Lens Bar Bar Int Int
--   baz = lens _baz $ \s b -> s { _baz = b }
--   
lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b -- | From a lens and a structure to the value of the field of the structure -- referenced by the lens -- --
--   ghci> view (bar . baz) $ Foo (Bar 73)
--   73
--   
view :: Lens s t a b -> s -> a -- | From a lens, an operation and a structure to the structure updated by -- applying the operation to the value of the field referenced by the -- lens -- --
--   ghci> over (bar . baz) (+ 1) $ Foo (Bar 73)
--   Foo {_bar = Bar {_baz = 74}}
--   
over :: Lens s t a b -> (a -> b) -> s -> t -- | From a lens, a value and a structure to the structure updated by -- setting the field referenced by the lens to the value -- --
--   ghci> set (bar . baz) 21 $ Foo (Bar 73)
--   Foo {_bar = Bar {_baz = 21}}
--   
set :: Lens s t a b -> b -> s -> t -- | The class of monad transformers module Mini.Transformers.Class -- | Instances should satisfy the following laws: -- --
--   lift . pure = pure
--   
-- --
--   lift (m >>= f) = lift m >>= (lift . f)
--   
class MonadTrans t -- | Lift a computation from the inner monad to the transformer monad lift :: (MonadTrans t, Monad m) => m a -> t m a -- | Extend a monad with the ability to terminate a computation with a -- value module Mini.Transformers.EitherT -- | A terminable transformer with termination e, inner monad -- m, return a newtype EitherT e m a EitherT :: m (Either e a) -> EitherT e m a -- | Unwrap an EitherT computation runEitherT :: EitherT e m a -> m (Either e a) -- | Terminate the computation with a value left :: Monad m => e -> EitherT e m a -- | Run a computation and get its result anticipate :: Monad m => EitherT e m a -> EitherT e m (Either e a) instance GHC.Base.Monad m => GHC.Base.Functor (Mini.Transformers.EitherT.EitherT e m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mini.Transformers.EitherT.EitherT e m) instance (GHC.Base.Monad m, GHC.Base.Monoid e) => GHC.Base.Alternative (Mini.Transformers.EitherT.EitherT e m) instance GHC.Base.Monad m => GHC.Base.Monad (Mini.Transformers.EitherT.EitherT e m) instance Mini.Transformers.Class.MonadTrans (Mini.Transformers.EitherT.EitherT e) -- | Extend a monad with the ability to terminate a computation without a -- value module Mini.Transformers.MaybeT -- | A terminable transformer with inner monad m, return a newtype MaybeT m a MaybeT :: m (Maybe a) -> MaybeT m a -- | Unwrap a MaybeT computation runMaybeT :: MaybeT m a -> m (Maybe a) -- | Terminate the computation without a value nothing :: Monad m => MaybeT m a -- | Run a computation and get its result anticipate :: Monad m => MaybeT m a -> MaybeT m (Maybe a) instance GHC.Base.Monad m => GHC.Base.Functor (Mini.Transformers.MaybeT.MaybeT m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mini.Transformers.MaybeT.MaybeT m) instance GHC.Base.Monad m => GHC.Base.Alternative (Mini.Transformers.MaybeT.MaybeT m) instance GHC.Base.Monad m => GHC.Base.Monad (Mini.Transformers.MaybeT.MaybeT m) instance Mini.Transformers.Class.MonadTrans Mini.Transformers.MaybeT.MaybeT -- | Extend a monad with the ability to parse symbol sequences module Mini.Transformers.ParserT -- | A transformer parsing symbols s, inner monad m, return -- a newtype ParserT s m a ParserT :: ([s] -> m (Either [ParseError s] (a, [s]))) -> ParserT s m a -- | Abstract representation of a parse error for symbols s data ParseError s -- | Unwrap a ParserT computation with a sequence of symbols to -- parse runParserT :: ParserT s m a -> [s] -> m (Either [ParseError s] (a, [s])) -- | Parse symbols satisfying a predicate sat :: Applicative m => (s -> Bool) -> ParserT s m s -- | Parse any symbol item :: Applicative m => ParserT s m s -- | Parse a symbol symbol :: (Applicative m, Eq s) => s -> ParserT s m s -- | Parse a sequence of symbols string :: (Monad m, Traversable t, Eq s) => t s -> ParserT s m (t s) -- | Parse symbols included in a collection oneOf :: (Applicative m, Foldable t, Eq s) => t s -> ParserT s m s -- | Parse symbols excluded from a collection noneOf :: (Applicative m, Foldable t, Eq s) => t s -> ParserT s m s -- | Parse zero or more p separated by q via p -- `sepBy` q sepBy :: (Monad m, Eq s) => ParserT s m a -> ParserT s m b -> ParserT s m [a] -- | Parse one or more p separated by q via p -- `sepBy1` q sepBy1 :: (Monad m, Eq s) => ParserT s m a -> ParserT s m b -> ParserT s m [a] -- | Parse zero or more p separated and ended by q via -- p `endBy` q endBy :: (Monad m, Eq s) => ParserT s m a -> ParserT s m b -> ParserT s m [a] -- | Parse one or more p separated and ended by q via -- p `endBy1` q endBy1 :: (Monad m, Eq s) => ParserT s m a -> ParserT s m b -> ParserT s m [a] -- | Parse p enclosed by a and b via between -- a b p between :: Monad m => ParserT s m open -> ParserT s m close -> ParserT s m a -> ParserT s m a -- | Parse p returning a in case of failure via -- option a p option :: (Monad m, Eq s) => a -> ParserT s m a -> ParserT s m a instance GHC.Base.Monad m => GHC.Base.Functor (Mini.Transformers.ParserT.ParserT s m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mini.Transformers.ParserT.ParserT s m) instance (GHC.Base.Monad m, GHC.Classes.Eq s) => GHC.Base.Alternative (Mini.Transformers.ParserT.ParserT s m) instance GHC.Base.Monad m => GHC.Base.Monad (Mini.Transformers.ParserT.ParserT s m) instance Mini.Transformers.Class.MonadTrans (Mini.Transformers.ParserT.ParserT s) instance (GHC.Base.Monad m, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Mini.Transformers.ParserT.ParserT s m a) instance (GHC.Base.Monad m, GHC.Base.Monoid a) => GHC.Base.Monoid (Mini.Transformers.ParserT.ParserT s m a) instance GHC.Show.Show s => GHC.Show.Show (Mini.Transformers.ParserT.ParseError s) -- | Extend a monad with a read-only environment module Mini.Transformers.ReaderT -- | A transformer with read-only r, inner monad m, return -- a newtype ReaderT r m a ReaderT :: (r -> m a) -> ReaderT r m a -- | Unwrap a ReaderT computation with an initial read-only value runReaderT :: ReaderT r m a -> r -> m a -- | Fetch the read-only environment ask :: Monad m => ReaderT r m r instance GHC.Base.Monad m => GHC.Base.Functor (Mini.Transformers.ReaderT.ReaderT r m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mini.Transformers.ReaderT.ReaderT r m) instance (GHC.Base.Monad m, GHC.Base.Alternative m) => GHC.Base.Alternative (Mini.Transformers.ReaderT.ReaderT r m) instance GHC.Base.Monad m => GHC.Base.Monad (Mini.Transformers.ReaderT.ReaderT r m) instance Mini.Transformers.Class.MonadTrans (Mini.Transformers.ReaderT.ReaderT r) -- | Extend a monad with a modifiable environment module Mini.Transformers.StateT -- | A transformer with state s, inner monad m, return -- a newtype StateT s m a StateT :: (s -> m (a, s)) -> StateT s m a -- | Unwrap a StateT computation with an initial state runStateT :: StateT s m a -> s -> m (a, s) -- | Fetch the current state get :: Monad m => StateT s m s -- | Update the current state with an operation modify :: Monad m => (s -> s) -> StateT s m () -- | Overwrite the current state with a value put :: Monad m => s -> StateT s m () instance GHC.Base.Monad m => GHC.Base.Functor (Mini.Transformers.StateT.StateT s m) instance GHC.Base.Monad m => GHC.Base.Applicative (Mini.Transformers.StateT.StateT s m) instance (GHC.Base.Monad m, GHC.Base.Alternative m) => GHC.Base.Alternative (Mini.Transformers.StateT.StateT s m) instance GHC.Base.Monad m => GHC.Base.Monad (Mini.Transformers.StateT.StateT s m) instance Mini.Transformers.Class.MonadTrans (Mini.Transformers.StateT.StateT s) -- | Extend a monad with an accumulative write-only environment module Mini.Transformers.WriterT -- | A transformer with monoidal write-only w, inner monad m, -- return a newtype WriterT w m a WriterT :: m (a, w) -> WriterT w m a -- | Unwrap a WriterT computation runWriterT :: WriterT w m a -> m (a, w) -- | Append a value to the write-only environment tell :: Monad m => w -> WriterT w m () instance (GHC.Base.Monad m, GHC.Base.Monoid w) => GHC.Base.Functor (Mini.Transformers.WriterT.WriterT w m) instance (GHC.Base.Monad m, GHC.Base.Monoid w) => GHC.Base.Applicative (Mini.Transformers.WriterT.WriterT w m) instance (GHC.Base.Monad m, GHC.Base.Alternative m, GHC.Base.Monoid w) => GHC.Base.Alternative (Mini.Transformers.WriterT.WriterT w m) instance (GHC.Base.Monad m, GHC.Base.Monoid w) => GHC.Base.Monad (Mini.Transformers.WriterT.WriterT w m) instance GHC.Base.Monoid w => Mini.Transformers.Class.MonadTrans (Mini.Transformers.WriterT.WriterT w)