-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Extensible, efficient, optics-friendly data types and effects -- -- This package provides a powerful framework to combine and manipulate -- various types of structures. -- -- See also School of Haskell for tutorials. @package extensible @version 0.6 -- | 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 -- | Recover tho functions from an Iso/ withIso :: Optic (Exchange a b) Identity s t a b -> ((s -> a) -> (b -> t) -> r) -> r -- | Reifies the structure of Isos data Exchange a b s t Exchange :: (s -> a) -> (b -> t) -> Exchange a b s t -- |
--   review :: AReview s a -> a -> s
--   
review :: Optic' Tagged Identity s a -> a -> s instance Data.Profunctor.Unsafe.Profunctor (Data.Extensible.Internal.Rig.Exchange a b) 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 { -- | Repr h v is the actual representation of h v. 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) wrap :: Wrapper h => Repr h v -> h v unwrap :: Wrapper h => 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 composition newtype Comp (f :: j -> *) (g :: i -> j) (a :: i) Comp :: f (g a) -> Comp [getComp] :: Comp -> f (g a) -- | Wrap a result of fmap comp :: Functor f => (a -> g b) -> f a -> Comp f g b -- | Poly-kinded product data Prod f g a Prod :: f a -> g a -> Prod f g a instance (Data.Traversable.Traversable f, Data.Traversable.Traversable g) => Data.Traversable.Traversable (Data.Extensible.Wrapper.Prod f g) instance (Data.Foldable.Foldable f, Data.Foldable.Foldable g) => Data.Foldable.Foldable (Data.Extensible.Wrapper.Prod f g) instance (GHC.Base.Functor f, GHC.Base.Functor g) => GHC.Base.Functor (Data.Extensible.Wrapper.Prod f g) instance forall k (f :: k -> *) (g :: k -> *) (a :: k). GHC.Generics.Generic (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (g :: k -> *) (a :: k). (GHC.Classes.Ord (f a), GHC.Classes.Ord (g a)) => GHC.Classes.Ord (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (g :: k -> *) (a :: k). (GHC.Classes.Eq (f a), GHC.Classes.Eq (g a)) => GHC.Classes.Eq (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (g :: k -> *) (a :: k). (GHC.Show.Show (f a), GHC.Show.Show (g a)) => GHC.Show.Show (Data.Extensible.Wrapper.Prod f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). Data.Text.Prettyprint.Doc.Internal.Pretty (f (g a)) => Data.Text.Prettyprint.Doc.Internal.Pretty (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). Data.Hashable.Class.Hashable (f (g a)) => Data.Hashable.Class.Hashable (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). Test.QuickCheck.Arbitrary.Arbitrary (f (g a)) => Test.QuickCheck.Arbitrary.Arbitrary (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). GHC.Base.Monoid (f (g a)) => GHC.Base.Monoid (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). GHC.Base.Semigroup (f (g a)) => GHC.Base.Semigroup (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). GHC.Generics.Generic (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). Control.DeepSeq.NFData (f (g a)) => Control.DeepSeq.NFData (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). GHC.Classes.Ord (f (g a)) => GHC.Classes.Ord (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). GHC.Classes.Eq (f (g a)) => GHC.Classes.Eq (Data.Extensible.Wrapper.Comp f g a) instance forall j (f :: j -> *) i (g :: i -> j) (a :: i). GHC.Show.Show (f (g a)) => GHC.Show.Show (Data.Extensible.Wrapper.Comp f g a) instance (GHC.Base.Functor f, GHC.Base.Functor g) => GHC.Base.Functor (Data.Extensible.Wrapper.Comp f g) instance (Data.Foldable.Foldable f, Data.Foldable.Foldable g) => Data.Foldable.Foldable (Data.Extensible.Wrapper.Comp f g) instance (Data.Traversable.Traversable f, Data.Traversable.Traversable g) => Data.Traversable.Traversable (Data.Extensible.Wrapper.Comp f g) instance forall k (f :: k -> *) (a :: k) (g :: k -> *). (Control.DeepSeq.NFData (f a), Control.DeepSeq.NFData (g a)) => Control.DeepSeq.NFData (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (a :: k) (g :: k -> *). (Data.Hashable.Class.Hashable (f a), Data.Hashable.Class.Hashable (g a)) => Data.Hashable.Class.Hashable (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (g :: k -> *). (Data.Extensible.Wrapper.Wrapper f, Data.Extensible.Wrapper.Wrapper g) => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Wrapper.Prod f g) instance forall k (f :: k -> *) (a :: k) (g :: k -> *). (GHC.Base.Semigroup (f a), GHC.Base.Semigroup (g a)) => GHC.Base.Semigroup (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (a :: k) (g :: k -> *). (GHC.Base.Monoid (f a), GHC.Base.Monoid (g a)) => GHC.Base.Monoid (Data.Extensible.Wrapper.Prod f g a) instance forall k (f :: k -> *) (a :: k) (g :: k -> *). (Test.QuickCheck.Arbitrary.Arbitrary (f a), Test.QuickCheck.Arbitrary.Arbitrary (g a)) => Test.QuickCheck.Arbitrary.Arbitrary (Data.Extensible.Wrapper.Prod f g a) instance forall i j (f :: j -> *) (g :: i -> j) (a :: i). Language.Haskell.TH.Syntax.Lift (f (g a)) => Language.Haskell.TH.Syntax.Lift (Data.Extensible.Wrapper.Comp f g a) instance forall k (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.Functor.Identity.Identity instance Data.Extensible.Wrapper.Wrapper GHC.Maybe.Maybe instance Data.Extensible.Wrapper.Wrapper (Data.Either.Either e) instance Data.Extensible.Wrapper.Wrapper [] instance Data.Extensible.Wrapper.Wrapper (Data.Functor.Const.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 -> *) -> *) where { type family ExtensibleConstr t (xs :: [k]) (h :: k -> *) (x :: k) :: Constraint; type ExtensibleConstr t xs h x = (); } pieceAt :: (Extensible f p t, ExtensibleConstr t xs h x) => Membership xs x -> Optic' p f (t xs h) (h x) -- | Accessor for an element. piece :: (x ∈ xs, Extensible f p t, ExtensibleConstr t xs h x) => Optic' p f (t xs h) (h x) -- | Like piece, but reckon membership from its key. pieceAssoc :: (Lookup xs k v, Extensible f p t, ExtensibleConstr t xs h (k :> v)) => Optic' p f (t xs h) (h (k :> v)) -- | Access a specified element through a wrapper. itemAt :: (Wrapper h, Extensible f p t, ExtensibleConstr t xs h x) => Membership xs x -> Optic' p f (t xs h) (Repr h x) -- | Access an element through a wrapper. item :: (Wrapper h, Extensible f p t, x ∈ xs, ExtensibleConstr t xs h x) => proxy x -> Optic' p f (t xs h) (Repr h x) -- | Access an element specified by the key type through a wrapper. itemAssoc :: (Wrapper h, Extensible f p t, Lookup xs k v, ExtensibleConstr t xs h (k :> v)) => proxy k -> Optic' p f (t xs h) (Repr h (k :> v)) -- | Access an element specified by the key type through a wrapper. itemKey :: forall k v xs h f p t. (Wrapper h, Extensible f p t, Lookup xs k v, ExtensibleConstr t xs h (k :> v)) => Optic' p f (t xs h) (Repr h (k :> v)) -- | A witness that of x is a member of a type level set -- xs. data Membership (xs :: [k]) (x :: k) :: forall k. () => [k] -> k -> Type -- | Generates a Membership that corresponds to the given ordinal -- (0-origin). mkMembership :: Int -> Q Exp -- | get the position as an Int. getMemberId :: Membership xs x -> Int -- | Compare two Memberships. compareMembership :: () => Membership xs x -> Membership xs y -> Either Ordering (x :~: y) -- | This Membership points to the first element leadership :: () => Membership (x : xs) x -- | x is a member of xs class Member (xs :: [k]) (x :: k) membership :: Member xs x => Membership xs x -- | Unicode flipped alias for Member type (∈) (x :: k) (xs :: [k]) = Member xs x -- | FindType types type family FindType (x :: k) (xs :: [k]) :: [Nat] -- | Every type-level list is an instance of Generate. class Generate (xs :: [k]) -- | Enumerate all possible Memberships of xs. henumerate :: Generate xs => (forall (x :: k). () => Membership xs x -> r -> r) -> r -> r -- | Count the number of memberships. hcount :: Generate xs => proxy xs -> Int -- | Enumerate Memberships and construct an HList. hgenerateList :: (Generate xs, Applicative f) => (forall (x :: k). () => Membership xs x -> f (h x)) -> f (HList h xs) -- | Every element in xs satisfies c class (ForallF c xs, Generate xs) => Forall (c :: k -> Constraint) (xs :: [k]) -- | Enumerate all possible Memberships of xs with an -- additional context. henumerateFor :: Forall c xs => proxy c -> proxy' xs -> (forall (x :: k). c x => Membership xs x -> r -> r) -> r -> r hgenerateListFor :: (Forall c xs, Applicative f) => proxy c -> (forall (x :: k). c x => Membership xs x -> f (h x)) -> f (HList h xs) -- | HACK: Without this, the constraints are not propagated well. type family ForallF (c :: k -> Constraint) (xs :: [k]) :: Constraint -- | The kind of key-value pairs data Assoc k v (:>) :: k -> v -> Assoc k v infix 0 :> -- | A synonym for (:>) type (>:) = ((:>) :: k -> v -> Assoc k v) -- | Lookup xs k v is essentially identical to (k :> -- v) ∈ xs , but the type v is inferred from k and -- xs. class Lookup (xs :: [Assoc k v]) (k1 :: k) (v1 :: v) | k1 xs -> v1 association :: Lookup xs k1 v1 => Membership xs (k1 :> v1) -- | Deprecated: Use Lookup instead type Associate k v xs = Lookup xs k v -- | First element type family Head (xs :: [k]) :: k -- | Last element type family Last (x :: [k]) :: k module Data.Extensible.Sum -- | The extensible sum type -- --
--   (:|) :: (k -> *) -> [k] -> *
--   
data (xs :: [k]) :/ (h :: k -> *) [EmbedAt] :: !Membership xs x -> h x -> xs :/ h -- | Deprecated: Use :/ instead type h :| xs = xs :/ h -- | Change the wrapper. hoist :: (forall x. g x -> h x) -> (xs :/ g) -> xs :/ h -- | O(1) lift a value. embed :: x ∈ xs => h x -> xs :/ h -- | Try to extract something you want. strike :: forall h x xs. x ∈ xs => (xs :/ h) -> Maybe (h x) -- | Try to extract something you want. strikeAt :: forall h x xs. Membership xs x -> (xs :/ h) -> Maybe (h x) -- | O(1) Naive pattern match (<:|) :: (h x -> r) -> ((xs :/ h) -> r) -> ((x : xs) :/ h) -> r infixr 1 <:| -- | There is no empty union. exhaust :: ('[] :/ h) -> r -- | Embed a value, but focuses on its key. embedAssoc :: Lookup xs k a => h (k :> a) -> xs :/ h instance forall k (xs :: [k]). GHC.Enum.Enum (xs Data.Extensible.Sum.:/ Data.Proxy.Proxy) instance forall k (xs :: [k]). (Data.Extensible.Class.Last xs Type.Membership.Internal.∈ xs) => GHC.Enum.Bounded (xs Data.Extensible.Sum.:/ Data.Proxy.Proxy) instance (GHC.Base.Applicative f, Data.Profunctor.Choice.Choice p) => Data.Extensible.Class.Extensible f p (Data.Extensible.Sum.:/) -- | Mutable structs module Data.Extensible.Struct -- | Mutable type-indexed struct. data Struct s (h :: k -> *) (xs :: [k]) -- | Write a value in a Struct. set :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> h x -> m () -- | Read a value from a Struct. get :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> m (h x) -- | Create a new Struct using the supplied initializer. new :: forall h m xs. (PrimMonad m, Generate xs) => (forall x. Membership xs x -> h x) -> m (Struct (PrimState m) h xs) -- | Create a Struct full of the specified value. newRepeat :: forall h m xs. (PrimMonad m, Generate xs) => (forall x. h x) -> m (Struct (PrimState m) h xs) -- | Create a new Struct using the supplied initializer with a -- context. newFor :: forall proxy c h m xs. (PrimMonad m, Forall c xs) => proxy c -> (forall x. c x => Membership xs x -> h x) -> m (Struct (PrimState m) h xs) -- | Create a new Struct from an HList. newFromHList :: forall h m xs. PrimMonad m => HList h xs -> m (Struct (PrimState m) h xs) -- | A pointer to an element in a Struct. data WrappedPointer s h a [WrappedPointer] :: !Struct s h xs -> !Membership xs x -> WrappedPointer s h (Repr h x) -- | Get a WrappedPointer from a name. (-$>) :: forall k h xs v s. Lookup xs k v => Struct s h xs -> Proxy k -> WrappedPointer s h (Repr h (k :> v)) -- | Atomically modify an element in a Struct. atomicModify :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> (h x, a)) -> m a -- | Strict version of atomicModify. atomicModify' :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> (h x, a)) -> m a -- | Apply a function to an element atomically. atomicModify_ :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> h x) -> m (h x) -- | Strict version of atomicModify_. atomicModify'_ :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> h x) -> m (h x) -- | The type of extensible products. -- --
--   (:&) :: [k] -> (k -> *) -> *
--   
data (s :: [k]) :& (h :: k -> *) -- | Deprecated: Use :& instead type h :* xs = xs :& h -- | Turn Struct into an immutable product. The original -- Struct may not be used. unsafeFreeze :: PrimMonad m => Struct (PrimState m) h xs -> m (xs :& h) -- | Create a new Struct using the contents of a product. newFrom :: forall g h m xs. PrimMonad m => (xs :& g) -> (forall x. Membership xs x -> g x -> h x) -> m (Struct (PrimState m) h xs) -- | Get an element in a product. hlookup :: Membership xs x -> (xs :& h) -> h x -- | The size of a product. hlength :: (xs :& h) -> Int -- | Concatenate type level lists type family (++) (xs :: [k]) (ys :: [k]) :: [k] infixr 5 ++ -- | Combine products. happend :: (xs :& h) -> (ys :& h) -> (xs ++ ys) :& h infixr 5 `happend` -- | Right-associative fold of a product. hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> (xs :& h) -> r -- | Create a new Struct from a product. thaw :: PrimMonad m => (xs :& h) -> m (Struct (PrimState m) h xs) -- | Create a product from an ST action which returns a -- Struct. hfrozen :: (forall s. ST s (Struct s h xs)) -> xs :& h -- | Turn a product into a Struct temporarily. hmodify :: (forall s. Struct s h xs -> ST s ()) -> (xs :& h) -> xs :& h -- | Convert a product into an HList. toHList :: forall h xs. (xs :& h) -> HList h xs instance (Data.Profunctor.Rep.Corepresentable p, Control.Comonad.Comonad (Data.Profunctor.Rep.Corep p), GHC.Base.Functor f) => Data.Extensible.Class.Extensible f p (Data.Extensible.Struct.:&) instance forall k s (h :: k -> *) a. (s Data.Type.Equality.~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasGetter (Data.Extensible.Struct.WrappedPointer s h a) a instance forall k s (h :: k -> *) a. (s Data.Type.Equality.~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasSetter (Data.Extensible.Struct.WrappedPointer s h a) a instance forall k s (h :: k -> *) a. (s Data.Type.Equality.~ GHC.Prim.RealWorld, Data.Extensible.Wrapper.Wrapper h) => Data.StateVar.HasUpdate (Data.Extensible.Struct.WrappedPointer s h a) a a module Data.Extensible.Product -- | The type of extensible products. -- --
--   (:&) :: [k] -> (k -> *) -> *
--   
data (s :: [k]) :& (h :: k -> *) -- | Deprecated: Use :& instead type h :* xs = xs :& h -- | An empty product. nil :: '[] :& h -- | O(n) Prepend an element onto a product. Expressions like a <: b -- <: c <: nil are transformed to a single fromHList. (<:) :: h x -> (xs :& h) -> (x : xs) :& h infixr 0 <: -- | Strict version of (<:). ( (xs :& h) -> (x : xs) :& h infixr 0 Repr h x -> (xs :& h) -> (x : xs) :& h infixr 0 =<: -- | The size of a product. hlength :: (xs :& h) -> Int -- | Concatenate type level lists type family (++) (xs :: [k]) (ys :: [k]) :: [k] infixr 5 ++ -- | Combine products. happend :: (xs :& h) -> (ys :& h) -> (xs ++ ys) :& h infixr 5 `happend` -- | Transform every element in a product, preserving the order. -- --
--   hmap idid
--   hmap (f . g) ≡ hmap f . hmap g
--   
hmap :: (forall x. g x -> h x) -> (xs :& g) -> xs :& h -- | Map a function to every element of a product. hmapWithIndex :: (forall x. Membership xs x -> g x -> h x) -> (xs :& g) -> xs :& h -- | zipWith for heterogeneous product hzipWith :: (forall x. f x -> g x -> h x) -> (xs :& f) -> (xs :& g) -> xs :& h -- | zipWith3 for heterogeneous product hzipWith3 :: (forall x. f x -> g x -> h x -> i x) -> (xs :& f) -> (xs :& g) -> (xs :& h) -> xs :& i -- | Map elements to a monoid and combine the results. -- --
--   hfoldMap f . hmap g ≡ hfoldMap (f . g)
--   
hfoldMap :: Monoid a => (forall x. h x -> a) -> (xs :& h) -> a -- | hfoldMap with the membership of elements. hfoldMapWithIndex :: Monoid a => (forall x. Membership xs x -> g x -> a) -> (xs :& g) -> a -- | Right-associative fold of a product. hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> (xs :& h) -> r -- | Perform a strict left fold over the elements. hfoldlWithIndex :: (forall x. Membership xs x -> r -> h x -> r) -> r -> (xs :& h) -> r -- | 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)) -> (xs :& g) -> f (xs :& h) -- | htraverse with Memberships. htraverseWithIndex :: Applicative f => (forall x. Membership xs x -> g x -> f (h x)) -> (xs :& g) -> f (xs :& h) -- | sequence analog for extensible products hsequence :: Applicative f => (xs :& Comp f h) -> f (xs :& h) -- | Map a function to every element of a product. hmapWithIndexFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> g x -> h x) -> (xs :& g) -> xs :& h -- | Constrained hfoldMap hfoldMapFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => h x -> a) -> (xs :& h) -> a -- | hfoldMapWithIndex with a constraint for each element. hfoldMapWithIndexFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => Membership xs x -> h x -> a) -> (xs :& h) -> a -- | hfoldrWithIndex with a constraint for each element. hfoldrWithIndexFor :: forall c xs h r proxy. Forall c xs => proxy c -> (forall x. c x => Membership xs x -> h x -> r -> r) -> r -> (xs :& h) -> r -- | Constrained hfoldlWithIndex hfoldlWithIndexFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> r -> h x -> r) -> r -> (xs :& h) -> r -- | Constrained hfoldMap hfoldMapWith :: forall c xs h a. (Forall c xs, Monoid a) => (forall x. c x => h x -> a) -> (xs :& h) -> a -- | hfoldMapWithIndex with a constraint for each element. hfoldMapWithIndexWith :: forall c xs h a. (Forall c xs, Monoid a) => (forall x. c x => Membership xs x -> h x -> a) -> (xs :& h) -> a hfoldrWithIndexWith :: forall c xs h r. Forall c xs => (forall x. c x => Membership xs x -> h x -> r -> r) -> r -> (xs :& h) -> r -- | Constrained hfoldlWithIndex hfoldlWithIndexWith :: forall c xs h r. Forall c xs => (forall x. c x => Membership xs x -> r -> h x -> r) -> r -> (xs :& h) -> r hmapWithIndexWith :: forall c xs g h. Forall c xs => (forall x. c x => Membership xs x -> g x -> h x) -> (xs :& g) -> xs :& h -- | Evaluate every element in a product. hforce :: (xs :& h) -> xs :& h -- | Accumulate sums on a product. haccumMap :: Foldable f => (a -> xs :/ g) -> (forall x. Membership xs x -> g x -> h x -> h x) -> (xs :& h) -> f a -> xs :& h -- |
--   haccum = haccumMap id
--   
haccum :: Foldable f => (forall x. Membership xs x -> g x -> h x -> h x) -> (xs :& h) -> f (xs :/ g) -> xs :& h -- | Group sums by type. hpartition :: (Foldable f, Generate xs) => (a -> xs :/ h) -> f a -> xs :& Comp [] h -- | Get an element in a product. hlookup :: Membership xs x -> (xs :& h) -> h x -- | Flipped hlookup hindex :: (xs :& h) -> Membership xs x -> h x -- | Every type-level list is an instance of Generate. class Generate (xs :: [k]) -- | Enumerate all possible Memberships of xs. henumerate :: Generate xs => (forall (x :: k). () => Membership xs x -> r -> r) -> r -> r -- | Count the number of memberships. hcount :: Generate xs => proxy xs -> Int -- | Enumerate Memberships and construct an HList. hgenerateList :: (Generate xs, Applicative f) => (forall (x :: k). () => Membership xs x -> f (h x)) -> f (HList h xs) -- | Applicative version of htabulate. hgenerate :: (Generate xs, Applicative f) => (forall x. Membership xs x -> f (h x)) -> f (xs :& h) -- | Construct a product using a function which takes a Membership. -- --
--   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) -> xs :& h -- | A product filled with the specified value. hrepeat :: Generate xs => (forall x. h x) -> xs :& h -- | The dual of htraverse hcollect :: (Functor f, Generate xs) => (a -> xs :& h) -> f a -> xs :& Comp f h -- | The dual of hsequence hdistribute :: (Functor f, Generate xs) => f (xs :& h) -> xs :& Comp f h -- | Convert HList into a product. fromHList :: HList h xs -> xs :& h -- | Convert a product into an HList. toHList :: forall h xs. (xs :& h) -> HList h xs -- | Every element in xs satisfies c class (ForallF c xs, Generate xs) => Forall (c :: k -> Constraint) (xs :: [k]) -- | Enumerate all possible Memberships of xs with an -- additional context. henumerateFor :: Forall c xs => proxy c -> proxy' xs -> (forall (x :: k). c x => Membership xs x -> r -> r) -> r -> r hgenerateListFor :: (Forall c xs, Applicative f) => proxy c -> (forall (x :: k). c x => Membership xs x -> f (h x)) -> f (HList h xs) -- | Applicative version of htabulateFor. hgenerateFor :: (Forall c xs, Applicative f) => proxy c -> (forall x. c x => Membership xs x -> f (h x)) -> f (xs :& h) -- | Pure version of hgenerateFor. htabulateFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> h x) -> xs :& h -- | A product filled with the specified value. hrepeatFor :: Forall c xs => proxy c -> (forall x. c x => h x) -> xs :& h -- | Applicative version of htabulateFor. hgenerateWith :: forall c xs f h. (Forall c xs, Applicative f) => (forall x. c x => Membership xs x -> f (h x)) -> f (xs :& h) -- | Pure version of hgenerateFor. htabulateWith :: forall c xs h. Forall c xs => (forall x. c x => Membership xs x -> h x) -> xs :& h -- | A product filled with the specified value. hrepeatWith :: forall c xs h. Forall c xs => (forall x. c x => h x) -> xs :& h module Data.Extensible.Plain -- | Alias for plain products type AllOf xs = xs :& Identity -- | Alias for plain sums type OneOf xs = xs :/ Identity -- | O(log n) Add a plain value to a product. (<%) :: x -> AllOf xs -> AllOf (x : xs) infixr 5 <% -- | 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 infixr 1 <%| -- | An accessor for newtype constructors. accessing :: (Coercible x a, x ∈ xs, Extensible f p t, ExtensibleConstr t xs Identity x) => (a -> x) -> Optic' p f (t xs Identity) a -- | 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) -> (xs :& f) -> (xs :/ g) -> 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(1) Perform pattern matching. match :: (xs :& Match h a) -> (xs :/ h) -> a -- | Applies a function to the result of Match. mapMatch :: (a -> b) -> Match h a x -> Match h b x -- | Flipped match caseOf :: (xs :/ h) -> (xs :& Match h a) -> a infix 0 `caseOf` instance forall k (h :: k -> *) r (x :: k). GHC.Base.Monoid r => GHC.Base.Monoid (Data.Extensible.Match.Match h r x) instance forall k (h :: k -> *) r (x :: k). GHC.Base.Semigroup r => GHC.Base.Semigroup (Data.Extensible.Match.Match h r x) instance forall k (h :: k -> *) r (x :: k). GHC.Generics.Generic (Data.Extensible.Match.Match h r x) instance forall k (h :: k -> *) r. Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Match.Match h r) 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 :: forall xs ys. Include ys xs => xs :& Membership ys -- | O(n) Select some elements. shrink :: xs ⊆ ys => (ys :& h) -> xs :& h -- | O(1) Embed to a larger union. spread :: xs ⊆ ys => (xs :/ h) -> ys :/ h -- | Similar to Include, but this focuses on keys. type IncludeAssoc ys = Forall (Associated ys) -- | Associated xs (k ':> v) is equivalent to -- Associate k v xs class Associated' xs t => Associated xs t type family Associated' (xs :: [Assoc k v]) (t :: Assoc k v) :: Constraint -- | Reify the inclusion of type level sets. inclusionAssoc :: forall xs ys. IncludeAssoc ys xs => xs :& Membership ys -- | O(n) Select some elements. shrinkAssoc :: IncludeAssoc ys xs => (ys :& h) -> xs :& h -- | O(1) Embed to a larger union. spreadAssoc :: IncludeAssoc ys xs => (xs :/ h) -> ys :/ h instance forall k1 v1 (xs :: [Type.Membership.Internal.Assoc k1 v1]) (t :: Type.Membership.Internal.Assoc k1 v1) (k2 :: k1) (v2 :: v1). (Data.Extensible.Inclusion.Associated' xs t, t Data.Type.Equality.~ (k2 'Type.Membership.Internal.:> v2)) => Data.Extensible.Inclusion.Associated xs t module Data.Extensible.Nullable -- | A product filled with Nullable Nothing vacancy :: Generate xs => xs :& Nullable h -- | The inverse of inclusion. coinclusion :: (Include ys xs, Generate ys) => ys :& Nullable (Membership xs) -- | Extend a product and fill missing fields by Null. wrench :: (Generate ys, xs ⊆ ys) => (xs :& h) -> ys :& Nullable h -- | Narrow the range of the sum, if possible. retrench :: (Generate ys, xs ⊆ ys) => (ys :/ h) -> Nullable ((:/) xs) h -- | Wrapped 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 (h :: k -> *) (x :: k). Data.Hashable.Class.Hashable (h x) => Data.Hashable.Class.Hashable (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). Test.QuickCheck.Arbitrary.Arbitrary (h x) => Test.QuickCheck.Arbitrary.Arbitrary (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). Control.DeepSeq.NFData (h x) => Control.DeepSeq.NFData (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). GHC.Generics.Generic (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). GHC.Classes.Ord (h x) => GHC.Classes.Ord (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). GHC.Classes.Eq (h x) => GHC.Classes.Eq (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). GHC.Show.Show (h x) => GHC.Show.Show (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *). Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Nullable.Nullable h) instance forall k (h :: k -> *) (x :: k). GHC.Base.Semigroup (h x) => GHC.Base.Semigroup (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (x :: k). GHC.Base.Semigroup (h x) => GHC.Base.Monoid (Data.Extensible.Nullable.Nullable h x) instance forall k (h :: k -> *) (a :: k). Language.Haskell.TH.Syntax.Lift (h a) => Language.Haskell.TH.Syntax.Lift (Data.Extensible.Nullable.Nullable h a) -- | Flexible records and variants 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 -> Type) (kv :: Assoc k v) Field :: h (TargetOf kv) -> Field [getField] :: Field -> h (TargetOf kv) -- | Annotate a value by the field name. -- --
--   foo :: Record '["num" >: Int, "str" >: String]
--   foo = #num @= 42
--     <: #str @= "foo"
--     <: nil
--   
(@=) :: Wrapper h => FieldName k -> Repr h v -> Field h (k :> v) infix 1 @= -- | Lifted (@=) -- --
--   foo :: IO (Record '["num" >: Int, "str" >: String])
--   foo = hsequence
--     $ #num <@=> readLn
--     <: #str <@=> getLine
--     <: nil
--   
(<@=>) :: (Functor f, Wrapper h) => FieldName k -> f (Repr h v) -> Comp f (Field h) (k :> v) infix 1 <@=> -- | Annotate a value by the field name without Wrapper. (@:>) :: FieldName k -> h v -> Field h (k :> v) infix 1 @:> -- | Kind-monomorphic, unwrapped version of @= (@==) :: FieldName (k :: Symbol) -> v -> Field Identity (k :> v) infix 1 @== -- | 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 kind. forall f p t xs (h :: kind -> Type) (v :: kind). (Extensible f p t, ExtensibleConstr t xs (Field h) (k :> v), Lookup xs k v, Labelling k p, Wrapper h) => Optic' p f (t xs (Field h)) (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 '[k :> ()] (Field Proxy)) () -- | Lift a function for the content. liftField :: (g (TargetOf kv) -> h (TargetOf kv)) -> Field g kv -> Field h kv -- | Lift a function for the content. liftField2 :: (f (TargetOf kv) -> g (TargetOf kv) -> h (TargetOf kv)) -> Field f kv -> Field g kv -> Field h kv -- | The type of records which contain several fields. -- --
--   RecordOf :: (v -> *) -> [Assoc k v] -> *
--   
type RecordOf h xs = xs :& Field h -- | Simple record type Record xs = RecordOf Identity xs -- | An empty Record. emptyRecord :: Record '[] -- | The dual of RecordOf -- --
--   VariantOf :: (v -> *) -> [Assoc k v] -> *
--   
type VariantOf h xs = xs :/ Field h -- | Simple variant type Variant xs = VariantOf Identity xs -- | Select a corresponding field of a variant. matchWithField :: (forall x. f x -> g x -> r) -> RecordOf f xs -> VariantOf g xs -> r -- | Pattern matching on a Variant matchField :: RecordOf (Match h r) xs -> VariantOf h xs -> r -- | Take the type of the key type family KeyOf (kv :: Assoc k v) :: k -- | Proxy-level KeyOf. This is useful when using symbolVal. proxyKeyOf :: () => proxy kv -> Proxy (KeyOf kv) -- | Get a string from a proxy of Assoc Symbol v. stringKeyOf :: (IsString a, KnownSymbol (KeyOf kv)) => proxy kv -> a -- | Take the type of the value type family TargetOf (kv :: Assoc k v) :: v -- | Proxy-level TargetOf. proxyTargetOf :: () => proxy kv -> Proxy (TargetOf kv) -- | Constraint applied to KeyOf class pk KeyOf kv => KeyIs (pk :: k -> Constraint) (kv :: Assoc k v) -- | Constraint applied to TargetOf class pv TargetOf kv => TargetIs (pv :: k1 -> Constraint) (kv :: Assoc k k1) -- | Combined constraint for Assoc class (pk KeyOf kv, pv TargetOf kv) => KeyTargetAre (pk :: k -> Constraint) (pv :: k1 -> Constraint) (kv :: Assoc k k1) -- | Deprecated: Use KeyOf instead type AssocKey kv = KeyOf kv -- | Deprecated: Use TargetOf instead type AssocValue kv = TargetOf kv -- | Deprecated: Use TargetIs instead type ValueIs = TargetIs -- | Deprecated: Use KeyTargetAre instead type KeyValue = KeyTargetAre -- | Deprecated: Use proxyKeyOf instead proxyAssocKey :: proxy kv -> Proxy (KeyOf kv) -- | Deprecated: Use stringKeyOf instead stringAssocKey :: (IsString a, KnownSymbol (KeyOf kv)) => proxy kv -> a -- | Deprecated: Use proxyTargetOf instead proxyAssocValue :: proxy kv -> Proxy (TargetOf kv) -- | A ghostly type which spells the field name data LabelPhantom s a b -- | Signifies a field name internally type family Labelling s p :: Constraint -- | The trivial inextensible data type data Inextensible (xs :: [k]) (h :: k -> Type) instance forall v (h :: v -> *) k (kv :: Type.Membership.Internal.Assoc k v). GHC.Generics.Generic (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Classes.Eq (h (Type.Membership.TargetOf kv)) => GHC.Classes.Eq (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Classes.Ord (h (Type.Membership.TargetOf kv)) => GHC.Classes.Ord (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Num.Num (h (Type.Membership.TargetOf kv)) => GHC.Num.Num (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Real.Integral (h (Type.Membership.TargetOf kv)) => GHC.Real.Integral (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Real.Fractional (h (Type.Membership.TargetOf kv)) => GHC.Real.Fractional (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Float.Floating (h (Type.Membership.TargetOf kv)) => GHC.Float.Floating (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Real.Real (h (Type.Membership.TargetOf kv)) => GHC.Real.Real (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Float.RealFloat (h (Type.Membership.TargetOf kv)) => GHC.Float.RealFloat (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Real.RealFrac (h (Type.Membership.TargetOf kv)) => GHC.Real.RealFrac (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Base.Semigroup (h (Type.Membership.TargetOf kv)) => GHC.Base.Semigroup (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Foreign.Storable.Storable (h (Type.Membership.TargetOf kv)) => Foreign.Storable.Storable (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Base.Monoid (h (Type.Membership.TargetOf kv)) => GHC.Base.Monoid (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Enum.Enum (h (Type.Membership.TargetOf kv)) => GHC.Enum.Enum (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). GHC.Enum.Bounded (h (Type.Membership.TargetOf kv)) => GHC.Enum.Bounded (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Control.DeepSeq.NFData (h (Type.Membership.TargetOf kv)) => Control.DeepSeq.NFData (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Test.QuickCheck.Arbitrary.Arbitrary (h (Type.Membership.TargetOf kv)) => Test.QuickCheck.Arbitrary.Arbitrary (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Data.Hashable.Class.Hashable (h (Type.Membership.TargetOf kv)) => Data.Hashable.Class.Hashable (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Data.Csv.Conversion.FromField (h (Type.Membership.TargetOf kv)) => Data.Csv.Conversion.FromField (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Data.Csv.Conversion.ToField (h (Type.Membership.TargetOf kv)) => Data.Csv.Conversion.ToField (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Data.Aeson.Types.FromJSON.FromJSON (h (Type.Membership.TargetOf kv)) => Data.Aeson.Types.FromJSON.FromJSON (Data.Extensible.Field.Field h kv) instance forall k v (h :: v -> *) (kv :: Type.Membership.Internal.Assoc k v). Data.Aeson.Types.ToJSON.ToJSON (h (Type.Membership.TargetOf kv)) => Data.Aeson.Types.ToJSON.ToJSON (Data.Extensible.Field.Field h kv) instance forall k (s :: k). Data.Profunctor.Unsafe.Profunctor (Data.Extensible.Field.LabelPhantom s) instance (GHC.Base.Functor f, Data.Profunctor.Unsafe.Profunctor p) => Data.Extensible.Class.Extensible f p Data.Extensible.Field.Inextensible instance forall k v (h :: v -> *) (x :: Type.Membership.Internal.Assoc k v). Data.Vector.Unboxed.Base.Unbox (h (Type.Membership.TargetOf x)) => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (Data.Extensible.Field.Field h x) instance forall k v (h :: v -> *) (x :: Type.Membership.Internal.Assoc k v). Data.Vector.Unboxed.Base.Unbox (h (Type.Membership.TargetOf x)) => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (Data.Extensible.Field.Field h x) instance forall k v (h :: v -> *) (x :: Type.Membership.Internal.Assoc k v). Data.Vector.Unboxed.Base.Unbox (h (Type.Membership.TargetOf x)) => Data.Vector.Unboxed.Base.Unbox (Data.Extensible.Field.Field h x) instance forall k v (h :: v -> *) (x :: Type.Membership.Internal.Assoc k v). Language.Haskell.TH.Syntax.Lift (h (Type.Membership.TargetOf x)) => Language.Haskell.TH.Syntax.Lift (Data.Extensible.Field.Field h x) instance forall k v (h :: v -> *). Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Field.Field h) instance forall v1 (k :: GHC.Types.Symbol) (h :: v1 -> *) (v2 :: v1). (GHC.TypeLits.KnownSymbol k, Data.Extensible.Wrapper.Wrapper h, GHC.Show.Show (Data.Extensible.Wrapper.Repr h v2)) => GHC.Show.Show (Data.Extensible.Field.Field h (k 'Type.Membership.Internal.:> v2)) instance forall v1 (k :: GHC.Types.Symbol) (h :: v1 -> *) (v2 :: v1). (GHC.TypeLits.KnownSymbol k, Data.Text.Prettyprint.Doc.Internal.Pretty (h v2)) => Data.Text.Prettyprint.Doc.Internal.Pretty (Data.Extensible.Field.Field h (k 'Type.Membership.Internal.:> v2)) -- | Extensible tangles module Data.Extensible.Tangle -- | TangleT h xs m is the monad of computations that may -- depend on the elements in xs. newtype TangleT xs h m a TangleT :: RWST (xs :& Comp (TangleT xs h m) h) () (xs :& Nullable h) m a -> TangleT xs h m a [unTangleT] :: TangleT xs h m a -> RWST (xs :& Comp (TangleT xs h m) h) () (xs :& Nullable h) m a -- | Hitch an element associated to the FieldName through a wrapper. lasso :: forall k v m h xs. (Monad m, Lookup xs k v, Wrapper h) => FieldName k -> TangleT xs h m (Repr h (k :> v)) -- | Take a value from the tangles. The result is memoized. hitchAt :: Monad m => Membership xs x -> TangleT xs h m (h x) -- | Run a TangleT action and return the result and the calculated -- values. runTangleT :: Monad m => (xs :& Comp (TangleT xs h m) h) -> (xs :& Nullable h) -> TangleT xs h m a -> m (a, xs :& Nullable h) -- | Run a TangleT action. evalTangleT :: Monad m => (xs :& Comp (TangleT xs h m) h) -> (xs :& Nullable h) -> TangleT xs h m a -> m a -- | Run tangles and collect all the results as a Record. runTangles :: Monad m => (xs :& Comp (TangleT xs h m) h) -> (xs :& Nullable h) -> m (xs :& h) instance forall k (xs :: [k]) (h :: k -> *) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Monad (Data.Extensible.Tangle.TangleT xs h m) instance forall k (xs :: [k]) (h :: k -> *) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Applicative (Data.Extensible.Tangle.TangleT xs h m) instance forall k (xs :: [k]) (h :: k -> *) (m :: * -> *). GHC.Base.Functor m => GHC.Base.Functor (Data.Extensible.Tangle.TangleT xs h m) instance forall k (xs :: [k]) (h :: k -> *). Control.Monad.Trans.Class.MonadTrans (Data.Extensible.Tangle.TangleT xs h) instance forall k (m :: * -> *) a (xs :: [k]) (h :: k -> *). (GHC.Base.Monad m, GHC.Base.Semigroup a) => GHC.Base.Semigroup (Data.Extensible.Tangle.TangleT xs h m a) instance forall k (m :: * -> *) a (xs :: [k]) (h :: k -> *). (GHC.Base.Monad m, GHC.Base.Monoid a) => GHC.Base.Monoid (Data.Extensible.Tangle.TangleT xs h m a) -- | Bidirectional conversion from/to records 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 *]; type RecFields a = GRecFields (Rep a) '[]; } recordFromList :: IsRecord a => HList (Field Identity) (RecFields a) -> a recordToList :: IsRecord a => a -> HList (Field Identity) (RecFields a) recordFromList :: (IsRecord a, Generic a, GIsRecord (Rep a) '[], GRecFields (Rep a) '[] ~ RecFields a) => HList (Field Identity) (RecFields a) -> a recordToList :: (IsRecord a, Generic a, GIsRecord (Rep a) '[], GRecFields (Rep a) '[] ~ RecFields a) => a -> HList (Field Identity) (RecFields a) -- | Convert a value into a Record. toRecord :: IsRecord a => a -> Record (RecFields a) -- | Convert a Record to a value. fromRecord :: IsRecord a => Record (RecFields a) -> a -- |
--   record :: IsRecord a => Iso' a (Record (RecFields a))
--   
record :: (IsRecord a, Functor f, Profunctor p) => Optic' p f a (Record (RecFields a)) -- | Create an IsRecord instance for a normal record declaration. -- | Deprecated: Use the generic default methods instead deriveIsRecord :: Name -> DecsQ instance Data.Extensible.Record.IsRecord () instance forall k (f :: k -> *) (g :: k -> *) (r :: [Type.Membership.Internal.Assoc GHC.Types.Symbol *]). (Data.Extensible.Record.GIsRecord f (Data.Extensible.Record.GRecFields g r), Data.Extensible.Record.GIsRecord g r) => Data.Extensible.Record.GIsRecord (f GHC.Generics.:*: g) r instance Data.Extensible.Record.GIsRecord (GHC.Generics.S1 ('GHC.Generics.MetaSel ('GHC.Maybe.Just name) su ss ds) (GHC.Generics.K1 i a)) r instance forall k (f :: k -> *) (r :: [Type.Membership.Internal.Assoc GHC.Types.Symbol *]) (i :: GHC.Generics.Meta). Data.Extensible.Record.GIsRecord f r => Data.Extensible.Record.GIsRecord (GHC.Generics.C1 i f) r instance forall k (f :: k -> *) (r :: [Type.Membership.Internal.Assoc GHC.Types.Symbol *]) (i :: GHC.Generics.Meta). Data.Extensible.Record.GIsRecord f r => Data.Extensible.Record.GIsRecord (GHC.Generics.D1 i f) r -- | Experimental API for OverloadedLabels. GHC 8.0+ only module Data.Extensible.Label -- | Specialised version of itemAssoc. 訊 :: Proxy k -> FieldOptic k instance (k Data.Type.Equality.~ l) => GHC.OverloadedLabels.IsLabel k (Data.Proxy.Proxy l) instance forall v1 (f :: * -> *) (p :: * -> * -> *) (e :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v1] -> (Type.Membership.Internal.Assoc GHC.Types.Symbol v1 -> *) -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v1]) (k :: GHC.Types.Symbol) (v2 :: v1) (h :: v1 -> *) rep s t rep'. (Data.Extensible.Class.Extensible f p e, Type.Membership.Internal.Lookup xs k v2, Data.Extensible.Field.Labelling k p, Data.Extensible.Wrapper.Wrapper h, Data.Extensible.Class.ExtensibleConstr e xs (Data.Extensible.Field.Field h) (k 'Type.Membership.Internal.:> v2), rep Data.Type.Equality.~ Data.Extensible.Wrapper.Repr h v2, s Data.Type.Equality.~ e xs (Data.Extensible.Field.Field h), s Data.Type.Equality.~ t, rep Data.Type.Equality.~ rep') => GHC.OverloadedLabels.IsLabel k (p rep (f rep') -> p s (f t)) -- | A wrapper for GetOpt. -- -- See also: GetOpt and extensible records - School of Haskell module Data.Extensible.GetOpt -- | OptDescr with a default data OptionDescr h a OptionDescr :: (s -> h a) -> !s -> OptDescr (s -> s) -> OptionDescr h a -- | Simple option descriptor type OptDescr' = OptionDescr Identity -- | Parse option arguments. getOptRecord :: RecordOf (OptionDescr h) xs -> [String] -> (RecordOf h xs, [String], [String], String -> String) -- | An all-in-one utility function. When there's an error, print it along -- with the usage info to stderr and terminate with exitFailure. withGetOpt :: MonadIO m => String -> RecordOf (OptionDescr h) xs -> (RecordOf h xs -> [String] -> m a) -> m a -- | True when specified optFlag :: [Char] -> [String] -> String -> OptDescr' Bool -- | Takes the last argument when more than one is specified. optLastArg :: [Char] -> [String] -> String -> String -> OptDescr' (Maybe String) -- | Option without an argument; the result is the total count of this -- option. optNoArg :: [Char] -> [String] -> String -> OptDescr' Int -- | Option with an argument optReqArg :: [Char] -> [String] -> String -> String -> OptDescr' [String] -- | Wrapper-generic version of optNoArg optionNoArg :: (Int -> h a) -> [Char] -> [String] -> String -> OptionDescr h a -- | Wrapper-generic version of optReqArg optionReqArg :: ([String] -> h a) -> [Char] -> [String] -> String -> String -> OptionDescr h a -- | Construct an option with an optional argument optionOptArg :: ([Maybe String] -> h a) -> [Char] -> [String] -> String -> String -> OptionDescr h a instance GHC.Base.Functor h => GHC.Base.Functor (Data.Extensible.GetOpt.OptionDescr h) instance forall k (h :: k -> *). Data.Extensible.Wrapper.Wrapper (Data.Extensible.GetOpt.OptionDescr h) -- | Name-based extensible effects module Data.Extensible.Effect -- | A unit of named effects. This is a variant of (:|) -- specialised for 'Type -> Type'. data Instruction (xs :: [Assoc k (* -> *)]) a [Instruction] :: !Membership xs kv -> TargetOf kv a -> Instruction xs a -- | The extensible operational monad type Eff xs = Skeleton (Instruction xs) -- | Lift an instruction onto an Eff action. liftEff :: forall s t xs a. Lookup xs s t => Proxy s -> t a -> Eff xs a -- | Lift an instruction onto an Eff action and apply a function to -- the result. liftsEff :: forall s t xs a r. Lookup xs s t => Proxy s -> t a -> (a -> r) -> Eff xs r -- | Censor a specific type of effects in an action. hoistEff :: forall s t xs a. Lookup xs s t => Proxy s -> (forall x. t x -> t x) -> Eff xs a -> Eff xs a -- | Upcast an action. castEff :: IncludeAssoc ys xs => Eff xs a -> Eff ys a -- | Transformation between effects newtype Interpreter f g Interpreter :: (forall a. g a -> f a) -> Interpreter f g [runInterpreter] :: Interpreter f g -> forall a. g a -> f a -- | Process an Eff action using a record of Interpreters. handleEff :: RecordOf (Interpreter m) xs -> Eff xs a -> MonadView m (Eff xs) a -- | Build a relay-style handler from a triple of functions. -- --
--   runStateEff = peelEff1 (a s -> return (a, s))
--     (m k s -> let (a, s') = runState m s in k a s')
--   
peelEff :: forall k t xs a r. Rebinder xs r -> (a -> r) -> (forall x. t x -> (x -> r) -> r) -> Eff ((k >: t) : xs) a -> r -- | A function to bind an Instruction in peelEff. type Rebinder xs r = forall x. Instruction xs x -> (x -> r) -> r -- | A common value for the second argument of peelEff. Binds an -- instruction directly. rebindEff0 :: Rebinder xs (Eff xs r) -- | peelEff specialised for continuations with no argument peelEff0 :: forall k t xs a r. (a -> Eff xs r) -> (forall x. t x -> (x -> Eff xs r) -> Eff xs r) -> Eff ((k >: t) : xs) a -> Eff xs r -- | A pre-defined value for the second argument of peelEff. -- Preserves the argument of the continuation. rebindEff1 :: Rebinder xs (a -> Eff xs r) -- | peelEff specialised for 1-argument continuation peelEff1 :: forall k t xs a b r. (a -> b -> Eff xs r) -> (forall x. t x -> (x -> b -> Eff xs r) -> b -> Eff xs r) -> Eff ((k >: t) : xs) a -> b -> Eff xs r -- | A pre-defined value for the second argument of peelEff. -- Preserves two arguments of the continuation. rebindEff2 :: Rebinder xs (a -> b -> Eff xs r) -- | Reveal the final result of Eff. leaveEff :: Eff '[] a -> a -- | Tear down an action using the Monad instance of the -- instruction. retractEff :: forall k m a. Monad m => Eff '[k >: m] a -> m a -- | Anonymous representation of instructions. data Action (args :: [*]) a r [AResult] :: Action '[] a a [AArgument] :: x -> Action xs a r -> Action (x : xs) a r -- | Function [a, b, c] r is a -> b -> c -> -- r type family Function args r :: * -- | Pass the arguments of Action to the supplied function. runAction :: Function xs (f a) -> Action xs a r -> f r -- | Create a Field of a Interpreter for an Action. (@!?) :: FieldName k -> Function xs (f a) -> Field (Interpreter f) (k :> Action xs a) infix 1 @!? -- | Specialised version of peelEff for Actions. You can pass -- a function a -> b -> ... -> (q -> r) -> r as a -- handler for Action '[a, b, ...] q. peelAction :: forall k ps q xs a r. (forall x. Instruction xs x -> (x -> r) -> r) -> (a -> r) -> Function ps ((q -> r) -> r) -> Eff ((k >: Action ps q) : xs) a -> r -- | Non continuation-passing variant of peelAction. peelAction0 :: forall k ps q xs a. Function ps (Eff xs q) -> Eff ((k >: Action ps q) : xs) a -> Eff xs a -- | The reader monad is characterised by a type equality between the -- result type and the enviroment type. type ReaderEff = (:~:) -- | Fetch the environment. askEff :: forall k r xs. Lookup xs k (ReaderEff r) => Proxy k -> Eff xs r -- | Pass the environment to a function. asksEff :: forall k r xs a. Lookup xs k (ReaderEff r) => Proxy k -> (r -> a) -> Eff xs a -- | Modify the enviroment locally. localEff :: forall k r xs a. Lookup xs k (ReaderEff r) => Proxy k -> (r -> r) -> Eff xs a -> Eff xs a -- | Run the frontal reader effect. runReaderEff :: forall k r xs a. Eff ((k >: ReaderEff r) : xs) a -> r -> Eff xs a -- | A state monad parameterized by the type s of the state to -- carry. -- -- The return function leaves the state unchanged, while -- >>= uses the final state of the first computation as -- the initial state of the second. type State s = StateT s Identity -- | Get the current state. getEff :: forall k s xs. Lookup xs k (State s) => Proxy k -> Eff xs s -- | Pass the current state to a function. getsEff :: forall k s a xs. Lookup xs k (State s) => Proxy k -> (s -> a) -> Eff xs a -- | Replace the state with a new value. putEff :: forall k s xs. Lookup xs k (State s) => Proxy k -> s -> Eff xs () -- | Modify the state. modifyEff :: forall k s xs. Lookup xs k (State s) => Proxy k -> (s -> s) -> Eff xs () -- | Lift a state modification function. stateEff :: forall k s xs a. Lookup xs k (State s) => Proxy k -> (s -> (a, s)) -> Eff xs a -- | Run the frontal state effect. runStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs (a, s) -- | Run the frontal state effect and return the final state. execStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs s -- | Run the frontal state effect and return the final result. evalStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs a -- | (,) already is a writer monad. type WriterEff w = (,) w -- | Write the second element and return the first element. writerEff :: forall k w xs a. Lookup xs k (WriterEff w) => Proxy k -> (a, w) -> Eff xs a -- | Write a value. tellEff :: forall k w xs. Lookup xs k (WriterEff w) => Proxy k -> w -> Eff xs () -- | Squash the outputs into one step and return it. listenEff :: forall k w xs a. (Lookup xs k (WriterEff w), Monoid w) => Proxy k -> Eff xs a -> Eff xs (a, w) -- | Modify the output using the function in the result. passEff :: forall k w xs a. (Lookup xs k (WriterEff w), Monoid w) => Proxy k -> Eff xs (a, w -> w) -> Eff xs a -- | Run the frontal writer effect. runWriterEff :: forall k w xs a. Monoid w => Eff ((k >: WriterEff w) : xs) a -> Eff xs (a, w) -- | Run the frontal state effect. execWriterEff :: forall k w xs a. Monoid w => Eff ((k >: WriterEff w) : xs) a -> Eff xs w -- | An effect with no result type MaybeEff = Const () -- | Break out of the computation. Similar to Nothing. nothingEff :: Lookup xs k MaybeEff => Proxy k -> Eff xs a -- | Run an effect which may fail in the name of k. runMaybeEff :: forall k xs a. Eff ((k >: MaybeEff) : xs) a -> Eff xs (Maybe a) -- | Throwing an exception type EitherEff = Const -- | Throw an exception e, throwing the rest of the computation -- away. throwEff :: Lookup xs k (EitherEff e) => Proxy k -> e -> Eff xs a -- | Attach a handler for an exception. catchEff :: forall k e xs a. Lookup xs k (EitherEff e) => Proxy k -> Eff xs a -> (e -> Eff xs a) -> Eff xs a -- | Run an action and abort on throwEff. runEitherEff :: forall k e xs a. Eff ((k >: EitherEff e) : xs) a -> Eff xs (Either e a) -- | Take a function and applies it to an Either effect iff the effect -- takes the form Left _. mapLeftEff :: (e -> e') -> Eff ((k >: EitherEff e) : xs) a -> Eff ((k >: EitherEff e') : xs) a -- | Identity functor and monad. (a non-strict monad) data Identity a -- | Put a milestone on a computation. tickEff :: Lookup xs k Identity => Proxy k -> Eff xs () -- | Run a computation until the first call of tickEff. runIterEff :: Eff ((k >: Identity) : xs) a -> Eff xs (Either a (Eff ((k >: Identity) : xs) a)) -- | The continuation monad transformer. Can be used to add continuation -- handling to any type constructor: the Monad instance and most -- of the operations do not require m to be a monad. -- -- ContT is not a functor on the category of monads, and many -- operations cannot be lifted through it. data ContT (r :: k) (m :: k -> Type) a :: forall k. () => k -> k -> Type -> Type -> Type -- | Place a continuation-passing action. contEff :: Lookup xs k (ContT r m) => Proxy k -> ((a -> m r) -> m r) -> Eff xs a -- | Unwrap a continuation. runContEff :: forall k r xs a. Eff ((k >: ContT r (Eff xs)) : xs) a -> (a -> Eff xs r) -> Eff xs r -- | Call a function with the current continuation as its argument callCCEff :: Proxy k -> ((a -> Eff ((k >: ContT r (Eff xs)) : xs) b) -> Eff ((k >: ContT r (Eff xs)) : xs) a) -> Eff ((k >: ContT r (Eff xs)) : 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 -- | mkFieldAs (mkName "foo") "bar" defines a field for -- "bar" as foo. mkFieldAs :: Name -> String -> DecsQ -- | Generate named effects from a GADT declaration. -- --
--   decEffects [d|
--    data Blah a b x where
--      Blah :: Int -> a -> Blah a b b
--    |]
--   
-- -- generates -- --
--   type Blah a b = "Blah" >: Action '[Int, a] b
--   blah :: forall xs a b
--     . Associate "Blah" (Action '[Int, a] b) xs
--     => Int -> a -> Eff xs b
--   blah a0 a1
--     = liftEff
--       (Data.Proxy.Proxy :: Data.Proxy.Proxy "Blah")
--       (AArgument a0 (AArgument a1 AResult))
--   
decEffects :: DecsQ -> DecsQ -- | Instead of making a type synonym for individual actions, it defines a -- list of actions. decEffectSet :: DecsQ -> DecsQ -- | Generates type synonyms for the set of actions and also individual -- actions. decEffectSuite :: DecsQ -> DecsQ -- | Generate effect suite with custom settings. customDecEffects :: Bool -> Bool -> DecsQ -> DecsQ -- | Default monad runners and MonadIO, MonadReader, -- MonadWriter, MonadState, MonadError instances module Data.Extensible.Effect.Default -- | mtl-compatible reader type ReaderDef r = "Reader" >: ReaderEff r -- | Specialised version of runReaderEff compatible with the -- MonadReader instance. runReaderDef :: Eff (ReaderDef r : xs) a -> r -> Eff xs a -- | mtl-compatible state type StateDef s = "State" >: State s -- | runStateEff specialised for the MonadState instance. runStateDef :: Eff (StateDef s : xs) a -> s -> Eff xs (a, s) -- | evalStateEff specialised for the MonadState instance. evalStateDef :: Eff (StateDef s : xs) a -> s -> Eff xs a -- | execStateEff specialised for the MonadState instance. execStateDef :: Eff (StateDef s : xs) a -> s -> Eff xs s -- | mtl-compatible writer type WriterDef w = "Writer" >: WriterEff w -- | runWriterDef specialised for the MonadWriter instance. runWriterDef :: Monoid w => Eff (WriterDef w : xs) a -> Eff xs (a, w) -- | execWriterDef specialised for the MonadWriter instance. execWriterDef :: Monoid w => Eff (WriterDef w : xs) a -> Eff xs w -- | Same as EitherDef () type MaybeDef = "Either" >: EitherEff () -- | Similar to runMaybeT, but on Eff runMaybeDef :: Eff (MaybeDef : xs) a -> Eff xs (Maybe a) -- | mtl-compatible either effect type EitherDef e = "Either" >: EitherEff e -- | Similar to runExceptT, but on Eff runEitherDef :: Eff (EitherDef e : xs) a -> Eff xs (Either e a) -- | mtl-compatible continuation type ContDef r m = "Cont" >: ContT r m -- | runContEff specialised for the MonadCont instance. runContDef :: Eff (ContDef r (Eff xs) : xs) a -> (a -> Eff xs r) -> Eff xs r instance Control.Monad.Cont.Class.MonadCont (Data.Extensible.Effect.Eff (Data.Extensible.Effect.Default.ContDef r (Data.Extensible.Effect.Eff xs) : xs)) instance (Control.Monad.IO.Class.MonadIO m, Type.Membership.Internal.Lookup xs "IO" m) => Control.Monad.IO.Class.MonadIO (Data.Extensible.Effect.Eff xs) instance (Control.Monad.Trans.Resource.Internal.MonadResource m, Type.Membership.Internal.Lookup xs "IO" m) => Control.Monad.Trans.Resource.Internal.MonadResource (Data.Extensible.Effect.Eff xs) instance (Control.Monad.Catch.MonadThrow m, Type.Membership.Internal.Lookup xs "IO" m) => Control.Monad.Catch.MonadThrow (Data.Extensible.Effect.Eff xs) instance (Control.Monad.Catch.MonadCatch m, Type.Membership.Internal.Lookup xs "IO" m) => Control.Monad.Catch.MonadCatch (Data.Extensible.Effect.Eff xs) instance Type.Membership.Internal.Lookup xs "Reader" ((Data.Type.Equality.:~:) r) => Control.Monad.Reader.Class.MonadReader r (Data.Extensible.Effect.Eff xs) instance Type.Membership.Internal.Lookup xs "State" (Control.Monad.Trans.State.Strict.State s) => Control.Monad.State.Class.MonadState s (Data.Extensible.Effect.Eff xs) instance (GHC.Base.Monoid w, Type.Membership.Internal.Lookup xs "Writer" ((,) w)) => Control.Monad.Writer.Class.MonadWriter w (Data.Extensible.Effect.Eff xs) instance Type.Membership.Internal.Lookup xs "Either" (Data.Functor.Const.Const e) => Control.Monad.Error.Class.MonadError e (Data.Extensible.Effect.Eff xs) instance (GHC.Base.Monoid e, Type.Membership.Internal.Lookup xs "Either" (Data.Functor.Const.Const e)) => GHC.Base.Alternative (Data.Extensible.Effect.Eff xs) instance (GHC.Base.Monoid e, Type.Membership.Internal.Lookup xs "Either" (Data.Functor.Const.Const e)) => GHC.Base.MonadPlus (Data.Extensible.Effect.Eff xs) -- | Reification of constraints using extensible data types. Also includes -- orphan instances. module Data.Extensible.Dictionary -- | Reify a collection of dictionaries, as you wish. library :: forall c xs. Forall c xs => xs :& Comp Dict c -- | 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 class (f x, g x) => And f g x instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Show.Show h xs => GHC.Show.Show (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Text.Prettyprint.Doc.Internal.Pretty h xs => Data.Text.Prettyprint.Doc.Internal.Pretty (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Classes.Eq h xs => GHC.Classes.Eq (xs Data.Extensible.Struct.:& h) instance forall k (xs :: [k]) (h :: k -> *). (GHC.Classes.Eq (xs Data.Extensible.Struct.:& h), Data.Extensible.Dictionary.WrapForall GHC.Classes.Ord h xs) => GHC.Classes.Ord (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Base.Semigroup h xs => GHC.Base.Semigroup (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). (Data.Extensible.Dictionary.WrapForall GHC.Base.Semigroup h xs, Data.Extensible.Dictionary.WrapForall GHC.Base.Monoid h xs) => GHC.Base.Monoid (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Hashable.Class.Hashable h xs => Data.Hashable.Class.Hashable (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Enum.Bounded h xs => GHC.Enum.Bounded (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Language.Haskell.TH.Syntax.Lift h xs => Language.Haskell.TH.Syntax.Lift (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (x :: k) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Vector.Unboxed.Base.Unbox h (x : xs) => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector ((x : xs) Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (x :: k) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Vector.Unboxed.Base.Unbox h (x : xs) => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector ((x : xs) Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (x :: k) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Vector.Unboxed.Base.Unbox h (x : xs) => Data.Vector.Unboxed.Base.Unbox ((x : xs) Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Test.QuickCheck.Arbitrary.Arbitrary h xs => Test.QuickCheck.Arbitrary.Arbitrary (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Control.DeepSeq.NFData h xs => Control.DeepSeq.NFData (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Csv.Conversion.FromField h xs => Data.Csv.Conversion.FromRecord (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Csv.Conversion.ToField h xs => Data.Csv.Conversion.ToRecord (xs Data.Extensible.Struct.:& h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Show.Show h xs => GHC.Show.Show (xs Data.Extensible.Sum.:/ h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Classes.Eq h xs => GHC.Classes.Eq (xs Data.Extensible.Sum.:/ h) instance forall k (xs :: [k]) (h :: k -> *). (GHC.Classes.Eq (xs Data.Extensible.Sum.:/ h), Data.Extensible.Dictionary.WrapForall GHC.Classes.Ord h xs) => GHC.Classes.Ord (xs Data.Extensible.Sum.:/ h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Control.DeepSeq.NFData h xs => Control.DeepSeq.NFData (xs Data.Extensible.Sum.:/ h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Hashable.Class.Hashable h xs => Data.Hashable.Class.Hashable (xs Data.Extensible.Sum.:/ h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Language.Haskell.TH.Syntax.Lift h xs => Language.Haskell.TH.Syntax.Lift (xs Data.Extensible.Sum.:/ h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Test.QuickCheck.Arbitrary.Arbitrary h xs => Test.QuickCheck.Arbitrary.Arbitrary (xs Data.Extensible.Sum.:/ h) instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Data.Text.Prettyprint.Doc.Internal.Pretty h xs => Data.Text.Prettyprint.Doc.Internal.Pretty (xs Data.Extensible.Sum.:/ h) instance forall v (h :: v -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v]). Type.Membership.Forall (Type.Membership.KeyTargetAre GHC.TypeLits.KnownSymbol (Data.Extensible.Dictionary.Instance1 Data.Csv.Conversion.FromField h)) xs => Data.Csv.Conversion.FromNamedRecord (xs Data.Extensible.Struct.:& Data.Extensible.Field.Field h) instance forall v (h :: v -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v]). Type.Membership.Forall (Type.Membership.KeyTargetAre GHC.TypeLits.KnownSymbol (Data.Extensible.Dictionary.Instance1 Data.Csv.Conversion.ToField h)) xs => Data.Csv.Conversion.ToNamedRecord (xs Data.Extensible.Struct.:& Data.Extensible.Field.Field h) instance forall v (h :: v -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v]). Type.Membership.Forall (Type.Membership.KeyTargetAre GHC.TypeLits.KnownSymbol (Data.Extensible.Dictionary.Instance1 Data.Aeson.Types.FromJSON.FromJSON h)) xs => Data.Aeson.Types.FromJSON.FromJSON (xs Data.Extensible.Struct.:& Data.Extensible.Field.Field h) instance forall v (h :: v -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v]). Type.Membership.Forall (Type.Membership.KeyTargetAre GHC.TypeLits.KnownSymbol (Data.Extensible.Dictionary.Instance1 Data.Aeson.Types.ToJSON.ToJSON h)) xs => Data.Aeson.Types.ToJSON.ToJSON (xs Data.Extensible.Struct.:& Data.Extensible.Field.Field h) instance forall v (h :: v -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v]). Type.Membership.Forall (Type.Membership.KeyTargetAre GHC.TypeLits.KnownSymbol (Data.Extensible.Dictionary.Instance1 Data.Aeson.Types.FromJSON.FromJSON h)) xs => Data.Aeson.Types.FromJSON.FromJSON (xs Data.Extensible.Struct.:& Data.Extensible.Nullable.Nullable (Data.Extensible.Field.Field h)) instance forall v (h :: v -> *) (xs :: [Type.Membership.Internal.Assoc GHC.Types.Symbol v]). Type.Membership.Forall (Type.Membership.KeyTargetAre GHC.TypeLits.KnownSymbol (Data.Extensible.Dictionary.Instance1 Data.Aeson.Types.ToJSON.ToJSON h)) xs => Data.Aeson.Types.ToJSON.ToJSON (xs Data.Extensible.Struct.:& Data.Extensible.Nullable.Nullable (Data.Extensible.Field.Field h)) instance forall k1 k2 (c :: k2 -> GHC.Types.Constraint) (h :: k1 -> k2) (x :: k1). c (h x) => Data.Extensible.Dictionary.Instance1 c h x instance forall k (f :: k -> GHC.Types.Constraint) (x :: k) (g :: k -> GHC.Types.Constraint). (f x, g x) => Data.Extensible.Dictionary.And f g x instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Mutable.Base.MVector Data.Vector.Unboxed.Base.MVector (Data.Functor.Identity.Identity a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Generic.Base.Vector Data.Vector.Unboxed.Base.Vector (Data.Functor.Identity.Identity a) instance Data.Vector.Unboxed.Base.Unbox a => Data.Vector.Unboxed.Base.Unbox (Data.Functor.Identity.Identity a) instance forall k (xs :: [k]). Data.Barbie.Internal.Functor.FunctorB ((Data.Extensible.Struct.:&) xs) instance forall k (xs :: [k]). Data.Barbie.Internal.Functor.FunctorB ((Data.Extensible.Sum.:/) xs) instance forall k (xs :: [k]). Data.Barbie.Internal.Traversable.TraversableB ((Data.Extensible.Struct.:&) xs) instance forall k (xs :: [k]). Data.Barbie.Internal.Traversable.TraversableB ((Data.Extensible.Sum.:/) xs) instance forall k (xs :: [k]). Type.Membership.Generate xs => Data.Barbie.Internal.Product.ProductB ((Data.Extensible.Struct.:&) xs) instance forall k (xs :: [k]). Data.Barbie.Internal.Constraints.ConstraintsB ((Data.Extensible.Struct.:&) xs) instance forall k (xs :: [k]). Data.Barbie.Internal.Constraints.ConstraintsB ((Data.Extensible.Sum.:/) xs) instance forall k (xs :: [k]). Type.Membership.Generate xs => Data.Barbie.Internal.ProductC.ProductBC ((Data.Extensible.Struct.:&) xs) -- | Bit-packed records module Data.Extensible.Bits -- | Bit-vector product. It has similar interface as (:*) but -- fields are packed into r. newtype BitProd r (xs :: [k]) (h :: k -> Type) BitProd :: r -> BitProd r [unBitProd] :: BitProd r -> r -- | Conversion between a value and a bit representation. -- -- Instances of FromBits must satisfy the following laws: -- --
--   fromBits (x `shiftL` W .|. toBits a) ≡ a
--   toBits a `shiftR` W == zeroBits
--   
-- -- where W is the BitWidth. class (Bits r, KnownNat (BitWidth a)) => FromBits r a where { type family BitWidth a :: Nat; } fromBits :: FromBits r a => r -> a toBits :: FromBits r a => a -> r -- | Total BitWidth type family TotalBits h xs -- | Fields are instances of FromBits and fit in the representation. type BitFields r xs h = (FromBits r r, TotalBits h xs <= BitWidth r, Forall (Instance1 (FromBits r) h) xs) -- | hlookup for BitProd blookup :: forall x r xs h. (BitFields r xs h, FromBits r (h x)) => Membership xs x -> BitProd r xs h -> h x -- | Update a field of a BitProd. bupdate :: forall x r xs h. (BitFields r xs h, FromBits r (h x)) => Membership xs x -> BitProd r xs h -> h x -> BitProd r xs h -- | Convert a normal extensible record into a bit record. toBitProd :: forall r xs h. BitFields r xs h => (xs :& h) -> BitProd r xs h -- | Convert a normal extensible record into a bit record. fromBitProd :: forall r xs h. BitFields r xs h => BitProd r xs h -> xs :& h -- | Bit-packed record type BitRecordOf r h xs = BitProd r xs (Field h) -- | Bit-packed record type BitRecord r xs = BitRecordOf r Identity xs instance forall r k (xs :: [k]) (h :: k -> *). Foreign.Storable.Storable r => Foreign.Storable.Storable (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). Data.Hashable.Class.Hashable r => Data.Hashable.Class.Hashable (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). GHC.Generics.Generic (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). GHC.Arr.Ix r => GHC.Arr.Ix (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). GHC.Enum.Bounded r => GHC.Enum.Bounded (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). GHC.Enum.Enum r => GHC.Enum.Enum (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). GHC.Classes.Ord r => GHC.Classes.Ord (Data.Extensible.Bits.BitProd r xs h) instance forall r k (xs :: [k]) (h :: k -> *). GHC.Classes.Eq r => GHC.Classes.Eq (Data.Extensible.Bits.BitProd r xs h) instance forall k (h :: k -> *) (xs :: [k]) r. (Type.Membership.Forall (Data.Extensible.Dictionary.Instance1 GHC.Show.Show h) xs, Data.Extensible.Bits.BitFields r xs h) => GHC.Show.Show (Data.Extensible.Bits.BitProd r xs h) instance (Data.Profunctor.Rep.Corepresentable p, Control.Comonad.Comonad (Data.Profunctor.Rep.Corep p), GHC.Base.Functor f) => Data.Extensible.Class.Extensible f p (Data.Extensible.Bits.BitProd r) instance forall k r (h :: k -> *) (xs :: [k]). (Data.Bits.Bits r, GHC.TypeNats.KnownNat (Data.Extensible.Bits.TotalBits h xs)) => Data.Extensible.Bits.FromBits r (Data.Extensible.Bits.BitProd r xs h) instance Data.Bits.Bits r => Data.Extensible.Bits.FromBits r () instance forall k r (a :: k). Data.Bits.Bits r => Data.Extensible.Bits.FromBits r (Data.Proxy.Proxy a) instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Word.Word64 instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Types.Bool instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Word.Word8 instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Word.Word16 instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Word.Word32 instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Int.Int8 instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Int.Int16 instance Data.Extensible.Bits.FromBits GHC.Word.Word64 GHC.Int.Int32 instance Data.Extensible.Bits.FromBits r a => Data.Extensible.Bits.FromBits r (Data.Functor.Identity.Identity a) instance (Data.Extensible.Bits.FromBits r a, Data.Extensible.Bits.FromBits r b, n Data.Type.Equality.~ (Data.Extensible.Bits.BitWidth a GHC.TypeNats.+ Data.Extensible.Bits.BitWidth b), n GHC.TypeNats.<= Data.Extensible.Bits.BitWidth r, GHC.TypeNats.KnownNat n) => Data.Extensible.Bits.FromBits r (a, b) instance forall k r a (b :: k). Data.Extensible.Bits.FromBits r a => Data.Extensible.Bits.FromBits r (Data.Functor.Const.Const a b) instance forall k v r (h :: v -> *) (x :: Type.Membership.Internal.Assoc k v). (Data.Bits.Bits r, Data.Extensible.Bits.FromBits r (h (Type.Membership.TargetOf x))) => Data.Extensible.Bits.FromBits r (Data.Extensible.Field.Field h x) -- | This module just reexports everything. -- -- module Data.Extensible -- | Proxy is a type that holds no data, but has a phantom parameter -- of arbitrary type (or even kind). Its use is to provide type -- information, even though there is no value available of that type (or -- it may be too costly to create one). -- -- Historically, Proxy :: Proxy a is a safer -- alternative to the 'undefined :: a' idiom. -- --
--   >>> Proxy :: Proxy (Void, Int -> Int)
--   Proxy
--   
-- -- Proxy can even hold types of higher kinds, -- --
--   >>> Proxy :: Proxy Either
--   Proxy
--   
-- --
--   >>> Proxy :: Proxy Functor
--   Proxy
--   
-- --
--   >>> Proxy :: Proxy complicatedStructure
--   Proxy
--   
data Proxy (t :: k) :: forall k. () => k -> Type Proxy :: Proxy -- | This class gives the string associated with a type-level symbol. There -- are instances of the class for every concrete literal: "hello", etc. class KnownSymbol (n :: Symbol)