Copyright | (c) Fumiaki Kinoshita 2018 |
---|---|
License | BSD3 |
Maintainer | Fumiaki Kinoshita <[email protected]> |
Safe Haskell | None |
Language | Haskell2010 |
Data.Extensible.Sum
Description
Synopsis
- data (xs :: [k]) :/ (h :: k -> Type) where
- EmbedAt :: forall {k} (xs :: [k]) (x :: k) (h :: k -> Type). !(Membership xs x) -> h x -> xs :/ h
- hoist :: forall {k} g h (xs :: [k]). (forall (x :: k). g x -> h x) -> (xs :/ g) -> xs :/ h
- embed :: forall {k} (x :: k) (xs :: [k]) h. x ∈ xs => h x -> xs :/ h
- strike :: forall {k} h (x :: k) (xs :: [k]). x ∈ xs => (xs :/ h) -> Maybe (h x)
- strikeAt :: forall {k} h (x :: k) (xs :: [k]). Membership xs x -> (xs :/ h) -> Maybe (h x)
- (<:|) :: forall {k} h (x :: k) r (xs :: [k]). (h x -> r) -> ((xs :/ h) -> r) -> ((x ': xs) :/ h) -> r
- exhaust :: forall {k} (h :: k -> Type) r. (('[] :: [k]) :/ h) -> r
- embedAssoc :: forall {k1} {v} (xs :: [Assoc k1 v]) (k2 :: k1) (a :: v) h. Lookup xs k2 a => h (k2 ':> a) -> xs :/ h
Documentation
data (xs :: [k]) :/ (h :: k -> Type) where Source #
The extensible sum type
(:/) :: [k] -> (k -> Type) -> Type
Constructors
EmbedAt :: forall {k} (xs :: [k]) (x :: k) (h :: k -> Type). !(Membership xs x) -> h x -> xs :/ h |
Instances
(Applicative f, Choice p) => Extensible f p ((:/) :: [k] -> (k -> Type) -> Type) Source # | |
Defined in Data.Extensible.Sum Methods pieceAt :: forall (xs :: [k]) h (x :: k). ExtensibleConstr ((:/) :: [k] -> (k -> Type) -> Type) xs h x => Membership xs x -> Optic' p f (xs :/ h) (h x) Source # | |
WrapForall (Lift :: Type -> Constraint) h xs => Lift (xs :/ h :: Type) Source # | |
WrapForall Arbitrary h xs => Arbitrary (xs :/ h) Source # | |
Last xs ∈ xs => Bounded (xs :/ (Proxy :: k -> Type)) Source # | |
Enum (xs :/ (Proxy :: k -> Type)) Source # | |
Defined in Data.Extensible.Sum Methods succ :: (xs :/ (Proxy :: k -> Type)) -> xs :/ (Proxy :: k -> Type) # pred :: (xs :/ (Proxy :: k -> Type)) -> xs :/ (Proxy :: k -> Type) # toEnum :: Int -> xs :/ (Proxy :: k -> Type) # fromEnum :: (xs :/ (Proxy :: k -> Type)) -> Int # enumFrom :: (xs :/ (Proxy :: k -> Type)) -> [xs :/ (Proxy :: k -> Type)] # enumFromThen :: (xs :/ (Proxy :: k -> Type)) -> (xs :/ (Proxy :: k -> Type)) -> [xs :/ (Proxy :: k -> Type)] # enumFromTo :: (xs :/ (Proxy :: k -> Type)) -> (xs :/ (Proxy :: k -> Type)) -> [xs :/ (Proxy :: k -> Type)] # enumFromThenTo :: (xs :/ (Proxy :: k -> Type)) -> (xs :/ (Proxy :: k -> Type)) -> (xs :/ (Proxy :: k -> Type)) -> [xs :/ (Proxy :: k -> Type)] # | |
WrapForall Show h xs => Show (xs :/ h) Source # | |
WrapForall NFData h xs => NFData (xs :/ h) Source # | |
Defined in Data.Extensible.Dictionary | |
WrapForall Eq h xs => Eq (xs :/ h) Source # | |
(Eq (xs :/ h), WrapForall Ord h xs) => Ord (xs :/ h) Source # | |
Defined in Data.Extensible.Dictionary | |
(WrapForall Eq h xs, WrapForall Hashable h xs) => Hashable (xs :/ h) Source # | |
Defined in Data.Extensible.Dictionary | |
WrapForall Pretty h xs => Pretty (xs :/ h) Source # | |
Defined in Data.Extensible.Dictionary | |
type ExtensibleConstr ((:/) :: [k] -> (k -> Type) -> Type) (xs :: [k]) (h :: k -> Type) (x :: k) Source # | |
Defined in Data.Extensible.Sum type ExtensibleConstr ((:/) :: [k] -> (k -> Type) -> Type) (xs :: [k]) (h :: k -> Type) (x :: k) = () |
hoist :: forall {k} g h (xs :: [k]). (forall (x :: k). g x -> h x) -> (xs :/ g) -> xs :/ h Source #
Change the wrapper.
strike :: forall {k} h (x :: k) (xs :: [k]). x ∈ xs => (xs :/ h) -> Maybe (h x) Source #
Try to extract something you want.
strikeAt :: forall {k} h (x :: k) (xs :: [k]). Membership xs x -> (xs :/ h) -> Maybe (h x) Source #
Try to extract something you want.