mono-traversable-wrapper-0.1.0.0: Wrapper providing Foldable instance for MonoFoldables.

Safe HaskellNone
LanguageHaskell2010

Data.MonoTraversable.Container

Description

This module provides the Container type, which wraps monomorphic types, and makes them conform to the Prelude's non-monomorphic typeclasses.

Synopsis

Documentation

data Container xs a b where Source #

This type can wrap a monomorphic type to allow it to conform to Foldable. For instance, the wrapper for Text would be defined as:

type FoldableText = Container Text Char

Now, this type conforms to Foldable.

Constructors

Container :: a ~ b => xs -> Container xs a b

Can only construct when last type variable is equal to second.

Instances

(MonoFoldable xs, (~) * element (Element xs)) => Foldable (Container xs element) Source # 

Methods

fold :: Monoid m => Container xs element m -> m #

foldMap :: Monoid m => (a -> m) -> Container xs element a -> m #

foldr :: (a -> b -> b) -> b -> Container xs element a -> b #

foldr' :: (a -> b -> b) -> b -> Container xs element a -> b #

foldl :: (b -> a -> b) -> b -> Container xs element a -> b #

foldl' :: (b -> a -> b) -> b -> Container xs element a -> b #

foldr1 :: (a -> a -> a) -> Container xs element a -> a #

foldl1 :: (a -> a -> a) -> Container xs element a -> a #

toList :: Container xs element a -> [a] #

null :: Container xs element a -> Bool #

length :: Container xs element a -> Int #

elem :: Eq a => a -> Container xs element a -> Bool #

maximum :: Ord a => Container xs element a -> a #

minimum :: Ord a => Container xs element a -> a #

sum :: Num a => Container xs element a -> a #

product :: Num a => Container xs element a -> a #

Eq xs => Eq (Container xs a b) Source # 

Methods

(==) :: Container xs a b -> Container xs a b -> Bool #

(/=) :: Container xs a b -> Container xs a b -> Bool #

Ord xs => Ord (Container xs a b) Source # 

Methods

compare :: Container xs a b -> Container xs a b -> Ordering #

(<) :: Container xs a b -> Container xs a b -> Bool #

(<=) :: Container xs a b -> Container xs a b -> Bool #

(>) :: Container xs a b -> Container xs a b -> Bool #

(>=) :: Container xs a b -> Container xs a b -> Bool #

max :: Container xs a b -> Container xs a b -> Container xs a b #

min :: Container xs a b -> Container xs a b -> Container xs a b #

(Read xs, (~) * a b) => Read (Container xs a b) Source # 

Methods

readsPrec :: Int -> ReadS (Container xs a b) #

readList :: ReadS [Container xs a b] #

readPrec :: ReadPrec (Container xs a b) #

readListPrec :: ReadPrec [Container xs a b] #

Show xs => Show (Container xs a b) Source # 

Methods

showsPrec :: Int -> Container xs a b -> ShowS #

show :: Container xs a b -> String #

showList :: [Container xs a b] -> ShowS #

getContainer :: Container xs a b -> xs Source #

Selector for Container