Safe Haskell | Safe-Inferred |
---|
- type :.: f g = Compose f g
- data Monomorphic k = forall a . Monomorphic (k a)
- class Monomorphicable k where
- type MonomorphicRep k :: *
- promote :: MonomorphicRep k -> Monomorphic k
- demote :: Monomorphic k -> MonomorphicRep k
- demote' :: Monomorphicable k => k a -> MonomorphicRep k
- demoteComposed :: Monomorphicable (f :.: g) => f (g a) -> MonomorphicRep (f :.: g)
- monomorphicCompose :: f (g a) -> Monomorphic (f :.: g)
- withPolymorhic :: Monomorphicable k => MonomorphicRep k -> (forall a. k a -> b) -> b
- liftPoly :: Monomorphicable k => (forall a. k a -> b) -> MonomorphicRep k -> b
- viaPoly :: (Monomorphicable k, Monomorphicable k') => (forall x y. k x -> k' y) -> MonomorphicRep k -> MonomorphicRep k'
- newtype Compose f g a = Compose {
- getCompose :: f (g a)
Documentation
data Monomorphic k Source
A wrapper type for polymophic types.
forall a . Monomorphic (k a) |
(Read (MonomorphicRep k k1), Monomorphicable k k1) => Read (Monomorphic k k1) | |
(Show (MonomorphicRep k k1), Monomorphicable k k1) => Show (Monomorphic k k1) |
class Monomorphicable k whereSource
A types which have the monomorphic representation.
type MonomorphicRep k :: *Source
Monomorphic representation
promote :: MonomorphicRep k -> Monomorphic kSource
Promote the monomorphic value to the polymophic one.
demote :: Monomorphic k -> MonomorphicRep kSource
Demote the polymorphic value to the monomorphic representation.
demote' :: Monomorphicable k => k a -> MonomorphicRep kSource
Convinience function to demote polymorphic types into monomorphic one directly.
demoteComposed :: Monomorphicable (f :.: g) => f (g a) -> MonomorphicRep (f :.: g)Source
Demote polymorphic nested types directly into monomorphic representation.
monomorphicCompose :: f (g a) -> Monomorphic (f :.: g)Source
withPolymorhic :: Monomorphicable k => MonomorphicRep k -> (forall a. k a -> b) -> bSource
Apply dependently-typed function to the monomorphic representation.
liftPoly :: Monomorphicable k => (forall a. k a -> b) -> MonomorphicRep k -> bSource
Flipped version of withPolymorhic
.
viaPoly :: (Monomorphicable k, Monomorphicable k') => (forall x y. k x -> k' y) -> MonomorphicRep k -> MonomorphicRep k'Source
Demote the function between polymorphic types into the one between monomorphic one.
newtype Compose f g a
Right-to-left composition of functors. The composition of applicative functors is always applicative, but the composition of monads is not always a monad.
Compose | |
|
(Functor f, Functor g) => Functor (Compose f g) | |
(Applicative f, Applicative g) => Applicative (Compose f g) | |
(Foldable f, Foldable g) => Foldable (Compose f g) | |
(Traversable f, Traversable g) => Traversable (Compose f g) | |
(Alternative f, Applicative g) => Alternative (Compose f g) |