-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Extensible, efficient, optics-friendly data types and effects
--   
--   Poly-kinded extensible records, variants, effects, tangles
@package extensible
@version 0.4.2


-- | 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)

-- | <pre>
--   <a>view</a> :: Getter s a -&gt; s -&gt; a
--   </pre>
view :: Optic' (->) (Const a) s a -> s -> a

-- | <pre>
--   <a>views</a> :: Getter s a -&gt; (a -&gt; r) -&gt; (s -&gt; r)
--   </pre>
views :: Optic' (->) (Const r) s a -> (a -> r) -> s -> r

-- | <pre>
--   <a>over</a> :: Setter s t a b -&gt; (a -&gt; b) -&gt; (s -&gt; t)
--   </pre>
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)


module Data.Extensible.Wrapper

-- | The extensible data types should take <tt>k -&gt; *</tt> as a
--   parameter. This class allows us to take a shortcut for direct
--   representation.
class Wrapper (h :: k -> *) where type Repr h (v :: k) :: * where {
    type family Repr h (v :: k) :: *;
}

-- | This is an isomorphism between <tt>h v</tt> and <tt><a>Repr</a> h
--   v</tt>.
--   
--   <pre>
--   _Wrapper :: Iso' (h v) (Repr h v)
--   </pre>
_Wrapper :: (Wrapper h, Functor f, Profunctor p) => Optic' p f (h v) (Repr h v)

-- | Restricted version of <a>_Wrapper</a>. 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)

