Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Control.Iterate.Collect
Synopsis
- newtype Cont ans x = Cont {
- runCont :: (x -> ans) -> ans
- newtype Collect tuple = Collect {
- runCollect :: forall ans. ans -> (tuple -> ans -> ans) -> ans
- fixAction :: Collect tuple -> ans -> (tuple -> ans -> ans) -> ans
- mapify :: Ord a => Collect (a, b) -> Map a b
- listify :: Collect (a, b) -> [(a, b)]
- count :: Collect (a, b) -> Int
- one :: t -> Collect t
- none :: Collect t
- front :: t -> Collect t -> Collect t
- rear :: Collect t -> t -> Collect t
- when :: Bool -> Collect ()
- takeC :: Int -> Collect t -> [t]
- isempty :: Collect t -> Bool
- nonempty :: Collect t -> Bool
- hasElem :: Collect t -> Maybe t
- newtype ColPlus tuple = ColPlus {
- runColPlus :: forall ans. ans -> (tuple -> ans -> ans) -> (ans -> ans -> ans) -> ans
- runPlus :: Monoid a => ColPlus t -> a -> (t -> a -> a) -> a
Documentation
newtype Collect tuple Source #
Constructors
Collect | |
Fields
|
Instances
Monad Collect Source # | |
Functor Collect Source # | |
Applicative Collect Source # | |
Foldable Collect Source # | |
Defined in Control.Iterate.Collect Methods fold :: Monoid m => Collect m -> m # foldMap :: Monoid m => (a -> m) -> Collect a -> m # foldMap' :: Monoid m => (a -> m) -> Collect a -> m # foldr :: (a -> b -> b) -> b -> Collect a -> b # foldr' :: (a -> b -> b) -> b -> Collect a -> b # foldl :: (b -> a -> b) -> b -> Collect a -> b # foldl' :: (b -> a -> b) -> b -> Collect a -> b # foldr1 :: (a -> a -> a) -> Collect a -> a # foldl1 :: (a -> a -> a) -> Collect a -> a # elem :: Eq a => a -> Collect a -> Bool # maximum :: Ord a => Collect a -> a # minimum :: Ord a => Collect a -> a # | |
Show t => Show (Collect t) Source # | Even though a (Collect t) is a function, if we can (Show t), we can pick an action that collects all the shown t, and turn them into a big multi-line string. |
fixAction :: Collect tuple -> ans -> (tuple -> ans -> ans) -> ans Source #
A (Collect t) is completely agnostic over how t
s are beging collected.
We can make this abstraction concrete by using fixAction.