-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Extensible, efficient, optics-friendly data types -- -- Poly-kinded extensible records and variants @package extensible @version 0.3.7 -- | Re-implementation of lens combinators module Data.Extensible.Internal.Rig type Optic p f s t a b = p a (f b) -> p s (f t) type Optic' p f s a = p a (f a) -> p s (f s) -- |
--   view :: Getter s a -> s -> a
--   
view :: Optic' (->) (Const a) s a -> s -> a -- |
--   views :: Getter s a -> (a -> r) -> (s -> r)
--   
views :: Optic' (->) (Const r) s a -> (a -> r) -> s -> r -- |
--   over :: Setter s t a b -> (a -> b) -> (s -> t)
--   
over :: Optic (->) Identity s t a b -> (a -> b) -> s -> t withIso :: Optic (Exchange a b) Identity s t a b -> ((s -> a) -> (b -> t) -> r) -> r data Exchange a b s t Exchange :: (s -> a) -> (b -> t) -> Exchange a b s t review :: Optic' Tagged Identity s a -> a -> s instance Data.Profunctor.Unsafe.Profunctor (Data.Extensible.Internal.Rig.Exchange a b) -- | A bunch of combinators that contains magic module Data.Extensible.Internal -- | The position of x in the type level set xs. data Membership (xs :: [k]) (x :: k) getMemberId :: Membership xs x -> Word -- | Generates a Membership that corresponds to the given ordinal -- (0-origin). mkMembership :: Int -> Q Exp reifyMembership :: Word -> (forall x. Membership xs x -> r) -> r -- | Embodies a type equivalence to ensure that the Membership -- points the first element. runMembership :: Membership (y : xs) x -> (x :~: y -> r) -> (Membership xs x -> r) -> r -- | Compare two Memberships. compareMembership :: Membership xs x -> Membership xs y -> Either Ordering (x :~: y) impossibleMembership :: Membership '[] x -> r class Member xs x membership :: Member xs x => Membership xs x -- | Remember that Member xs x from Membership. remember :: Membership xs x -> (Member xs x => r) -> r -- | Unicode flipped alias for Member type (∈) x xs = Member xs x -- | FindType types -- | The kind of key-value pairs data Assoc k v (:>) :: k -> v -> Assoc k v -- | Associate k v xs is essentially identical to (k -- :> v) ∈ xs , but the type v is inferred from -- k and xs. class Associate k v xs | k xs -> v association :: Associate k v xs => Membership xs (k :> v) data Elaborated k v Expecting :: v -> Elaborated k v Missing :: k -> Elaborated k v Duplicate :: k -> Elaborated k v -- | Ensure that the first element of xs is x data NavHere xs x Here :: NavHere (x : xs) x -- | PRIVILEGED: Navigate a tree. navigate :: (NavHere xs x -> r) -> (Membership (Half (Tail xs)) x -> r) -> (Membership (Half (Tail (Tail xs))) x -> r) -> Membership xs x -> r -- | The Membership points the first element here :: Membership (x : xs) x -- | The next membership navNext :: Membership xs y -> Membership (x : xs) y -- | Describes the relation of Membership within a tree navL :: Membership (Half xs) y -> Membership (x : xs) y -- | Describes the relation of Membership within a tree navR :: Membership (Half (Tail xs)) y -> Membership (x : xs) y -- | Type level binary number data Nat Zero :: Nat DNat :: Nat -> Nat SDNat :: Nat -> Nat -- | Converts type naturals into Word. class KnownPosition n theInt :: KnownPosition n => proxy n -> Word -- | The successor of the number -- | Interleaved list -- | Type-level tail -- | Type level ++ -- | Type level map -- | Type level merging -- | Type level concat instance forall (k :: BOX) (xs :: [k]) (x :: k) (pos :: Data.Extensible.Internal.Nat). (Data.Extensible.Internal.Elaborate x (Data.Extensible.Internal.FindType x xs) ~ 'Data.Extensible.Internal.Expecting pos, Data.Extensible.Internal.KnownPosition pos) => Data.Extensible.Internal.Member xs x instance forall (k :: BOX) (k1 :: BOX) (k2 :: k) (v :: k1) (xs :: [Data.Extensible.Internal.Assoc k k1]) (n :: Data.Extensible.Internal.Nat). (Data.Extensible.Internal.Elaborate k2 (Data.Extensible.Internal.FindAssoc k2 xs) ~ 'Data.Extensible.Internal.Expecting (n 'Data.Extensible.Internal.:> v), Data.Extensible.Internal.KnownPosition n) => Data.Extensible.Internal.Associate k2 v xs instance forall (k :: BOX) (xs :: [k]) (x :: k). GHC.Show.Show (Data.Extensible.Internal.Membership xs x) instance forall (k :: BOX) (xs :: [k]) (x :: k). GHC.Classes.Eq (Data.Extensible.Internal.Membership xs x) instance forall (k :: BOX) (xs :: [k]) (x :: k). GHC.Classes.Ord (Data.Extensible.Internal.Membership xs x) instance Data.Extensible.Internal.KnownPosition 'Data.Extensible.Internal.Zero instance Data.Extensible.Internal.KnownPosition n => Data.Extensible.Internal.KnownPosition ('Data.Extensible.Internal.DNat n) instance Data.Extensible.Internal.KnownPosition n => Data.Extensible.Internal.KnownPosition ('Data.Extensible.Internal.SDNat n) module Data.Extensible.Wrapper -- | The extensible data types should take k -> * as a -- parameter. This class allows us to take a shortcut for direct -- representation. class Wrapper (h :: k -> *) where type family Repr h (v :: k) :: * -- | This is an isomorphism between h v and Repr h -- v. -- --
--   _Wrapper :: Iso' (h v) (Repr h v)
--   
_Wrapper :: (Wrapper h, Functor f, Profunctor p) => Optic' p f (h v) (Repr h v) -- | Restricted version of _Wrapper. It is useful for eliminating -- ambiguousness. _WrapperAs :: (Functor f, Profunctor p, Wrapper h) => proxy v -> Optic' p f (h v) (Repr h v) -- | Poly-kinded Const newtype Const' a x Const' :: a -> Const' a x [getConst'] :: Const' a x -> a -- | Poly-kinded composition newtype Comp (f :: j -> *) (g :: i -> j) (a :: i) Comp :: f (g a) -> Comp [getComp] :: Comp -> f (g a) comp :: Functor f => (a -> g b) -> f a -> Comp f g b instance forall (k :: BOX) a (x :: k). GHC.Classes.Ord a => GHC.Classes.Ord (Data.Extensible.Wrapper.Const' a x) instance forall (k :: BOX) a (x :: k). GHC.Classes.Eq a => GHC.Classes.Eq (Data.Extensible.Wrapper.Const' a x) instance forall (k :: BOX) a (x :: k). GHC.Show.Show a => GHC.Show.Show (Data.Extensible.Wrapper.Const' a x) instance forall (j :: BOX) (i :: BOX) (f :: j -> *) (g :: i -> j) (a :: i). GHC.Classes.Ord (f (g a)) => GHC.Classes.Ord (Data.Extensible.Wrapper.Comp f g a) instance forall (j :: BOX) (i :: BOX) (f :: j -> *) (g :: i -> j) (a :: i). GHC.Classes.Eq (f (g a)) => GHC.Classes.Eq (Data.Extensible.Wrapper.Comp f g a) instance forall (j :: BOX) (i :: BOX) (f :: j -> *) (g :: i -> j) (a :: i). GHC.Show.Show (f (g a)) => GHC.Show.Show (Data.Extensible.Wrapper.Comp f g a) instance Data.Extensible.Wrapper.Wrapper Data.Functor.Identity.Identity instance forall (k :: BOX) (f :: * -> *) (g :: k -> *). (GHC.Base.Functor f, Data.Extensible.Wrapper.Wrapper g) => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Wrapper.Comp f g) instance Data.Extensible.Wrapper.Wrapper (Data.Extensible.Wrapper.Const' a) instance Data.Extensible.Wrapper.Wrapper Data.Proxy.Proxy module Data.Extensible.Class -- | This class allows us to use pieceAt for both sums and products. class (Functor f, Profunctor p) => Extensible f p (t :: (k -> *) -> [k] -> *) pieceAt :: Extensible f p t => Membership xs x -> Optic' p f (t h xs) (h x) -- | Accessor for an element. piece :: (x ∈ xs, Extensible f p t) => Optic' p f (t h xs) (h x) -- | Like piece, but reckon membership from its key. pieceAssoc :: (Associate k v xs, Extensible f p t) => Optic' p f (t h xs) (h (k :> v)) itemAt :: (Wrapper h, Extensible f p t) => Membership xs x -> Optic' p f (t h xs) (Repr h x) item :: (Wrapper h, Extensible f p t, x ∈ xs) => proxy x -> Optic' p f (t h xs) (Repr h x) itemAssoc :: (Wrapper h, Extensible f p t, Associate k v xs) => proxy k -> Optic' p f (t h xs) (Repr h (k :> v)) -- | The position of x in the type level set xs. data Membership (xs :: [k]) (x :: k) -- | Generates a Membership that corresponds to the given ordinal -- (0-origin). mkMembership :: Int -> Q Exp class Member xs x membership :: Member xs x => Membership xs x -- | Remember that Member xs x from Membership. remember :: Membership xs x -> (Member xs x => r) -> r -- | Unicode flipped alias for Member type (∈) x xs = Member xs x -- | FindType types -- | The kind of key-value pairs data Assoc k v (:>) :: k -> v -> Assoc k v -- | Associate k v xs is essentially identical to (k -- :> v) ∈ xs , but the type v is inferred from -- k and xs. class Associate k v xs | k xs -> v association :: Associate k v xs => Membership xs (k :> v) data Elaborated k v Expecting :: v -> Elaborated k v Missing :: k -> Elaborated k v Duplicate :: k -> Elaborated k v module Data.Extensible.Product -- | The type of extensible products. -- --
--   (:*) :: (k -> *) -> [k] -> *
--   
data (:*) (h :: k -> *) (s :: [k]) Nil :: h :* '[] Tree :: !(h x) -> h :* Half xs -> h :* Half (Tail xs) -> h :* (x : xs) -- | O(log n) Add an element to a product. (<:) :: h x -> h :* xs -> h :* (x : xs) -- | An alias for (<:). (<:*) :: h x -> h :* xs -> h :* (x : xs) -- | Combine products. (*++*) :: h :* xs -> h :* ys -> h :* (xs ++ ys) -- | O(1) Extract the head element. hhead :: h :* (x : xs) -> h x -- | O(log n) Extract the tail of the product. htail :: h :* (x : xs) -> h :* xs -- | Split a product to the head and the tail. huncons :: h :* (x : xs) -> (h x, h :* xs) -- | Transform every elements in a product, preserving the order. -- --
--   hmap idid
--   hmap (f . g) ≡ hmap f . hmap g
--   
hmap :: (forall x. g x -> h x) -> g :* xs -> h :* xs -- | hmap with Memberships. hmapWithIndex :: (forall x. Membership xs x -> g x -> h x) -> g :* xs -> h :* xs -- | Transform every elements in a product, preserving the order. htrans :: (forall x. g x -> h (t x)) -> g :* xs -> h :* Map t xs -- | zipWith for heterogeneous product hzipWith :: (forall x. f x -> g x -> h x) -> f :* xs -> g :* xs -> h :* xs -- | zipWith3 for heterogeneous product hzipWith3 :: (forall x. f x -> g x -> h x -> i x) -> f :* xs -> g :* xs -> h :* xs -> i :* xs -- | Map elements to a monoid and combine the results. -- --
--   hfoldMap f . hmap g ≡ hfoldMap (f . g)
--   
hfoldMap :: Monoid a => (forall x. h x -> a) -> h :* xs -> a -- | Traverse all elements and combine the result sequentially. -- htraverse (fmap f . g) ≡ fmap (hmap f) . htraverse g htraverse pure ≡ -- pure htraverse (Comp . fmap g . f) ≡ Comp . fmap (htraverse g) . -- htraverse f htraverse :: Applicative f => (forall x. g x -> f (h x)) -> g :* xs -> f (h :* xs) -- | htraverse with Memberships. htraverseWithIndex :: Applicative f => (forall x. Membership xs x -> g x -> f (h x)) -> g :* xs -> f (h :* xs) -- | sequence analog for extensible products hsequence :: Applicative f => Comp f h :* xs -> f (h :* xs) -- | The dual of htraverse hcollect :: (Functor f, Generate xs) => (a -> h :* xs) -> f a -> Comp f h :* xs -- | The dual of hsequence hdistribute :: (Functor f, Generate xs) => f (h :* xs) -> Comp f h :* xs -- | O(log n) Pick up an elemtnt. hlookup :: Membership xs x -> h :* xs -> h x -- | Flipped hlookup hindex :: h :* xs -> Membership xs x -> h x -- | The legacy name for pieceAt -- | Deprecated: Use pieceAt sectorAt :: Functor f => Membership xs x -> (h x -> f (h x)) -> h :* xs -> f (h :* xs) -- | The legacy name for piece -- | Deprecated: Use piece sector :: (Functor f, x ∈ xs) => (h x -> f (h x)) -> h :* xs -> f (h :* xs) -- | Given a function that maps types to values, we can "collect" entities -- all you want. class Generate (xs :: [k]) -- | O(n) Generate a product with the given function. hgenerate :: (Generate xs, Applicative f) => (forall x. Membership xs x -> f (h x)) -> f (h :* xs) -- | Pure version of hgenerate. -- --
--   hmap f (htabulate g) ≡ htabulate (f . g)
--   htabulate (hindex m) ≡ m
--   hindex (htabulate k) ≡ k
--   
htabulate :: Generate xs => (forall x. Membership xs x -> h x) -> h :* xs -- | Guarantees the all elements satisfies the predicate. class Forall c (xs :: [k]) -- | O(n) Analogous to hgenerate, but it also supplies a -- context c x for every elements in xs. hgenerateFor :: (Forall c xs, Applicative f) => proxy c -> (forall x. c x => Membership xs x -> f (h x)) -> f (h :* xs) -- | Pure version of hgenerateFor. htabulateFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> h x) -> h :* xs instance GHC.Base.Functor f => Data.Extensible.Class.Extensible f (->) (Data.Extensible.Product.:*) instance Data.Extensible.Product.Generate '[] instance forall (k :: BOX) (x :: k) (xs :: [k]). (Data.Extensible.Product.Generate (Data.Extensible.Internal.Half xs), Data.Extensible.Product.Generate (Data.Extensible.Internal.Half (Data.Extensible.Internal.Tail xs))) => Data.Extensible.Product.Generate (x : xs) instance forall (k :: BOX) (c :: k -> GHC.Prim.Constraint). Data.Extensible.Product.Forall c '[] instance forall (k :: BOX) (c :: k -> GHC.Prim.Constraint) (x :: k) (xs :: [k]). (c x, Data.Extensible.Product.Forall c (Data.Extensible.Internal.Half xs), Data.Extensible.Product.Forall c (Data.Extensible.Internal.Half (Data.Extensible.Internal.Tail xs))) => Data.Extensible.Product.Forall c (x : xs) module Data.Extensible.Sum -- | The extensible sum type -- --
--   (:|) :: (k -> *) -> [k] -> *
--   
data (:|) (h :: k -> *) (s :: [k]) EmbedAt :: !(Membership xs x) -> h x -> h :| xs -- | Change the wrapper. hoist :: (forall x. g x -> h x) -> g :| xs -> h :| xs -- | O(1) lift a value. embed :: (x ∈ xs) => h x -> h :| xs -- | Try to extract something you want. strike :: (x ∈ xs) => h :| xs -> Maybe (h x) -- | Try to extract something you want. strikeAt :: Membership xs x -> h :| xs -> Maybe (h x) -- | O(1) Naive pattern match (<:|) :: (h x -> r) -> (h :| xs -> r) -> h :| (x : xs) -> r -- | There is no empty union. exhaust :: h :| '[] -> r -- | A traversal that tries to point a specific element. -- | Deprecated: Use piece instead picked :: (x ∈ xs, Applicative f) => (h x -> f (h x)) -> h :| xs -> f (h :| xs) -- | Embed a value, but focuses on its key. embedAssoc :: Associate k a xs => h (k :> a) -> h :| xs instance forall (k :: BOX) (xs :: [k]). GHC.Enum.Enum (Data.Proxy.Proxy Data.Extensible.Sum.:| xs) instance forall (k :: BOX) (xs :: [k]). (Data.Extensible.Internal.Last xs Data.Extensible.Internal.∈ xs) => GHC.Enum.Bounded (Data.Proxy.Proxy Data.Extensible.Sum.:| xs) instance (GHC.Base.Applicative f, Data.Profunctor.Choice.Choice p) => Data.Extensible.Class.Extensible f p (Data.Extensible.Sum.:|) module Data.Extensible.Dictionary -- | Reify a collection of dictionaries, as you wish. library :: Forall c xs => Comp Dict c :* xs -- | Forall upon a wrapper type WrapForall c h = Forall (Instance1 c h) -- | Composition for a class and a wrapper class c (h x) => Instance1 c h x instance GHC.Base.Monoid (Data.Extensible.Dictionary.MergeList a) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Show.Show h xs => GHC.Show.Show (h Data.Extensible.Product.:* xs) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Classes.Eq h xs => GHC.Classes.Eq (h Data.Extensible.Product.:* xs) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). (GHC.Classes.Eq (h Data.Extensible.Product.:* xs), Data.Extensible.Dictionary.WrapForall GHC.Classes.Ord h xs) => GHC.Classes.Ord (h Data.Extensible.Product.:* xs) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Base.Monoid h xs => GHC.Base.Monoid (h Data.Extensible.Product.:* xs) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Show.Show h xs => GHC.Show.Show (h Data.Extensible.Sum.:| xs) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Classes.Eq h xs => GHC.Classes.Eq (h Data.Extensible.Sum.:| xs) instance forall (k :: BOX) (h :: k -> *) (xs :: [k]). (GHC.Classes.Eq (h Data.Extensible.Sum.:| xs), Data.Extensible.Dictionary.WrapForall GHC.Classes.Ord h xs) => GHC.Classes.Ord (h Data.Extensible.Sum.:| xs) instance forall (k :: BOX) (k1 :: BOX) (c :: k -> GHC.Prim.Constraint) (h :: k1 -> k) (x :: k1). c (h x) => Data.Extensible.Dictionary.Instance1 c h x module Data.Extensible.Inclusion -- | Unicode alias for Include type (⊆) xs ys = Include ys xs -- | ys contains xs type Include ys = Forall (Member ys) -- | Reify the inclusion of type level sets. inclusion :: Include ys xs => Membership ys :* xs -- | O(m log n) Select some elements. shrink :: (xs ⊆ ys) => h :* ys -> h :* xs -- | O(log n) Embed to a larger union. spread :: (xs ⊆ ys) => h :| xs -> h :| ys -- | Similar to Include, but this focuses on keys. type IncludeAssoc ys = Forall (Associated ys) class Associated xs t -- | Reify the inclusion of type level sets. inclusionAssoc :: IncludeAssoc ys xs => Membership ys :* xs -- | O(m log n) Select some elements. shrinkAssoc :: (IncludeAssoc ys xs) => h :* ys -> h :* xs -- | O(log n) Embed to a larger union. spreadAssoc :: (IncludeAssoc ys xs) => h :| xs -> h :| ys instance forall (k :: BOX) (k1 :: BOX) (xs :: [Data.Extensible.Internal.Assoc k k1]) (k2 :: k) (v :: k1). Data.Extensible.Internal.Associate k2 v xs => Data.Extensible.Inclusion.Associated xs (k2 'Data.Extensible.Internal.:> v) -- | Pattern matching module Data.Extensible.Match -- | Retrieve the contents so that they matches and pass both to the given -- function. matchWith :: (forall x. f x -> g x -> r) -> f :* xs -> g :| xs -> r -- | Turn a wrapper type into a clause for it. newtype Match h r x Match :: (h x -> r) -> Match h r x [runMatch] :: Match h r x -> h x -> r -- | O(log n) Perform pattern matching. match :: Match h a :* xs -> h :| xs -> a -- | Applies a function to the result of Match. mapMatch :: (a -> b) -> Match h a x -> Match h b x -- | Flipped match caseOf :: h :| xs -> Match h a :* xs -> a instance forall (k :: BOX) (h :: k -> *) r. Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Match.Match h r) -- | Flexible records and variants Example: -- https://github.com/fumieval/extensible/blob/master/examples/records.hs module Data.Extensible.Field -- | A Field h (k ':> v) is h v annotated with -- the field name k. -- --
--   Field :: (v -> *) -> Assoc k v -> *
--   
newtype Field (h :: v -> *) (kv :: Assoc k v) Field :: h (AssocValue kv) -> Field [getField] :: Field -> h (AssocValue kv) -- | Annotate a value by the field name. (@=) :: Wrapper h => FieldName k -> Repr h v -> Field h (k :> v) -- | Lifted (@=) (<@=>) :: (Functor f, Wrapper h) => FieldName k -> f (Repr h v) -> Comp f (Field h) (k :> v) -- | Annotate a value by the field name without Wrapper. (@:>) :: FieldName k -> h v -> Field h (k :> v) -- | FieldOptic s is a type of optics that points a -- field/constructor named s. -- -- The yielding fields can be Lenses for Records and -- Prisms for Variants. -- --
--   FieldOptic "foo" = Associate "foo" a xs => Lens' (Record xs) a
--   FieldOptic "foo" = Associate "foo" a xs => Prism' (Variant xs) a
--   
-- -- FieldOptics can be generated using mkField defined in -- the Data.Extensible.TH module. type FieldOptic k = forall f p t xs (h :: kind -> *) (v :: kind). (Extensible f p t, Associate k v xs, Labelling k p, Wrapper h) => Optic' p f (t (Field h) xs) (Repr h v) -- | When you see this type as an argument, it expects a -- FieldLens. This type is used to resolve the name of the field -- internally. type FieldName k = Optic' (LabelPhantom k) Proxy (Inextensible (Field Proxy) '[k :> ()]) () -- | The type of records which contain several fields. -- --
--   RecordOf :: (v -> *) -> [Assoc k v] -> *
--   
type RecordOf h = (:*) (Field h) -- | Simple record type Record = RecordOf Identity -- | An empty Record. emptyRecord :: Record '[] -- | The dual of RecordOf -- --
--   VariantOf :: (v -> *) -> [Assoc k v] -> *
--   
type VariantOf h = (:|) (Field h) -- | Simple variant type Variant = VariantOf Identity -- | Select a corresponding field of a variant. matchWithField :: (forall x. f x -> g x -> r) -> RecordOf f xs -> VariantOf g xs -> r matchField :: RecordOf (Match h r) xs -> VariantOf h xs -> r -- | Take the type of the key -- | Take the type of the value class (pk (AssocKey kv), pv (AssocValue kv)) => KeyValue pk pv kv -- | Proxy-level AssocKey. This is useful when using -- symbolVal. proxyAssocKey :: proxy kv -> Proxy (AssocKey kv) -- | A ghostly type which spells the field name data LabelPhantom s a b -- | The trivial inextensible data type data Inextensible (h :: k -> *) (xs :: [k]) instance forall (k :: BOX) (k1 :: BOX) (pk :: k -> GHC.Prim.Constraint) (pv :: k1 -> GHC.Prim.Constraint) (k2 :: k) (v :: k1). (pk k2, pv v) => Data.Extensible.Field.KeyValue pk pv (k2 'Data.Extensible.Internal.:> v) instance forall (k :: BOX) (k1 :: BOX) (h :: k -> *). Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Field.Field h) instance forall (k :: BOX) (h :: k -> *) (k1 :: GHC.TypeLits.Symbol) (v :: k). (GHC.TypeLits.KnownSymbol k1, Data.Extensible.Wrapper.Wrapper h, GHC.Show.Show (Data.Extensible.Wrapper.Repr h v)) => GHC.Show.Show (Data.Extensible.Field.Field h (k1 'Data.Extensible.Internal.:> v)) instance forall (k :: BOX) (k1 :: BOX) (h :: k -> *) (kv :: Data.Extensible.Internal.Assoc k1 k). GHC.Base.Monoid (h (Data.Extensible.Field.AssocValue kv)) => GHC.Base.Monoid (Data.Extensible.Field.Field h kv) instance (GHC.Base.Functor f, Data.Profunctor.Unsafe.Profunctor p) => Data.Extensible.Class.Extensible f p Data.Extensible.Field.Inextensible instance forall (k :: BOX) (s :: k). Data.Profunctor.Unsafe.Profunctor (Data.Extensible.Field.LabelPhantom s) module Data.Extensible.Effect -- | A unit of effects data Instruction (xs :: [Assoc k (* -> *)]) a Instruction :: !(Membership xs kv) -> AssocValue kv a -> Instruction xs a -- | The extensible operational monad type Eff xs = Skeleton (Instruction xs) -- | Lift some effect to Eff liftEff :: Associate s t xs => proxy s -> t a -> Eff xs a hoistEff :: Associate s t xs => proxy s -> (forall x. t x -> t x) -> Eff xs a -> Eff xs a handleWith :: RecordOf (Handler m) xs -> Eff xs a -> MonadView m (Eff xs) a -- | Transformation between effects newtype Handler f g Handler :: (forall a. g a -> f a) -> Handler f g [runHandler] :: Handler f g -> forall a. g a -> f a -- | Unnamed action data Action (args :: [*]) a r AResult :: Action '[] a a AArgument :: x -> Action xs a r -> Action (x : xs) a r receive :: Functor f => Function xs (f a) -> Handler f (Action xs a) (!-!!) :: Monad m => (forall x. t x -> m x) -> (forall x. Eff xs x -> m x) -> Eff ((s :> t) : xs) a -> m a -- |
--   squash = (!-!! id)
--   
squash :: (forall x. t x -> Eff xs x) -> Eff ((s :> t) : xs) a -> Eff xs a nihility :: Monad m => Eff '[] a -> m a module Data.Extensible.Record -- | The class of types that can be converted to/from a Record. class IsRecord a where type family RecFields a :: [Assoc Symbol *] fromRecord :: IsRecord a => Record (RecFields a) -> a toRecord :: IsRecord a => a -> Record (RecFields a) deriveIsRecord :: Name -> DecsQ instance GHC.Base.Functor Data.Extensible.Record.Shape module Data.Extensible.Nullable -- | The inverse of inclusion. coinclusion :: (Include ys xs, Generate ys) => Nullable (Membership xs) :* ys -- | Extend a product and fill missing fields by Null. wrench :: (Generate ys, xs ⊆ ys) => h :* xs -> Nullable h :* ys -- | Narrow the range of the sum, if possible. retrench :: (Generate ys, xs ⊆ ys) => h :| ys -> Nullable ((:|) h) xs -- | Poly-kinded Maybe newtype Nullable h x Nullable :: Maybe (h x) -> Nullable h x [getNullable] :: Nullable h x -> Maybe (h x) -- | Apply a function to its content. mapNullable :: (g x -> h y) -> Nullable g x -> Nullable h y instance forall (k :: BOX) (h :: k -> *) (x :: k). GHC.Classes.Ord (h x) => GHC.Classes.Ord (Data.Extensible.Nullable.Nullable h x) instance forall (k :: BOX) (h :: k -> *) (x :: k). GHC.Classes.Eq (h x) => GHC.Classes.Eq (Data.Extensible.Nullable.Nullable h x) instance forall (k :: BOX) (h :: k -> *) (x :: k). GHC.Show.Show (h x) => GHC.Show.Show (Data.Extensible.Nullable.Nullable h x) instance forall (k :: BOX) (h :: k -> *). Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Nullable.Nullable h) module Data.Extensible.Plain -- | Alias for plain products type AllOf xs = Identity :* xs -- | Alias for plain sums type OneOf xs = Identity :| xs -- | O(log n) Add a plain value to a product. (<%) :: x -> AllOf xs -> AllOf (x : xs) -- | Extract a plain value. pluck :: (x ∈ xs) => AllOf xs -> x -- | Embed a plain value. bury :: (x ∈ xs) => x -> OneOf xs -- | Naive pattern matching for a plain value. (<%|) :: (x -> r) -> (OneOf xs -> r) -> OneOf (x : xs) -> r -- | An accessor for newtype constructors. accessing :: (Coercible x a, x ∈ xs, Extensible f p t) => (a -> x) -> Optic' p f (t Identity xs) a module Data.Extensible.TH -- | Generate fields using itemAssoc. mkField "foo -- Bar" defines: -- --
--   foo :: FieldOptic "foo"
--   foo = itemAssoc (Proxy :: Proxy "foo")
--   _Bar :: FieldOptic Bar
--   _Bar = itemAssoc (Proxy :: Proxy Bar)
--   
mkField :: String -> DecsQ -- | Generate named effects from a GADT declaration. decEffects :: DecsQ -> DecsQ -- | This module just reexports everything. module Data.Extensible