-- 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.3.0 -- | Curated re-export of immutable non-strict (boxed) arrays from -- GHC.Arr module Mini.Data.Array -- | The type of immutable non-strict (boxed) arrays with indices in -- i and elements in e. data () => Array i e -- | The Ix class is used to map a contiguous subrange of values in -- a type onto integers. It is used primarily for array indexing (see the -- array package). -- -- The first argument (l,u) of each of these operations is a -- pair specifying the lower and upper bounds of a contiguous subrange of -- values. -- -- An implementation is entitled to assume the following laws about these -- operations: -- -- class Ord a => Ix a -- | The list of values in the subrange defined by a bounding pair. range :: Ix a => (a, a) -> [a] -- | The position of a subscript in the subrange. index :: Ix a => (a, a) -> a -> Int -- | Like index, but without checking that the value is in range. unsafeIndex :: Ix a => (a, a) -> a -> Int -- | Returns True the given subscript lies in the range defined the -- bounding pair. inRange :: Ix a => (a, a) -> a -> Bool -- | The size of the subrange defined by a bounding pair. rangeSize :: Ix a => (a, a) -> Int -- | like rangeSize, but without checking that the upper bound is in -- range. unsafeRangeSize :: Ix a => (a, a) -> Int -- | Construct an array with the specified bounds and containing values for -- given indices within these bounds. -- -- The array is undefined (i.e. bottom) if any index in the list is out -- of bounds. The Haskell 2010 Report further specifies that if any two -- associations in the list have the same index, the value at that index -- is undefined (i.e. bottom). However in GHC's implementation, the value -- at such an index is the value part of the last association with that -- index in the list. -- -- Because the indices must be checked for these errors, array is -- strict in the bounds argument and in the indices of the association -- list, but non-strict in the values. Thus, recurrences such as the -- following are possible: -- --
--   a = array (1,100) ((1,1) : [(i, i * a!(i-1)) | i <- [2..100]])
--   
-- -- Not every index within the bounds of the array need appear in the -- association list, but the values associated with indices that do not -- appear will be undefined (i.e. bottom). -- -- If, in any dimension, the lower bound is greater than the upper bound, -- then the array is legal, but empty. Indexing an empty array always -- gives an array-bounds error, but bounds still yields the bounds -- with which the array was constructed. array :: Ix i => (i, i) -> [(i, e)] -> Array i e -- | Construct an array from a pair of bounds and a list of values in index -- order. listArray :: Ix i => (i, i) -> [e] -> Array i e -- | The accumArray function deals with repeated indices in the -- association list using an accumulating function which combines -- the values of associations with the same index. -- -- For example, given a list of values of some index type, hist -- produces a histogram of the number of occurrences of each index within -- a specified range: -- --
--   hist :: (Ix a, Num b) => (a,a) -> [a] -> Array a b
--   hist bnds is = accumArray (+) 0 bnds [(i, 1) | i<-is, inRange bnds i]
--   
-- -- accumArray is strict in each result of applying the -- accumulating function, although it is lazy in the initial value. Thus, -- unlike arrays built with array, accumulated arrays should not -- in general be recursive. accumArray :: Ix i => (e -> a -> e) -> e -> (i, i) -> [(i, a)] -> Array i e -- | The list of associations of an array in index order. assocs :: Ix i => Array i e -> [(i, e)] -- | The list of elements of an array in index order. elems :: Array i e -> [e] -- | The list of indices of an array in ascending order. indices :: Ix i => Array i e -> [i] -- | Constructs an array identical to the first argument except that it has -- been updated by the associations in the right argument. For example, -- if m is a 1-origin, n by n matrix, then -- --
--   m//[((i,i), 0) | i <- [1..n]]
--   
-- -- is the same matrix, except with the diagonal zeroed. -- -- Repeated indices in the association list are handled as for -- array: Haskell 2010 specifies that the resulting array is -- undefined (i.e. bottom), but GHC's implementation uses the last -- association for each index. (//) :: Ix i => Array i e -> [(i, e)] -> Array i e infixl 9 // -- | accum f takes an array and an association list and -- accumulates pairs from the list into the array with the accumulating -- function f. Thus accumArray can be defined using -- accum: -- --
--   accumArray f z b = accum f (array b [(i, z) | i <- range b])
--   
-- -- accum is strict in all the results of applying the -- accumulation. However, it is lazy in the initial values of the array. accum :: Ix i => (e -> a -> e) -> Array i e -> [(i, a)] -> Array i e -- | ixmap allows for transformations on array indices. It may be -- thought of as providing function composition on the right with the -- mapping that the original array embodies. -- -- A similar transformation of array values may be achieved using -- fmap from the Array instance of the Functor -- class. ixmap :: (Ix i, Ix j) => (i, i) -> (i -> j) -> Array j e -> Array i e -- | The value at the given index in an array. (!) :: Ix i => Array i e -> i -> e infixl 9 ! -- | The value at the given index in an array, unless out of range. (!?) :: Ix i => Array i e -> i -> Maybe e infixl 9 !? -- | The bounds with which an array was constructed. bounds :: Array i e -> (i, i) -- | The number of elements in the array. numElements :: Array i e -> Int -- | 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(n log m) Compose the keys of one set with the values of -- another compose :: (Ord b, Ord a) => Map b c -> Map a b -> Map a c -- | 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(m log n) Subtract a map by another, updating bins of matching -- keys differenceWith :: Ord k => (a -> b -> Maybe a) -> Map k a -> Map k b -> Map k a -- | O(m log n) Subtract a map by another, updating bins of matching -- keys differenceWithKey :: Ord k => (k -> a -> b -> Maybe a) -> 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(n log m) Intersect a map with another by key matching, -- combining values intersectionWith :: Ord k => (a -> b -> c) -> Map k a -> Map k b -> Map k c -- | O(n log m) Intersect a map with another by key matching, -- combining values intersectionWithKey :: Ord k => (k -> a -> b -> c) -> Map k a -> Map k b -> Map k c -- | 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(m log n) Unite a map with another, combining values of -- matching keys unionWith :: Ord k => (a -> a -> a) -> Map k a -> Map k a -> Map k a -- | O(m log n) Unite a map with another, combining values of -- matching keys unionWithKey :: Ord k => (k -> a -> a -> a) -> Map k a -> Map k a -> Map k a -- | Unite a collection of maps via left-biased key matching unions :: (Foldable t, Ord k) => t (Map k a) -> Map k a -- | Unite a collection of maps, combining values of matching keys unionsWith :: (Foldable t, Ord k) => (a -> a -> a) -> t (Map k a) -> Map k a -- | Unite a collection of maps, combining values of matching keys unionsWithKey :: (Foldable t, Ord k) => (k -> a -> a -> a) -> t (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) Adjust with an operation the value of a key in a map adjustWithKey :: Ord k => (k -> a -> a) -> k -> Map k a -> Map k a -- | O(log n) Adjust with an operation the value of the maximum key -- in a map adjustMax :: (a -> a) -> Map k a -> Map k a -- | O(log n) Adjust with an operation the value of the maximum key -- in a map adjustMaxWithKey :: (k -> a -> a) -> Map k a -> Map k a -- | O(log n) Adjust with an operation the value of the minimum key -- in a map adjustMin :: (a -> a) -> Map k a -> Map k a -- | O(log n) Adjust with an operation the value of the minimum key -- in a map adjustMinWithKey :: (k -> a -> a) -> 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(log n) Delete the maximum key from a map deleteMax :: Ord k => Map k a -> Map k a -- | O(log n) Delete the minimum key from a map deleteMin :: Ord 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(log n) Modify the value of a key or delete its bin with an -- operation updateWithKey :: Ord k => (k -> a -> Maybe a) -> k -> Map k a -> Map k a -- | O(log n) Modify the value of the maximum key or delete its bin updateMax :: Ord k => (a -> Maybe a) -> Map k a -> Map k a -- | O(log n) Modify the value of the maximum key or delete its bin updateMaxWithKey :: Ord k => (k -> a -> Maybe a) -> Map k a -> Map k a -- | O(log n) Modify the value of the minimum key or delete its bin updateMin :: Ord k => (a -> Maybe a) -> Map k a -> Map k a -- | O(log n) Modify the value of the minimum key or delete its bin updateMinWithKey :: Ord k => (k -> a -> Maybe a) -> Map k a -> Map k a -- | O(n log n) Partition a map with a predicate into (true, -- false) submaps partition :: Ord k => (a -> Bool) -> Map k a -> (Map k a, Map k a) -- | O(n log n) Partition a map with a predicate into (true, -- false) submaps partitionWithKey :: Ord k => (k -> a -> Bool) -> Map k a -> (Map k a, Map k a) -- | O(n log n) Split a map by a key into (lt, eq, gt) -- submaps split :: Ord k => k -> Map k a -> (Map k a, Maybe a, Map k a) -- | O(log n) Split a map by its maximum key splitMax :: Ord k => Map k a -> Maybe ((k, a), Map k a) -- | O(log n) Split a map by its minimum key splitMin :: Ord k => Map k a -> Maybe ((k, a), Map k a) -- | O(m log n) Check whether two maps have no keys in common disjoint :: Ord k => Map k a -> Map k a -> Bool -- | 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(n log m) Check if the bins of one map exist in the other by -- combination isSubmapOfBy :: Ord k => (a -> b -> Bool) -> Map k a -> Map k b -> 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) Apply an operation across a map, transforming its values fmapWithKey :: (k -> a -> b) -> Map k a -> Map k b -- | 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 -- | Unite a collection of sets unions :: (Foldable t, Ord a) => t (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(log n) Delete the maximum element from a set deleteMax :: Ord a => Set a -> Set a -- | O(log n) Delete the minimum element from a set deleteMin :: Ord 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 n) Partition a set with a predicate into (true, -- false) subsets partition :: Ord a => (a -> Bool) -> Set a -> (Set a, Set a) -- | O(n log n) Split a set by an element into (lt, eq, gt) -- subsets split :: Ord a => a -> Set a -> (Set a, Bool, Set a) -- | O(log n) Split a set by its maximum element splitMax :: Ord a => Set a -> Maybe (a, Set a) -- | O(log n) Split a set by its minimum element splitMin :: Ord a => Set a -> Maybe (a, Set a) -- | O(m log n) Check whether two sets have no elements in common disjoint :: Ord a => Set a -> Set a -> Bool -- | 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) -- | A structure representing unique vertices and their interrelations module Mini.Data.Graph -- | A graph with directed edges between vertices of type a data Graph a -- | Get the shortest distance in a graph between a vertex and another distance :: Ord a => Graph a -> a -> a -> Maybe Int -- | Breadth-first search for the hierarchy in a graph from a starting -- vertex layers :: Ord a => Graph a -> a -> [[a]] -- | Check whether there is a path in a graph from a vertex to another path :: Ord a => Graph a -> a -> a -> Bool -- | Get the reachable vertices in a graph from a starting vertex reachable :: Ord a => Graph a -> a -> [a] -- | Topologically sort a graph (assumes acyclicity) sort :: Ord a => Graph a -> [a] -- | The empty graph empty :: Graph a -- | Make a graph from a list of vertex associations fromList :: Ord a => [(a, [a])] -> Graph a -- | Make a graph with an isolated vertex singleton :: a -> Graph a -- | Add an isolated vertex to a graph unless already present add :: Ord a => a -> Graph a -> Graph a -- | Remove a vertex and its associations from a graph remove :: Ord a => a -> Graph a -> Graph a -- | Add edges from a vertex to a list of vertices in a graph connect :: Ord a => a -> [a] -> Graph a -> Graph a -- | Remove edges from a vertex to a list of vertices in a graph disconnect :: Ord a => a -> [a] -> Graph a -> Graph a -- | Reverse the edges of a graph transpose :: Graph a -> Graph a -- | Get the vertex associations of a graph assocs :: Graph a -> [(a, [a])] -- | Get the edges of a graph edges :: Graph a -> [(a, a)] -- | Get the vertices of a graph vertices :: Graph a -> [a] -- | Get the number of incoming edges to a vertex in a graph indegree :: Ord a => a -> Graph a -> Maybe Int -- | Get the number of incoming edges of each vertex in a graph indegrees :: Graph a -> [(a, Int)] -- | Get the number of outgoing edges from a vertex in a graph outdegree :: Ord a => a -> Graph a -> Maybe Int -- | Get the number of outgoing edges of each vertex in a graph outdegrees :: Graph a -> [(a, Int)] -- | Get the associations of a vertex from a graph lookup :: Ord a => a -> Graph a -> Maybe [a] -- | Get the associations of the least vertex greater than or equal to a -- vertex lookupGE :: Ord a => a -> Graph a -> Maybe (a, [a]) -- | Get the associations of the least vertex strictly greater than a -- vertex lookupGT :: Ord a => a -> Graph a -> Maybe (a, [a]) -- | Get the associations of the greatest vertex less than or equal to a -- vertex lookupLE :: Ord a => a -> Graph a -> Maybe (a, [a]) -- | Get the associations of the greatest vertex strictly less than a -- vertex lookupLT :: Ord a => a -> Graph a -> Maybe (a, [a]) -- | Get the associations of the maximum vertex from a graph lookupMax :: Graph a -> Maybe (a, [a]) -- | Get the associations of the minimum vertex from a graph lookupMin :: Graph a -> Maybe (a, [a]) -- | Check whether a vertex is in a graph member :: Ord a => a -> Graph a -> Bool -- | Get the maximum vertex with no incoming edges from a graph sourceMax :: Graph a -> Maybe a -- | Get the minimum vertex with no incoming edges from a graph sourceMin :: Graph a -> Maybe a -- | Get the vertices with no incoming edges from a graph sources :: Graph a -> [a] -- | Get the maximum vertex with no outgoing edges from a graph sinkMax :: Graph a -> Maybe a -- | Get the minimum vertex with no outgoing edges from a graph sinkMin :: Graph a -> Maybe a -- | Get the vertices with no outgoing edges from a graph sinks :: Graph a -> [a] instance GHC.Classes.Eq a => GHC.Classes.Eq (Mini.Data.Graph.Graph a) instance GHC.Classes.Ord a => GHC.Classes.Ord (Mini.Data.Graph.Graph a) instance GHC.Show.Show a => GHC.Show.Show (Mini.Data.Graph.Graph a) instance Data.Foldable.Foldable Mini.Data.Graph.Graph instance GHC.Classes.Ord a => GHC.Base.Semigroup (Mini.Data.Graph.Graph a) instance GHC.Classes.Ord a => GHC.Base.Monoid (Mini.Data.Graph.Graph 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 until q succeeds via p -- `till1` q till1 :: (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 -- | Find and parse zero or more instances of p via findAll -- p findAll :: (Monad m, Eq s, Show s) => ParserT s m a -> ParserT s m [a] -- | Find and parse one or more instances of p via findAll1 -- p findAll1 :: (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)