-- | Wrap a result of <a>fmap</a>
comp :: Functor f => (a -> g b) -> f a -> Comp f g b
instance forall a k (x :: k). GHC.Classes.Ord a => GHC.Classes.Ord (Data.Extensible.Wrapper.Const' a x)
instance forall a k (x :: k). GHC.Classes.Eq a => GHC.Classes.Eq (Data.Extensible.Wrapper.Const' a x)
instance forall a k (x :: k). GHC.Show.Show a => GHC.Show.Show (Data.Extensible.Wrapper.Const' a x)
instance forall j (f :: j -> GHC.Types.*) 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 -> GHC.Types.*) 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 -> GHC.Types.*) i (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 Data.Extensible.Wrapper.Wrapper GHC.Base.Maybe
instance Data.Extensible.Wrapper.Wrapper []
instance forall k (f :: * -> *) (g :: k -> GHC.Types.*). (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


-- | A bunch of combinators that contains magic
module Data.Extensible.Internal

-- | The position of <tt>x</tt> in the type level set <tt>xs</tt>.
data Membership (xs :: [k]) (x :: k)
getMemberId :: Membership xs x -> Int

-- | Generates a <a>Membership</a> that corresponds to the given ordinal
--   (0-origin).
mkMembership :: Int -> Q Exp
reifyMembership :: Int -> (forall x. Membership xs x -> r) -> r

-- | Embodies a type equivalence to ensure that the <a>Membership</a>
--   points the first element.
runMembership :: Membership (y : xs) x -> (x :~: y -> r) -> (Membership xs x -> r) -> r

-- | Compare two <a>Membership</a>s.
compareMembership :: Membership xs x -> Membership xs y -> Either Ordering (x :~: y)

-- | There is no <a>Membership</a> of an empty list.
impossibleMembership :: Membership '[] x -> r

-- | <tt>x</tt> is a member of <tt>xs</tt>
class Member xs x
membership :: Member xs x => Membership xs x

-- | Remember that <tt>Member xs x</tt> from <a>Membership</a>.
remember :: forall xs x r. Membership xs x -> (Member xs x => r) -> r

-- | Unicode flipped alias for <a>Member</a>
type (∈) x xs = Member xs x

-- | FindType types

-- | The kind of key-value pairs
data Assoc k v
(:>) :: k -> v -> Assoc k v

-- | A synonym for (<a>:&gt;</a>)
type (>:) = (:>)

-- | <tt><a>Associate</a> k v xs</tt> is essentially identical to <tt>(k
--   :&gt; v) ∈ xs</tt> , but the type <tt>v</tt> is inferred from
--   <tt>k</tt> and <tt>xs</tt>.
class Associate k v xs | k xs -> v
association :: Associate k v xs => Membership xs (k :> v)

-- | A readable type search result
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 <tt>xs</tt> is <tt>x</tt>
data NavHere xs x
[Here] :: NavHere (x : xs) x

-- | The <a>Membership</a> points the first element
here :: Membership (x : xs) x

-- | The next membership
navNext :: Membership xs y -> Membership (x : xs) y

-- | Type level binary number
data Nat
Zero :: Nat
DNat :: Nat -> Nat
SDNat :: Nat -> Nat

-- | Converts type naturals into <a>Word</a>.
class KnownPosition n
theInt :: KnownPosition n => proxy n -> Int

-- | The successor of the number
instance forall k (x :: k) (xs :: [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 v k (k1 :: k) (xs :: [Data.Extensible.Internal.Assoc k v]) (n :: Data.Extensible.Internal.Nat) (v1 :: v). (Data.Extensible.Internal.Elaborate k1 (Data.Extensible.Internal.FindAssoc k1 xs) ~ 'Data.Extensible.Internal.Expecting (n 'Data.Extensible.Internal.:> v1), Data.Extensible.Internal.KnownPosition n) => Data.Extensible.Internal.Associate k1 v1 xs
instance forall k (xs :: [k]) (x :: k). GHC.Show.Show (Data.Extensible.Internal.Membership xs x)
instance forall k (xs :: [k]) (x :: k). GHC.Classes.Eq (Data.Extensible.Internal.Membership xs x)
instance forall k (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)


-- | Heterogeneous list
module Data.Extensible.HList
data HList (h :: k -> *) (xs :: [k])
[HNil] :: HList h '[]
[HCons] :: h x -> HList h xs -> HList h (x : xs)
htraverse :: Applicative f => (forall x. g x -> f (h x)) -> HList g xs -> f (HList h xs)
htraverseWithIndex :: forall f g h xs. Applicative f => (forall x. Membership xs x -> g x -> f (h x)) -> HList g xs -> f (HList h xs)
hfoldrWithIndex :: forall h r xs. (forall x. Membership xs x -> h x -> r -> r) -> r -> HList h xs -> r
hlength :: HList h xs -> Int


module Data.Extensible.Class

-- | This class allows us to use <a>pieceAt</a> 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 <a>piece</a>, but reckon membership from its key.
pieceAssoc :: (Associate k v xs, Extensible f p t) => Optic' p f (t h xs) (h (k :> v))

-- | Access a specified element through a wrapper.
itemAt :: (Wrapper h, Extensible f p t) => Membership xs x -> Optic' p f (t h xs) (Repr h x)

-- | Access an element through a wrapper.
item :: (Wrapper h, Extensible f p t, x ∈ xs) => proxy x -> Optic' p f (t h xs) (Repr h x)

-- | Access an element specified by the key type through a wrapper.
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 <tt>x</tt> in the type level set <tt>xs</tt>.
data Membership (xs :: [k]) (x :: k)

-- | Generates a <a>Membership</a> that corresponds to the given ordinal
--   (0-origin).
mkMembership :: Int -> Q Exp

-- | <tt>x</tt> is a member of <tt>xs</tt>
class Member xs x
membership :: Member xs x => Membership xs x

-- | Remember that <tt>Member xs x</tt> from <a>Membership</a>.
remember :: forall xs x r. Membership xs x -> (Member xs x => r) -> r

-- | Unicode flipped alias for <a>Member</a>
type (∈) x xs = Member xs x

-- | FindType types

-- | Every type-level list is an instance of <a>Generate</a>.
class Generate (xs :: [k])

-- | Enumerate all possible <a>Membership</a>s of <tt>xs</tt>.
henumerate :: Generate xs => (forall x. Membership xs x -> r -> r) -> r -> r

-- | Count the number of memberships.
hcount :: Generate xs => proxy xs -> Int

-- | Enumerate <a>Membership</a>s and construct an <a>HList</a>.
hgenerateList :: (Generate xs, Applicative f) => (forall x. Membership xs x -> f (h x)) -> f (HList h xs)

-- | Every element in <tt>xs</tt> satisfies <tt>c</tt>
class (ForallF c xs, Generate xs) => Forall (c :: k -> Constraint) (xs :: [k])

-- | Enumerate all possible <a>Membership</a>s of <tt>xs</tt> with an
--   additional context.
henumerateFor :: Forall c xs => proxy c -> proxy' xs -> (forall x. c x => Membership xs x -> r -> r) -> r -> r
hgenerateListFor :: (Forall c xs, Applicative f) => proxy c -> (forall x. c x => Membership xs x -> f (h x)) -> f (HList h xs)

-- | The kind of key-value pairs
data Assoc k v
(:>) :: k -> v -> Assoc k v

-- | A synonym for (<a>:&gt;</a>)
type (>:) = (:>)

-- | <tt><a>Associate</a> k v xs</tt> is essentially identical to <tt>(k
--   :&gt; v) ∈ xs</tt> , but the type <tt>v</tt> is inferred from
--   <tt>k</tt> and <tt>xs</tt>.
class Associate k v xs | k xs -> v
association :: Associate k v xs => Membership xs (k :> v)

-- | A readable type search result
data Elaborated k v
Expecting :: v -> Elaborated k v
Missing :: k -> Elaborated k v
Duplicate :: k -> Elaborated k v
instance Data.Extensible.Class.Generate '[]
instance forall k (xs :: [k]) (x :: k). Data.Extensible.Class.Generate xs => Data.Extensible.Class.Generate (x : xs)
instance forall k (c :: k -> GHC.Types.Constraint). Data.Extensible.Class.Forall c '[]
instance forall a (c :: a -> GHC.Types.Constraint) (x :: a) (xs :: [a]). (c x, Data.Extensible.Class.Forall c xs) => Data.Extensible.Class.Forall c (x : xs)


-- | Mutable structs
module Data.Extensible.Struct

-- | Mutable type-indexed struct.
data Struct s (h :: k -> *) (xs :: [k])

-- | Write a value in a <a>Struct</a>.
set :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> h x -> m ()

-- | Read a value from a <a>Struct</a>.
get :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> m (h x)

-- | Create a new <a>Struct</a> 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 <a>Struct</a> 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 <a>Struct</a> 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 <a>Struct</a> from an <tt>HList</tt>.
newFromHList :: forall h m xs. PrimMonad m => HList h xs -> m (Struct (PrimState m) h xs)
atomicModify :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> (h x, a)) -> m a
atomicModify' :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> (h x, a)) -> m a
atomicModify_ :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> h x) -> m (h x)
atomicModify'_ :: PrimMonad m => Struct (PrimState m) h xs -> Membership xs x -> (h x -> h x) -> m (h x)

-- | The type of extensible products.
--   
--   <pre>
--   (:*) :: (k -&gt; *) -&gt; [k] -&gt; *
--   </pre>
data (:*) (h :: k -> *) (s :: [k])

-- | Turn <a>Struct</a> into an immutable product. The original
--   <a>Struct</a> may not be used.
unsafeFreeze :: PrimMonad m => Struct (PrimState m) h xs -> m (h :* xs)

-- | Create a new <a>Struct</a> using the contents of a product.
newFrom :: forall g h m xs. (PrimMonad m) => g :* xs -> (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 -> h :* xs -> h x

-- | The size of a product.
hlength :: h :* xs -> Int

-- | Right-associative fold of a product.
hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> h :* xs -> r

-- | Create a new <a>Struct</a> from a product.
thaw :: PrimMonad m => h :* xs -> m (Struct (PrimState m) h xs)

-- | Create a product from an <a>ST</a> action which returns a
--   <a>Struct</a>.
hfrozen :: (forall s. ST s (Struct s h xs)) -> h :* xs
hmodify :: (forall s. Struct s h xs -> ST s ()) -> h :* xs -> h :* xs

-- | Convert a product into an <tt>HList</tt>.
toHList :: forall h xs. h :* xs -> 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.:*)


module Data.Extensible.Sum

-- | The extensible sum type
--   
--   <pre>
--   (:|) :: (k -&gt; *) -&gt; [k] -&gt; *
--   </pre>
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

-- | <i>O(1)</i> lift a value.
embed :: (x ∈ xs) => h x -> h :| xs

-- | Try to extract something you want.
strike :: forall h x xs. (x ∈ xs) => h :| xs -> Maybe (h x)

-- | Try to extract something you want.
strikeAt :: forall h x xs. Membership xs x -> h :| xs -> Maybe (h x)

-- | <i>O(1)</i> Naive pattern match
(<:|) :: (h x -> r) -> (h :| xs -> r) -> h :| (x : xs) -> r
infixr 1 <:|

-- | There is no empty union.
exhaust :: h :| '[] -> r

-- | Embed a value, but focuses on its key.
embedAssoc :: Associate k a xs => h (k :> a) -> h :| xs
instance forall k (xs :: [k]). GHC.Enum.Enum (Data.Proxy.Proxy Data.Extensible.Sum.:| xs)
instance forall k (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.Product

-- | The type of extensible products.
--   
--   <pre>
--   (:*) :: (k -&gt; *) -&gt; [k] -&gt; *
--   </pre>
data (:*) (h :: k -> *) (s :: [k])

-- | An empty product.
nil :: h :* '[]

-- | O(n) Prepend an element onto a product. Expressions like <tt>a &lt;: b
--   &lt;: c &lt;: nil</tt> are transformed to a single <a>fromHList</a>.
(<:) :: h x -> h :* xs -> h :* (x : xs)
infixr 0 <:

-- | Strict version of (<a>&lt;:</a>).
(<!) :: h x -> h :* xs -> h :* (x : xs)
infixr 0 <!

-- | The size of a product.
hlength :: h :* xs -> Int

-- | Transform every element in a product, preserving the order.
--   
--   <pre>
--   <a>hmap</a> <a>id</a> ≡ <a>id</a>
--   <a>hmap</a> (f . g) ≡ <a>hmap</a> f . <a>hmap</a> g
--   </pre>
hmap :: (forall x. g x -> h x) -> g :* xs -> h :* xs

-- | Map a function to every element of a product.
hmapWithIndex :: (forall x. Membership xs x -> g x -> h x) -> g :* xs -> h :* xs

-- | <a>zipWith</a> for heterogeneous product
hzipWith :: (forall x. f x -> g x -> h x) -> f :* xs -> g :* xs -> h :* xs

-- | <a>zipWith3</a> 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.
--   
--   <pre>
--   <a>hfoldMap</a> f . <a>hmap</a> g ≡ <a>hfoldMap</a> (f . g)
--   </pre>
hfoldMap :: Monoid a => (forall x. h x -> a) -> h :* xs -> a

-- | <a>hfoldMap</a> with the membership of elements.
hfoldMapWithIndex :: Monoid a => (forall x. Membership xs x -> g x -> a) -> g :* xs -> a

-- | Right-associative fold of a product.
hfoldrWithIndex :: (forall x. Membership xs x -> h x -> r -> r) -> r -> h :* xs -> r

-- | Traverse all elements and combine the result sequentially. <tt>
--   htraverse (fmap f . g) ≡ fmap (hmap f) . htraverse g htraverse pure ≡
--   pure htraverse (Comp . fmap g . f) ≡ Comp . fmap (htraverse g) .
--   htraverse f </tt>
htraverse :: Applicative f => (forall x. g x -> f (h x)) -> g :* xs -> f (h :* xs)

-- | <a>htraverse</a> with <a>Membership</a>s.
htraverseWithIndex :: Applicative f => (forall x. Membership xs x -> g x -> f (h x)) -> g :* xs -> f (h :* xs)

-- | <a>sequence</a> analog for extensible products
hsequence :: Applicative f => Comp f h :* xs -> f (h :* xs)
hfoldMapFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => h x -> a) -> h :* xs -> a

-- | <a>hfoldMapWithIndex</a> with a constraint for each element.
hfoldMapWithIndexFor :: (Forall c xs, Monoid a) => proxy c -> (forall x. c x => Membership xs x -> h x -> a) -> h :* xs -> a

-- | <a>hfoldrWithIndex</a> with a constraint for each element.
hfoldrWithIndexFor :: (Forall c xs) => proxy c -> (forall x. c x => Membership xs x -> h x -> r -> r) -> r -> h :* xs -> r

-- | Evaluate every element in a product.
hforce :: h :* xs -> h :* xs

-- | Accumulate sums on a product.
haccumMap :: Foldable f => (a -> g :| xs) -> (forall x. Membership xs x -> g x -> h x -> h x) -> h :* xs -> f a -> h :* xs

-- | <pre>
--   haccum = <a>haccumMap</a> <a>id</a>
--   </pre>
haccum :: Foldable f => (forall x. Membership xs x -> g x -> h x -> h x) -> h :* xs -> f (g :| xs) -> h :* xs

-- | Group sums by type.
hpartition :: (Foldable f, Generate xs) => (a -> h :| xs) -> f a -> Comp [] h :* xs

-- | Get an element in a product.
hlookup :: Membership xs x -> h :* xs -> h x

-- | Flipped <a>hlookup</a>
hindex :: h :* xs -> Membership xs x -> h x

-- | Every type-level list is an instance of <a>Generate</a>.
class Generate (xs :: [k])

-- | Enumerate all possible <a>Membership</a>s of <tt>xs</tt>.
henumerate :: Generate xs => (forall x. Membership xs x -> r -> r) -> r -> r

-- | Count the number of memberships.
hcount :: Generate xs => proxy xs -> Int

-- | Enumerate <a>Membership</a>s and construct an <a>HList</a>.
hgenerateList :: (Generate xs, Applicative f) => (forall x. Membership xs x -> f (h x)) -> f (HList h xs)

-- | <a>Applicative</a> version of <a>htabulate</a>.
hgenerate :: (Generate xs, Applicative f) => (forall x. Membership xs x -> f (h x)) -> f (h :* xs)

-- | Construct a product using a function which takes a <a>Membership</a>.
--   
--   <pre>
--   <a>hmap</a> f (<a>htabulate</a> g) ≡ <a>htabulate</a> (f . g)
--   <a>htabulate</a> (<a>hindex</a> m) ≡ m
--   <a>hindex</a> (<a>htabulate</a> k) ≡ k
--   </pre>
htabulate :: Generate xs => (forall x. Membership xs x -> h x) -> h :* xs

-- | A product filled with the specified value.
hrepeat :: Generate xs => (forall x. h x) -> h :* xs

-- | The dual of <a>htraverse</a>
hcollect :: (Functor f, Generate xs) => (a -> h :* xs) -> f a -> Comp f h :* xs

-- | The dual of <a>hsequence</a>
hdistribute :: (Functor f, Generate xs) => f (h :* xs) -> Comp f h :* xs

-- | Convert <a>HList</a> into a product.
fromHList :: HList h xs -> h :* xs

-- | Convert a product into an <tt>HList</tt>.
toHList :: forall h xs. h :* xs -> HList h xs

-- | Every element in <tt>xs</tt> satisfies <tt>c</tt>
class (ForallF c xs, Generate xs) => Forall (c :: k -> Constraint) (xs :: [k])

-- | Enumerate all possible <a>Membership</a>s of <tt>xs</tt> with an
--   additional context.
henumerateFor :: Forall c xs => proxy c -> proxy' xs -> (forall x. c x => Membership xs x -> r -> r) -> r -> r
hgenerateListFor :: (Forall c xs, Applicative f) => proxy c -> (forall x. c x => Membership xs x -> f (h x)) -> f (HList h xs)

-- | <a>Applicative</a> version of <a>htabulateFor</a>.
hgenerateFor :: (Forall c xs, Applicative f) => proxy c -> (forall x. c x => Membership xs x -> f (h x)) -> f (h :* xs)

-- | Pure version of <a>hgenerateFor</a>.
htabulateFor :: Forall c xs => proxy c -> (forall x. c x => Membership xs x -> h x) -> h :* xs

-- | A product filled with the specified value.
hrepeatFor :: Forall c xs => proxy c -> (forall x. c x => h x) -> h :* xs

module Data.Extensible.Dictionary

-- | Reify a collection of dictionaries, as you wish.
library :: forall c xs. 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 forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Show.Show h xs => GHC.Show.Show (h Data.Extensible.Struct.:* xs)
instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Classes.Eq h xs => GHC.Classes.Eq (h Data.Extensible.Struct.:* xs)
instance forall k (h :: k -> GHC.Types.*) (xs :: [k]). (GHC.Classes.Eq (h Data.Extensible.Struct.:* xs), Data.Extensible.Dictionary.WrapForall GHC.Classes.Ord h xs) => GHC.Classes.Ord (h Data.Extensible.Struct.:* xs)
instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Base.Monoid h xs => GHC.Base.Monoid (h Data.Extensible.Struct.:* xs)
instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Control.DeepSeq.NFData h xs => Control.DeepSeq.NFData (h Data.Extensible.Struct.:* xs)
instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Show.Show h xs => GHC.Show.Show (h Data.Extensible.Sum.:| xs)
instance forall k (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall GHC.Classes.Eq h xs => GHC.Classes.Eq (h Data.Extensible.Sum.:| xs)
instance forall k (h :: k -> GHC.Types.*) (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 (h :: k -> *) (xs :: [k]). Data.Extensible.Dictionary.WrapForall Control.DeepSeq.NFData h xs => Control.DeepSeq.NFData (h Data.Extensible.Sum.:| xs)
instance forall k k1 (c :: k1 -> GHC.Types.Constraint) (h :: k -> k1) (x :: k). c (h x) => Data.Extensible.Dictionary.Instance1 c h x


module Data.Extensible.Inclusion

-- | Unicode alias for <a>Include</a>
type (⊆) xs ys = Include ys xs

-- | <tt>ys</tt> contains <tt>xs</tt>
type Include ys = Forall (Member ys)

-- | Reify the inclusion of type level sets.
inclusion :: forall xs ys. Include ys xs => Membership ys :* xs

-- | <i>O(n)</i> Select some elements.
shrink :: (xs ⊆ ys) => h :* ys -> h :* xs

-- | <i>O(1)</i> Embed to a larger union.
spread :: (xs ⊆ ys) => h :| xs -> h :| ys

-- | Similar to <a>Include</a>, but this focuses on keys.
type IncludeAssoc ys = Forall (Associated ys)

-- | <tt><a>Associated</a> xs (k ':&gt; v)</tt> is equivalent to
--   <tt><a>Associate</a> k v xs</tt>
class Associated' xs t => Associated xs t

-- | Reify the inclusion of type level sets.
inclusionAssoc :: forall xs ys. IncludeAssoc ys xs => Membership ys :* xs

-- | <i>O(n)</i> Select some elements.
shrinkAssoc :: (IncludeAssoc ys xs) => h :* ys -> h :* xs

-- | <i>O(1)</i> Embed to a larger union.
spreadAssoc :: (IncludeAssoc ys xs) => h :| xs -> h :| ys
instance forall k v (xs :: [Data.Extensible.Internal.Assoc k v]) (t :: Data.Extensible.Internal.Assoc k v) (k1 :: k) (v1 :: v). (Data.Extensible.Inclusion.Associated' xs t, t ~ (k1 'Data.Extensible.Internal.:> v1)) => Data.Extensible.Inclusion.Associated xs t


-- | 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

-- | <i>O(1)</i> Perform pattern matching.
match :: Match h a :* xs -> h :| xs -> a

-- | Applies a function to the result of <a>Match</a>.
mapMatch :: (a -> b) -> Match h a x -> Match h b x

-- | Flipped <a>match</a>
caseOf :: h :| xs -> Match h a :* xs -> a
infix 0 `caseOf`
instance forall k (h :: k -> GHC.Types.*) r. Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Match.Match h r)


-- | Flexible records and variants
module Data.Extensible.Field

-- | A <tt><a>Field</a> h (k ':&gt; v)</tt> is <tt>h v</tt> annotated with
--   the field name <tt>k</tt>.
--   
--   <pre>
--   <a>Field</a> :: (v -&gt; *) -&gt; Assoc k v -&gt; *
--   </pre>
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)
infix 1 @=

-- | Lifted (<a>@=</a>)
(<@=>) :: (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 <a>Wrapper</a>.
(@:>) :: FieldName k -> h v -> Field h (k :> v)
infix 1 @:>

-- | Kind-monomorphic, unwrapped version of <tt>('</tt>=')@
(@==) :: FieldName (k :: Symbol) -> v -> Field Identity (k :> v)
infix 1 @==

-- | <tt>FieldOptic s</tt> is a type of optics that points a
--   field/constructor named <tt>s</tt>.
--   
--   The yielding fields can be <a>Lens</a>es for <a>Record</a>s and
--   <a>Prism</a>s for <a>Variant</a>s.
--   
--   <pre>
--   <a>FieldOptic</a> "foo" = Associate "foo" a xs =&gt; Lens' (<a>Record</a> xs) a
--   <a>FieldOptic</a> "foo" = Associate "foo" a xs =&gt; Prism' (<a>Variant</a> xs) a
--   </pre>
--   
--   <a>FieldOptic</a>s can be generated using <tt>mkField</tt> defined in
--   the <a>Data.Extensible.TH</a> module.
type FieldOptic k = forall kind. 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
--   <tt>FieldLens</tt>. This type is used to resolve the name of the field
--   internally.
type FieldName k = Optic' (LabelPhantom k) Proxy (Inextensible (Field Proxy) '[k :> ()]) ()

-- | Lift a function for the content.
liftField :: (g (AssocValue kv) -> h (AssocValue kv)) -> Field g kv -> Field h kv

-- | Lift a function for the content.
liftField2 :: (f (AssocValue kv) -> g (AssocValue kv) -> h (AssocValue kv)) -> Field f kv -> Field g kv -> Field h kv

-- | The type of records which contain several fields.
--   
--   <pre>
--   RecordOf :: (v -&gt; *) -&gt; [Assoc k v] -&gt; *
--   </pre>
type RecordOf h = (:*) (Field h)

-- | Simple record
type Record = RecordOf Identity

-- | An empty <a>Record</a>.
emptyRecord :: Record '[]

-- | The dual of <a>RecordOf</a>
--   
--   <pre>
--   VariantOf :: (v -&gt; *) -&gt; [Assoc k v] -&gt; *
--   </pre>
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

-- | Pattern matching on a <a>Variant</a>
matchField :: RecordOf (Match h r) xs -> VariantOf h xs -> r

-- | Take the type of the key

-- | Take the type of the value

-- | Combined constraint for <a>Assoc</a>
class (pk (AssocKey kv), pv (AssocValue kv)) => KeyValue pk pv kv

-- | Proxy-level <a>AssocKey</a>. This is useful when using
--   <a>symbolVal</a>.
proxyAssocKey :: proxy kv -> Proxy (AssocKey kv)

-- | A ghostly type which spells the field name
data LabelPhantom s a b

-- | Signifies a field name internally

-- | The trivial inextensible data type
data Inextensible (h :: k -> *) (xs :: [k])
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Classes.Eq (h (Data.Extensible.Field.AssocValue kv)) => GHC.Classes.Eq (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Classes.Ord (h (Data.Extensible.Field.AssocValue kv)) => GHC.Classes.Ord (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Num.Num (h (Data.Extensible.Field.AssocValue kv)) => GHC.Num.Num (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Real.Integral (h (Data.Extensible.Field.AssocValue kv)) => GHC.Real.Integral (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Real.Fractional (h (Data.Extensible.Field.AssocValue kv)) => GHC.Real.Fractional (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Float.Floating (h (Data.Extensible.Field.AssocValue kv)) => GHC.Float.Floating (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Real.Real (h (Data.Extensible.Field.AssocValue kv)) => GHC.Real.Real (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Float.RealFloat (h (Data.Extensible.Field.AssocValue kv)) => GHC.Float.RealFloat (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Real.RealFrac (h (Data.Extensible.Field.AssocValue kv)) => GHC.Real.RealFrac (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). Data.Semigroup.Semigroup (h (Data.Extensible.Field.AssocValue kv)) => Data.Semigroup.Semigroup (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). Foreign.Storable.Storable (h (Data.Extensible.Field.AssocValue kv)) => Foreign.Storable.Storable (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Base.Monoid (h (Data.Extensible.Field.AssocValue kv)) => GHC.Base.Monoid (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Enum.Enum (h (Data.Extensible.Field.AssocValue kv)) => GHC.Enum.Enum (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). GHC.Enum.Bounded (h (Data.Extensible.Field.AssocValue kv)) => GHC.Enum.Bounded (Data.Extensible.Field.Field h kv)
instance forall v (h :: v -> *) k (kv :: Data.Extensible.Internal.Assoc k v). Control.DeepSeq.NFData (h (Data.Extensible.Field.AssocValue kv)) => Control.DeepSeq.NFData (Data.Extensible.Field.Field h kv)
instance forall v k (pk :: k -> GHC.Types.Constraint) (k1 :: k) (pv :: v -> GHC.Types.Constraint) (v1 :: v). (pk k1, pv v1) => Data.Extensible.Field.KeyValue pk pv (k1 'Data.Extensible.Internal.:> v1)
instance forall k v (h :: v -> GHC.Types.*). Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Field.Field h)
instance forall v (k :: GHC.Types.Symbol) (h :: v -> GHC.Types.*) (v1 :: v). (GHC.TypeLits.KnownSymbol k, Data.Extensible.Wrapper.Wrapper h, GHC.Show.Show (Data.Extensible.Wrapper.Repr h v1)) => GHC.Show.Show (Data.Extensible.Field.Field h (k 'Data.Extensible.Internal.:> v1))
instance (GHC.Base.Functor f, Data.Profunctor.Unsafe.Profunctor p) => Data.Extensible.Class.Extensible f p Data.Extensible.Field.Inextensible
instance forall k (s :: k). Data.Profunctor.Unsafe.Profunctor (Data.Extensible.Field.LabelPhantom s)


-- | Name-based extensible effects
module Data.Extensible.Effect

-- | A unit of named 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 an instruction onto an <a>Eff</a> action.
liftEff :: forall s t xs a. Associate s t xs => Proxy s -> t a -> Eff xs a

-- | Lift an instruction onto an <a>Eff</a> action and apply a function to
--   the result.
liftsEff :: forall s t xs a r. Associate s t xs => Proxy s -> t a -> (a -> r) -> Eff xs r

-- | Censor a specific type of effects in an action.
hoistEff :: forall s t xs a. Associate s t xs => Proxy s -> (forall x. t x -> t x) -> Eff xs a -> Eff xs 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 <a>Eff</a> action using a record of <a>Interpreter</a>s.
handleEff :: RecordOf (Interpreter m) xs -> Eff xs a -> MonadView m (Eff xs) a

-- | Build a relay-style handler from a triple of functions.
--   
--   <pre>
--   runStateEff = peelEff1 (a s -&gt; return (a, s))
--     (m k s -&gt; let (a, s') = runState m s in k a s')
--   </pre>
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 <a>Instruction</a> in <a>peelEff</a>.
type Rebinder xs r = forall x. Instruction xs x -> (x -> r) -> r

-- | A common value for the second argument of <a>peelEff</a>. Binds an
--   instruction directly.
rebindEff0 :: Rebinder xs (Eff xs r)

-- | A pre-defined value for the second argument of <a>peelEff</a>.
--   Preserves the argument of the continuation.
rebindEff1 :: Rebinder xs (a -> Eff xs r)

-- | <a>peelEff</a> specialised for 1-argument continuation
peelEff1 :: (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 <a>peelEff</a>.
--   Preserves two arguments of the continuation.
rebindEff2 :: Rebinder xs (a -> b -> Eff xs r)

-- | Reveal the final result of <a>Eff</a>.
leaveEff :: Eff '[] a -> a

-- | Tear down an action using the <a>Monad</a> 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

-- | <tt><a>Function</a> [a, b, c] r</tt> is <tt>a -&gt; b -&gt; c -&gt;
--   r</tt>

-- | Pass the arguments of <a>Action</a> to the supplied function.
runAction :: Function xs (f a) -> Action xs a r -> f r

-- | Create a <a>Field</a> of a <a>Interpreter</a> for an <a>Action</a>.
(@!?) :: FieldName k -> Function xs (f a) -> Field (Interpreter f) (k :> Action xs a)
infix 1 @!?

-- | Specialised version of <a>peelEff</a> for <a>Action</a>s. You can pass
--   a function <tt>a -&gt; b -&gt; ... -&gt; (q -&gt; r) -&gt; r</tt> as a
--   handler for <tt><a>Action</a> '[a, b, ...] q</tt>.
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 <a>peelAction</a>.
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. Associate k (ReaderEff r) xs => Proxy k -> Eff xs r

-- | Pass the environment to a function.
asksEff :: forall k r xs a. Associate k (ReaderEff r) xs => Proxy k -> (r -> a) -> Eff xs a

-- | Modify the enviroment locally.
localEff :: forall k r xs a. Associate k (ReaderEff r) xs => 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 <tt>s</tt> of the state to
--   carry.
--   
--   The <a>return</a> function leaves the state unchanged, while
--   <tt>&gt;&gt;=</tt> 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. Associate k (State s) xs => Proxy k -> Eff xs s

-- | Pass the current state to a function.
getsEff :: forall k s a xs. Associate k (State s) xs => Proxy k -> (s -> a) -> Eff xs a

-- | Replace the state with a new value.
putEff :: forall k s xs. Associate k (State s) xs => Proxy k -> s -> Eff xs ()

-- | Modify the state.
modifyEff :: forall k s xs. Associate k (State s) xs => Proxy k -> (s -> s) -> Eff xs ()

-- | Lift a state modification function.
stateEff :: forall k s xs a. Associate k (State s) xs => 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.
execStateEff :: forall k s xs a. Eff ((k >: State s) : xs) a -> s -> Eff xs s

-- | <tt>(,)</tt> already is a writer monad.
type WriterEff w = (,) w

-- | Write the second element and return the first element.
writerEff :: forall k w xs a. (Associate k (WriterEff w) xs) => Proxy k -> (a, w) -> Eff xs a

-- | Write a value.
tellEff :: forall k w xs. (Associate k (WriterEff w) xs) => Proxy k -> w -> Eff xs ()

-- | Squash the outputs into one step and return it.
listenEff :: forall k w xs a. (Associate k (WriterEff w) xs, 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. (Associate k (WriterEff w) xs, 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 ()

-- | Run an effect which may fail in the name of <tt>k</tt>.
runMaybeEff :: forall k xs a. Eff ((k >: MaybeEff) : xs) a -> Eff xs (Maybe a)

-- | Throwing an exception
type EitherEff = Const

-- | Throw an exception <tt>e</tt>, throwing the rest of the computation
--   away.
throwEff :: Associate k (EitherEff e) xs => Proxy k -> e -> Eff xs a

-- | Attach a handler for an exception.
catchEff :: forall k e xs a. (Associate k (EitherEff e) xs) => Proxy k -> Eff xs a -> (e -> Eff xs a) -> Eff xs a

-- | Run the frontal Either effect.
runEitherEff :: forall k e xs a. Eff ((k >: EitherEff e) : xs) a -> Eff xs (Either e a)

-- | Identity functor and monad. (a non-strict monad)
data Identity a :: * -> *

-- | Put a milestone on a computation.
tickEff :: Associate k Identity xs => Proxy k -> Eff xs ()

-- | Run a computation until <a>tickEff</a>.
runIterEff :: Eff ((k >: Identity) : xs) a -> Eff xs (Either a (Eff ((k >: Identity) : xs) a))


-- | Default monad runners and <a>MonadIO</a>, <a>MonadReader</a>,
--   <a>MonadWriter</a>, <a>MonadState</a>, <a>MonadError</a> instances
module Data.Extensible.Effect.Default
type ReaderDef r = "Reader" >: ReaderEff r
runReaderDef :: Eff (ReaderDef r : xs) a -> r -> Eff xs a
type StateDef s = "State" >: State s
runStateDef :: Eff (StateDef s : xs) a -> s -> Eff xs (a, s)
type WriterDef w = "Writer" >: WriterEff w
runWriterDef :: Monoid w => Eff (WriterDef w : xs) a -> Eff xs (a, w)
type MaybeDef = "Maybe" >: EitherEff ()
runMaybeDef :: Eff (MaybeDef : xs) a -> Eff xs (Maybe a)
type EitherDef e = "Either" >: EitherEff e
runEitherDef :: Eff (EitherDef e : xs) a -> Eff xs (Either e a)
instance Data.Extensible.Internal.Associate "IO" GHC.Types.IO xs => Control.Monad.IO.Class.MonadIO (Data.Extensible.Effect.Eff xs)
instance Data.Extensible.Internal.Associate "Reader" ((Data.Type.Equality.:~:) r) xs => Control.Monad.Reader.Class.MonadReader r (Data.Extensible.Effect.Eff xs)
instance Data.Extensible.Internal.Associate "State" (Control.Monad.Trans.State.Strict.State s) xs => Control.Monad.State.Class.MonadState s (Data.Extensible.Effect.Eff xs)
instance (GHC.Base.Monoid w, Data.Extensible.Internal.Associate "Writer" ((,) w) xs) => Control.Monad.Writer.Class.MonadWriter w (Data.Extensible.Effect.Eff xs)
instance Data.Extensible.Internal.Associate "Either" (Data.Functor.Const.Const e) xs => Control.Monad.Error.Class.MonadError e (Data.Extensible.Effect.Eff xs)
instance (GHC.Base.Monoid e, Data.Extensible.Internal.Associate "Either" (Data.Functor.Const.Const e) xs) => GHC.Base.Alternative (Data.Extensible.Effect.Eff xs)
instance (GHC.Base.Monoid e, Data.Extensible.Internal.Associate "Either" (Data.Functor.Const.Const e) xs) => GHC.Base.MonadPlus (Data.Extensible.Effect.Eff xs)


-- | Experimental API for OverloadedLabels. GHC 8.0+ only
module Data.Extensible.Label

-- | Specialised version of <a>itemAssoc</a>.
訊 :: Proxy k -> FieldOptic k
instance k ~ l => GHC.OverloadedLabels.IsLabel k (Data.Proxy.Proxy l)
instance forall v (f :: * -> *) (p :: * -> * -> *) (t :: (Data.Extensible.Internal.Assoc GHC.Types.Symbol v -> GHC.Types.*) -> [Data.Extensible.Internal.Assoc GHC.Types.Symbol v] -> GHC.Types.*) (k :: GHC.Types.Symbol) (v1 :: v) (xs :: [Data.Extensible.Internal.Assoc GHC.Types.Symbol v]) (h :: v -> GHC.Types.*) rep. (Data.Extensible.Class.Extensible f p t, Data.Extensible.Internal.Associate k v1 xs, Data.Extensible.Field.Labelling k p, Data.Extensible.Wrapper.Wrapper h, rep ~ Data.Extensible.Wrapper.Repr h v1) => GHC.OverloadedLabels.IsLabel k (Data.Extensible.Internal.Rig.Optic' p f (t (Data.Extensible.Field.Field h) xs) rep)


module Data.Extensible.Nullable

-- | A product filled with <tt><a>Nullable</a> <a>Nothing</a></tt>
vacancy :: Generate xs => Nullable h :* xs

-- | The inverse of <a>inclusion</a>.
coinclusion :: (Include ys xs, Generate ys) => Nullable (Membership xs) :* ys

-- | Extend a product and fill missing fields by <tt>Null</tt>.
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

-- | 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). 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 -> GHC.Types.*). Data.Extensible.Wrapper.Wrapper h => Data.Extensible.Wrapper.Wrapper (Data.Extensible.Nullable.Nullable h)
instance forall k (h :: k -> *) (x :: k). Data.Semigroup.Semigroup (h x) => GHC.Base.Monoid (Data.Extensible.Nullable.Nullable h x)


module Data.Extensible.Plain

-- | Alias for plain products
type AllOf xs = Identity :* xs

-- | Alias for plain sums
type OneOf xs = Identity :| xs

-- | <i>O(log n)</i> 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) => (a -> x) -> Optic' p f (t Identity xs) a


-- | Bidirectional conversion from/to records
module Data.Extensible.Record

-- | The class of types that can be converted to/from a <a>Record</a>.
class IsRecord a where type RecFields a :: [Assoc Symbol *] where {
    type family RecFields a :: [Assoc Symbol *];
}
recordFromList :: IsRecord a => HList (Field Identity) (RecFields a) -> a
recordToList :: IsRecord a => a -> HList (Field Identity) (RecFields a)

-- | Convert a value into a <a>Record</a>.
toRecord :: IsRecord a => a -> Record (RecFields a)

-- | Convert a <a>Record</a> to a value.
fromRecord :: IsRecord a => Record (RecFields a) -> a

-- | <pre>
--   record :: IsRecord a =&gt; Iso' a (Record (RecFields a))
--   </pre>
record :: (IsRecord a, Functor f, Profunctor p) => Optic' p f a (Record (RecFields a))

-- | Create an <a>IsRecord</a> instance for a normal record declaration.
deriveIsRecord :: Name -> DecsQ
instance Data.Extensible.Record.IsRecord ()


module Data.Extensible.TH

-- | Generate fields using <a>itemAssoc</a>. <tt><a>mkField</a> "foo
--   Bar"</tt> defines:
--   
--   <pre>
--   foo :: FieldOptic "foo"
--   foo = itemAssoc (Proxy :: Proxy "foo")
--   _Bar :: FieldOptic <a>Bar</a>
--   _Bar = itemAssoc (Proxy :: Proxy <a>Bar</a>)
--   </pre>
mkField :: String -> DecsQ

-- | Generate named effects from a GADT declaration.
--   
--   <pre>
--   decEffects [d|
--    data Blah a b x where
--      Blah :: Int -&gt; a -&gt; Blah a b b
--    |]
--   </pre>
--   
--   generates
--   
--   <pre>
--   type Blah a b = "Blah" &gt;: Action '[Int, a] b
--   blah :: forall xs a b
--     . Associate "Blah" (Action '[Int, a] b) xs
--     =&gt; Int -&gt; a -&gt; Eff xs b
--   blah a0 a1
--     = liftEff
--       (Data.Proxy.Proxy :: Data.Proxy.Proxy "Blah")
--       (AArgument a0 (AArgument a1 AResult))
--   </pre>
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
customDecEffects :: Bool -> Bool -> DecsQ -> DecsQ


-- | Extensible tangles
module Data.Extensible.Tangle

-- | <tt><a>TangleT</a> h xs m</tt> is the monad of computations that may
--   depend on the elements in <tt>xs</tt>.
newtype TangleT h xs m a
TangleT :: RWST (Comp (TangleT h xs m) h :* xs) () (Nullable h :* xs) m a -> TangleT h xs m a
[unTangleT] :: TangleT h xs m a -> RWST (Comp (TangleT h xs m) h :* xs) () (Nullable h :* xs) m a

-- | Hitch an element associated to the <a>FieldName</a> through a wrapper.
lasso :: forall k v m h xs. (Monad m, Associate k v xs, Wrapper h) => FieldName k -> TangleT h xs m (Repr h (k :> v))

-- | Take a value from the tangles. The result is memoized.
hitchAt :: Monad m => Membership xs x -> TangleT h xs m (h x)

-- | Run a <a>TangleT</a> action and return the result and the calculated
--   values.
runTangleT :: Monad m => Comp (TangleT h xs m) h :* xs -> Nullable h :* xs -> TangleT h xs m a -> m (a, Nullable h :* xs)

-- | Run a <a>TangleT</a> action.
evalTangleT :: Monad m => Comp (TangleT h xs m) h :* xs -> Nullable h :* xs -> TangleT h xs m a -> m a

-- | Run tangles and collect all the results as a <a>Record</a>.
runTangles :: Monad m => Comp (TangleT h xs m) h :* xs -> Nullable h :* xs -> m (h :* xs)
instance forall k (h :: k -> *) (xs :: [k]) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Monad (Data.Extensible.Tangle.TangleT h xs m)
instance forall k (h :: k -> *) (xs :: [k]) (m :: * -> *). GHC.Base.Monad m => GHC.Base.Applicative (Data.Extensible.Tangle.TangleT h xs m)
instance forall k (h :: k -> *) (xs :: [k]) (m :: * -> *). GHC.Base.Functor m => GHC.Base.Functor (Data.Extensible.Tangle.TangleT h xs m)
instance forall k (h :: k -> *) (xs :: [k]). Control.Monad.Trans.Class.MonadTrans (Data.Extensible.Tangle.TangleT h xs)
instance forall k (m :: * -> *) a (h :: k -> *) (xs :: [k]). (GHC.Base.Monad m, GHC.Base.Monoid a) => GHC.Base.Monoid (Data.Extensible.Tangle.TangleT h xs m a)


-- | This module just reexports everything.
module Data.Extensible
