-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Minimal essentials -- -- Everyday essentials: data structures, lenses, transformers, and -- parsing. -- -- Uncompromisingly light on dependencies. -- -- Easily navigable code base, keeping indirection and clutter to a -- minimum. @package mini @version 1.5.0.0 -- | A structure mapping unique keys to values module Mini.Data.Map -- | A map from keys k to values a, internally structured as -- an AVL tree data Map k a -- | O(1) The empty map empty :: Map k a -- | O(n log n) Make a map from a tail-biased list of (key, -- value) pairs fromList :: Ord k => [(k, a)] -> Map k a -- | O(n log n) Make a map from a list of pairs, combining matching -- keys fromListWith :: Ord k => (a -> a -> a) -> [(k, a)] -> Map k a -- | O(n log n) Make a map from a list of pairs, combining matching -- keys fromListWithKey :: Ord k => (k -> a -> a -> a) -> [(k, a)] -> Map k a -- | O(1) Make a map with a single bin singleton :: k -> a -> Map k a -- | O(m log n) Subtract a map by another via key matching difference :: Ord k => Map k a -> Map k b -> Map k a -- | O(n log m) Intersect a map with another via left-biased key -- matching intersection :: Ord k => Map k a -> Map k b -> Map k a -- | O(m log n) Unite a map with another via left-biased key -- matching union :: Ord k => Map k a -> Map k a -> Map k a -- | O(n) Turn a map into a list of (key, value) pairs in -- ascending order toAscList :: Map k a -> [(k, a)] -- | O(n) Turn a map into a list of (key, value) pairs in -- descending order toDescList :: Map k a -> [(k, a)] -- | O(n) Reduce a map with a left-associative operation and an -- accumulator foldlWithKey :: (b -> k -> a -> b) -> b -> Map k a -> b -- | O(n) Reduce a map with a right-associative operation and an -- accumulator foldrWithKey :: (k -> a -> b -> b) -> b -> Map k a -> b -- | O(log n) Adjust with an operation the value of a key in a map adjust :: Ord k => (a -> a) -> k -> Map k a -> Map k a -- | O(log n) Delete a key from a map delete :: Ord k => k -> Map k a -> Map k a -- | O(n log n) Keep the bins whose values satisfy a predicate filter :: Ord k => (a -> Bool) -> Map k a -> Map k a -- | O(n log n) Keep the bins whose keys and values satisfy a -- predicate filterWithKey :: Ord k => (k -> a -> Bool) -> Map k a -> Map k a -- | O(log n) Insert a key and its value into a map, overwriting if -- present insert :: Ord k => k -> a -> Map k a -> Map k a -- | O(log n) Insert a key and its value, combining new and old if -- present insertWith :: Ord k => (a -> a -> a) -> k -> a -> Map k a -> Map k a -- | O(log n) Insert a key and its value, combining new and old if -- present insertWithKey :: Ord k => (k -> a -> a -> a) -> k -> a -> Map k a -> Map k a -- | O(log n) Modify the value of a key or delete its bin with an -- operation update :: Ord k => (a -> Maybe a) -> k -> Map k a -> Map k a -- | O(n log m) Check whether the bins of one map exist in the other isSubmapOf :: (Ord k, Eq a) => Map k a -> Map k a -> Bool -- | O(log n) Fetch the value of a key in a map, or Nothing -- if absent lookup :: Ord k => k -> Map k a -> Maybe a -- | O(log n) Fetch the least bin greater than or equal to a key lookupGE :: Ord k => k -> Map k a -> Maybe (k, a) -- | O(log n) Fetch the least bin strictly greater than a key lookupGT :: Ord k => k -> Map k a -> Maybe (k, a) -- | O(log n) Fetch the greatest bin less than or equal to a key lookupLE :: Ord k => k -> Map k a -> Maybe (k, a) -- | O(log n) Fetch the greatest bin strictly less than a key lookupLT :: Ord k => k -> Map k a -> Maybe (k, a) -- | O(log n) Fetch the bin with the maximum key, or Nothing -- if empty lookupMax :: Map k a -> Maybe (k, a) -- | O(log n) Fetch the bin with the minimum key, or Nothing -- if empty lookupMin :: Map k a -> Maybe (k, a) -- | O(log n) Check whether a key is in a map member :: Ord k => k -> Map k a -> Bool -- | O(1) Check whether a map is empty null :: Map k a -> Bool -- | O(n) Get the size of a map size :: Map k a -> Int -- | O(n) Lift a map with a lifting operation on keys and values traverseWithKey :: Applicative f => (k -> a -> f b) -> Map k a -> f (Map k b) -- | O(n) Check whether a map is internally height-balanced and -- ordered valid :: Ord k => Map k a -> Bool instance (GHC.Classes.Eq k, GHC.Classes.Eq a) => GHC.Classes.Eq (Mini.Data.Map.Map k a) instance (GHC.Classes.Ord k, GHC.Classes.Ord a) => GHC.Classes.Ord (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) -- | A structure containing unique elements module Mini.Data.Set -- | A set containing elements of type a, internally structured as -- an AVL tree data Set a -- | O(1) The empty set empty :: Set a -- | O(n log n) Make a set from a list of elements fromList :: Ord a => [a] -> Set a -- | O(1) Make a set with a single element singleton :: a -> Set a -- | O(m log n) Subtract a set by another difference :: Ord a => Set a -> Set a -> Set a -- | O(m log n) Intersect a set with another intersection :: Ord a => Set a -> Set a -> Set a -- | O(m log n) Unite a set with another union :: Ord a => Set a -> Set a -> Set a -- | O(n) Turn a set into a list of elements in ascending order toAscList :: Set a -> [a] -- | O(n) Turn a set into a list of elements in descending order toDescList :: Set a -> [a] -- | O(log n) Delete an element from a set delete :: Ord a => a -> Set a -> Set a -- | O(n log n) Keep the elements satisfying a predicate filter :: Ord a => (a -> Bool) -> Set a -> Set a -- | O(log n) Insert an element into a set insert :: Ord a => a -> Set a -> Set a -- | O(n log m) Check whether the elements of a set exist in the -- other isSubsetOf :: Ord a => Set a -> Set a -> Bool -- | O(log n) Fetch the least element greater than or equal to the -- given one lookupGE :: Ord a => a -> Set a -> Maybe a -- | O(log n) Fetch the least element strictly greater than the -- given one lookupGT :: Ord a => a -> Set a -> Maybe a -- | O(log n) Fetch the greatest element less than or equal to the -- given one lookupLE :: Ord a => a -> Set a -> Maybe a -- | O(log n) Fetch the greatest element strictly less than the -- given one lookupLT :: Ord a => a -> Set a -> Maybe a -- | O(log n) Fetch the maximum element, or Nothing if the -- set is empty lookupMax :: Set a -> Maybe a -- | O(log n) Fetch the minimum element, or Nothing if the -- set is empty lookupMin :: Set a -> Maybe a -- | O(log n) Check whether an element is in a set member :: Ord a => a -> Set a -> Bool -- | O(1) Check whether a set is empty null :: Set a -> Bool -- | O(n) Get the size of a set size :: Set a -> Int -- | O(n) Check whether a set is internally height-balanced and -- ordered valid :: Ord a => Set a -> Bool instance GHC.Classes.Eq a => GHC.Classes.Eq (Mini.Data.Set.Set a) instance GHC.Classes.Ord a => GHC.Classes.Ord (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 instance GHC.Classes.Ord a => GHC.Base.Semigroup (Mini.Data.Set.Set a) instance GHC.Classes.Ord a => GHC.Base.Monoid (Mini.Data.Set.Set a) -- | Compose polymorphic record updates with van Laarhoven lenses module Mini.Optics.Lens -- | A reference updating structures from s to t and fields -- from a to b type Lens s t a b = forall f. (Functor f) => (a -> f b) -> (s -> f t) -- | Make a lens from a getter and a setter lens :: (s -> a) -> (s -> b -> t) -> Lens s t a b -- | Fetch the field referenced by a lens from a structure view :: Lens s t a b -> s -> a -- | Update the field referenced by a lens with an operation on a structure over :: Lens s t a b -> (a -> b) -> s -> t -- | Overwrite the field referenced by a lens with a value on a structure 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) instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Mini.Transformers.EitherT.EitherT e m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Mini.Transformers.EitherT.EitherT e m) -- | 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 instance GHC.Base.Monad m => Control.Monad.Fail.MonadFail (Mini.Transformers.MaybeT.MaybeT m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Mini.Transformers.MaybeT.MaybeT m) -- | 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 (a, [s]))) -> ParserT s m a -- | A parse error newtype ParseError ParseError :: String -> ParseError [unexpected] :: ParseError -> String -- | Unwrap a ParserT computation with a sequence of symbols to -- parse runParserT :: ParserT s m a -> [s] -> m (Either ParseError (a, [s])) -- | Parse symbols satisfying a predicate sat :: (Applicative m, Show s) => (s -> Bool) -> ParserT s m s -- | Parse any symbol item :: (Applicative m, Show s) => ParserT s m s -- | Parse a symbol symbol :: (Applicative m, Show s, Eq s) => s -> ParserT s m s -- | Parse a sequence of symbols string :: (Monad m, Traversable t, Show s, Eq s) => t s -> ParserT s m (t s) -- | Parse symbols included in a collection oneOf :: (Applicative m, Foldable t, Show s, Eq s) => t s -> ParserT s m s -- | Parse symbols excluded from a collection noneOf :: (Applicative m, Foldable t, Show s, Eq s) => t s -> ParserT s m s -- | Parse successfully only at end of input eof :: (Monad m, Show s) => ParserT s m () -- | Parse the next symbol without consuming it peek :: (Monad m, Show 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 until q succeeds via p -- `till` q till :: (Monad m, Eq s) => ParserT s m a -> ParserT s m b -> ParserT s m [a] -- | Parse one or more p left-associatively chained by f -- via chainl1 p f chainl1 :: (Monad m, Eq s) => ParserT s m a -> ParserT s m (a -> a -> a) -> ParserT s m a -- | Parse one or more p right-associatively chained by f -- via chainr1 p f chainr1 :: (Monad m, Eq s) => ParserT s m a -> ParserT s m (a -> a -> a) -> 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 -- | Parse p, without consuming input, iff p fails via -- reject p reject :: (Monad m, Show a) => ParserT s m a -> ParserT s m () -- | Parse p, without consuming input, iff p succeeds via -- accept p accept :: Monad m => ParserT s m a -> ParserT s m a -- | Find and parse the first instance of p via findFirst -- p findFirst :: (Monad m, Eq s, Show s) => ParserT s m a -> ParserT s m a -- | Find and parse the last instance of p via findLast p findLast :: (Monad m, Eq s, Show s) => ParserT s m a -> ParserT s m a -- | Prepend an error message to that of a parser annotate :: Monad m => String -> ParserT s m a -> ParserT s m a instance GHC.Show.Show Mini.Transformers.ParserT.ParseError 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.Base.Monad m => Control.Monad.Fail.MonadFail (Mini.Transformers.ParserT.ParserT s m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Mini.Transformers.ParserT.ParserT s m) -- | 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 -- | Run a computation in a modified environment local :: (r -> r') -> ReaderT r' m a -> ReaderT r m a 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) instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Mini.Transformers.ReaderT.ReaderT r m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Mini.Transformers.ReaderT.ReaderT r m) -- | 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) instance Control.Monad.Fail.MonadFail m => Control.Monad.Fail.MonadFail (Mini.Transformers.StateT.StateT s m) instance Control.Monad.IO.Class.MonadIO m => Control.Monad.IO.Class.MonadIO (Mini.Transformers.StateT.StateT s m) -- | 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) instance (Control.Monad.Fail.MonadFail m, GHC.Base.Monoid w) => Control.Monad.Fail.MonadFail (Mini.Transformers.WriterT.WriterT w m) instance (Control.Monad.IO.Class.MonadIO m, GHC.Base.Monoid w) => Control.Monad.IO.Class.MonadIO (Mini.Transformers.WriterT.WriterT w m)