Copyright | (c) Fumiaki Kinoshita 2018 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <[email protected]> |
Safe Haskell | None |
Language | Haskell2010 |
Data.Extensible.Wrapper
Description
Synopsis
- class Wrapper (h :: k -> Type) where
- _WrapperAs :: forall {k} f p h proxy (v :: k). (Functor f, Profunctor p, Wrapper h) => proxy v -> Optic' p f (h v) (Repr h v)
- type Comp = Compose :: (k -> Type) -> (k1 -> k) -> k1 -> Type
- pattern Comp :: forall {k} {k1} f g a. f (g a) -> Compose f g a
- getComp :: forall {k} {k1} f (g :: k1 -> k) (a :: k1). Compose f g a -> f (g a)
- comp :: forall {k1} f a g (b :: k1). Functor f => (a -> g b) -> f a -> Compose f g b
- data Prod (f :: k -> Type) (g :: k -> Type) (a :: k) = Prod (f a) (g a)
Documentation
class Wrapper (h :: k -> Type) where Source #
The extensible data types should take k -> Type
as a parameter.
This class allows us to take a shortcut for direct representation.
Associated Types
type Repr (h :: k -> Type) (v :: k) Source #
is the user-facing representation of Repr
h vh v
.
Methods
_Wrapper :: forall f p (v :: k). (Functor f, Profunctor p) => Optic' p f (h v) (Repr h v) Source #
This is an isomorphism between h v
and
.Repr
h v
_Wrapper :: Iso' (h v) (Repr h v)
Instances
_WrapperAs :: forall {k} f p h proxy (v :: k). (Functor f, Profunctor p, Wrapper h) => proxy v -> Optic' p f (h v) (Repr h v) Source #
Restricted version of _Wrapper
.
It is useful for eliminating ambiguousness.
type Comp = Compose :: (k -> Type) -> (k1 -> k) -> k1 -> Type Source #
Deprecated: Use Compose instead
pattern Comp :: forall {k} {k1} f g a. f (g a) -> Compose f g a Source #
Deprecated: Use Compose instead
getComp :: forall {k} {k1} f (g :: k1 -> k) (a :: k1). Compose f g a -> f (g a) Source #
Deprecated: Use getCompose instead
comp :: forall {k1} f a g (b :: k1). Functor f => (a -> g b) -> f a -> Compose f g b Source #
Wrap a result of fmap
data Prod (f :: k -> Type) (g :: k -> Type) (a :: k) Source #
Poly-kinded product
Constructors
Prod (f a) (g a) |
Instances
(Wrapper f, Wrapper g) => Wrapper (Prod f g :: k -> Type) Source # | |||||
(Foldable f, Foldable g) => Foldable (Prod f g) Source # | |||||
Defined in Data.Extensible.Wrapper Methods fold :: Monoid m => Prod f g m -> m # foldMap :: Monoid m => (a -> m) -> Prod f g a -> m # foldMap' :: Monoid m => (a -> m) -> Prod f g a -> m # foldr :: (a -> b -> b) -> b -> Prod f g a -> b # foldr' :: (a -> b -> b) -> b -> Prod f g a -> b # foldl :: (b -> a -> b) -> b -> Prod f g a -> b # foldl' :: (b -> a -> b) -> b -> Prod f g a -> b # foldr1 :: (a -> a -> a) -> Prod f g a -> a # foldl1 :: (a -> a -> a) -> Prod f g a -> a # elem :: Eq a => a -> Prod f g a -> Bool # maximum :: Ord a => Prod f g a -> a # minimum :: Ord a => Prod f g a -> a # | |||||
(Traversable f, Traversable g) => Traversable (Prod f g) Source # | |||||
Defined in Data.Extensible.Wrapper | |||||
(Functor f, Functor g) => Functor (Prod f g) Source # | |||||
(Arbitrary (f a), Arbitrary (g a)) => Arbitrary (Prod f g a) Source # | |||||
(Monoid (f a), Monoid (g a)) => Monoid (Prod f g a) Source # | |||||
(Semigroup (f a), Semigroup (g a)) => Semigroup (Prod f g a) Source # | |||||
Generic (Prod f g a) Source # | |||||
Defined in Data.Extensible.Wrapper Associated Types
| |||||
(Show (f a), Show (g a)) => Show (Prod f g a) Source # | |||||
(NFData (f a), NFData (g a)) => NFData (Prod f g a) Source # | |||||
Defined in Data.Extensible.Wrapper | |||||
(Eq (f a), Eq (g a)) => Eq (Prod f g a) Source # | |||||
(Ord (f a), Ord (g a)) => Ord (Prod f g a) Source # | |||||
Defined in Data.Extensible.Wrapper | |||||
(Hashable (f a), Hashable (g a)) => Hashable (Prod f g a) Source # | |||||
Defined in Data.Extensible.Wrapper | |||||
type Repr (Prod f g :: k -> Type) (a :: k) Source # | |||||
type Rep (Prod f g a) Source # | |||||
Defined in Data.Extensible.Wrapper type Rep (Prod f g a) = D1 ('MetaData "Prod" "Data.Extensible.Wrapper" "extensible-0.9.2-4T9Z6Fi5USt46xSSDAXrdd" 'False) (C1 ('MetaCons "Prod" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (f a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (g a)))) |