{-# LANGUAGE ScopedTypeVariables #-}
module Data.Extensible.Tangle
( TangleT(..)
, lasso
, hitchAt
, runTangleT
, evalTangleT
, runTangles
) where
import Control.Applicative
import Control.Monad.Trans.RWS.Strict
import Control.Monad.Trans.Class
import Data.Functor.Compose
import Data.Extensible.Class
import Data.Extensible.Product
import Data.Extensible.Internal.Rig
import Data.Extensible.Nullable
import Data.Extensible.Wrapper
import Data.Proxy
newtype TangleT xs h m a = TangleT
{ forall {k} (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
TangleT xs h m a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
unTangleT :: RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a }
deriving ((forall a b. (a -> b) -> TangleT xs h m a -> TangleT xs h m b)
-> (forall a b. a -> TangleT xs h m b -> TangleT xs h m a)
-> Functor (TangleT xs h m)
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Functor m =>
a -> TangleT xs h m b -> TangleT xs h m a
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Functor m =>
(a -> b) -> TangleT xs h m a -> TangleT xs h m b
forall a b. a -> TangleT xs h m b -> TangleT xs h m a
forall a b. (a -> b) -> TangleT xs h m a -> TangleT xs h m b
forall (f :: Type -> Type).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Functor m =>
(a -> b) -> TangleT xs h m a -> TangleT xs h m b
fmap :: forall a b. (a -> b) -> TangleT xs h m a -> TangleT xs h m b
$c<$ :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Functor m =>
a -> TangleT xs h m b -> TangleT xs h m a
<$ :: forall a b. a -> TangleT xs h m b -> TangleT xs h m a
Functor, Functor (TangleT xs h m)
Functor (TangleT xs h m) =>
(forall a. a -> TangleT xs h m a)
-> (forall a b.
TangleT xs h m (a -> b) -> TangleT xs h m a -> TangleT xs h m b)
-> (forall a b c.
(a -> b -> c)
-> TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m c)
-> (forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b)
-> (forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m a)
-> Applicative (TangleT xs h m)
forall a. a -> TangleT xs h m a
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type).
Monad m =>
Functor (TangleT xs h m)
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
Monad m =>
a -> TangleT xs h m a
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m a
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m (a -> b) -> TangleT xs h m a -> TangleT xs h m b
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b c.
Monad m =>
(a -> b -> c)
-> TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m c
forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m a
forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
forall a b.
TangleT xs h m (a -> b) -> TangleT xs h m a -> TangleT xs h m b
forall a b c.
(a -> b -> c)
-> TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m c
forall (f :: Type -> Type).
Functor f =>
(forall a. a -> f a)
-> (forall a b. f (a -> b) -> f a -> f b)
-> (forall a b c. (a -> b -> c) -> f a -> f b -> f c)
-> (forall a b. f a -> f b -> f b)
-> (forall a b. f a -> f b -> f a)
-> Applicative f
$cpure :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
Monad m =>
a -> TangleT xs h m a
pure :: forall a. a -> TangleT xs h m a
$c<*> :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m (a -> b) -> TangleT xs h m a -> TangleT xs h m b
<*> :: forall a b.
TangleT xs h m (a -> b) -> TangleT xs h m a -> TangleT xs h m b
$cliftA2 :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b c.
Monad m =>
(a -> b -> c)
-> TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m c
liftA2 :: forall a b c.
(a -> b -> c)
-> TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m c
$c*> :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
*> :: forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
$c<* :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m a
<* :: forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m a
Applicative, Applicative (TangleT xs h m)
Applicative (TangleT xs h m) =>
(forall a b.
TangleT xs h m a -> (a -> TangleT xs h m b) -> TangleT xs h m b)
-> (forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b)
-> (forall a. a -> TangleT xs h m a)
-> Monad (TangleT xs h m)
forall a. a -> TangleT xs h m a
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type).
Monad m =>
Applicative (TangleT xs h m)
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
Monad m =>
a -> TangleT xs h m a
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> (a -> TangleT xs h m b) -> TangleT xs h m b
forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
forall a b.
TangleT xs h m a -> (a -> TangleT xs h m b) -> TangleT xs h m b
forall (m :: Type -> Type).
Applicative m =>
(forall a b. m a -> (a -> m b) -> m b)
-> (forall a b. m a -> m b -> m b)
-> (forall a. a -> m a)
-> Monad m
$c>>= :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> (a -> TangleT xs h m b) -> TangleT xs h m b
>>= :: forall a b.
TangleT xs h m a -> (a -> TangleT xs h m b) -> TangleT xs h m b
$c>> :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a b.
Monad m =>
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
>> :: forall a b.
TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m b
$creturn :: forall k (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
Monad m =>
a -> TangleT xs h m a
return :: forall a. a -> TangleT xs h m a
Monad)
instance MonadTrans (TangleT xs h) where
lift :: forall (m :: Type -> Type) a. Monad m => m a -> TangleT xs h m a
lift = RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
-> TangleT xs h m a
forall {k} (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
-> TangleT xs h m a
TangleT (RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
-> TangleT xs h m a)
-> (m a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a)
-> m a
-> TangleT xs h m a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. m a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
forall (m :: Type -> Type) a.
Monad m =>
m a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
forall (t :: (Type -> Type) -> Type -> Type) (m :: Type -> Type) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift
instance (Monad m, Semigroup a) => Semigroup (TangleT xs h m a) where
<> :: TangleT xs h m a -> TangleT xs h m a -> TangleT xs h m a
(<>) = (a -> a -> a)
-> TangleT xs h m a -> TangleT xs h m a -> TangleT xs h m a
forall a b c.
(a -> b -> c)
-> TangleT xs h m a -> TangleT xs h m b -> TangleT xs h m c
forall (f :: Type -> Type) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 a -> a -> a
forall a. Semigroup a => a -> a -> a
(<>)
instance (Monad m, Monoid a) => Monoid (TangleT xs h m a) where
mempty :: TangleT xs h m a
mempty = a -> TangleT xs h m a
forall a. a -> TangleT xs h m a
forall (f :: Type -> Type) a. Applicative f => a -> f a
pure a
forall a. Monoid a => a
mempty
mappend :: TangleT xs h m a -> TangleT xs h m a -> TangleT xs h m a
mappend = TangleT xs h m a -> TangleT xs h m a -> TangleT xs h m a
forall a. Semigroup a => a -> a -> a
(<>)
lasso :: forall k v m h xs. (Monad m, Lookup xs k v, Wrapper h)
=> Proxy k -> TangleT xs h m (Repr h (k ':> v))
lasso :: forall {k} {v} (k :: k) (v :: v) (m :: Type -> Type)
(h :: Assoc k v -> Type) (xs :: [Assoc k v]).
(Monad m, Lookup xs k v, Wrapper h) =>
Proxy k -> TangleT xs h m (Repr h (k ':> v))
lasso Proxy k
_ = Optic'
(->) (Const (Repr h (k ':> v))) (h (k ':> v)) (Repr h (k ':> v))
-> h (k ':> v) -> Repr h (k ':> v)
forall a s. Optic' (->) (Const a) s a -> s -> a
view Optic'
(->) (Const (Repr h (k ':> v))) (h (k ':> v)) (Repr h (k ':> v))
forall k (h :: k -> Type) (f :: Type -> Type)
(p :: Type -> Type -> Type) (v :: k).
(Wrapper h, Functor f, Profunctor p) =>
Optic' p f (h v) (Repr h v)
forall (f :: Type -> Type) (p :: Type -> Type -> Type)
(v :: Assoc k v).
(Functor f, Profunctor p) =>
Optic' p f (h v) (Repr h v)
_Wrapper (h (k ':> v) -> Repr h (k ':> v))
-> TangleT xs h m (h (k ':> v))
-> TangleT xs h m (Repr h (k ':> v))
forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
<$> Membership xs (k ':> v) -> TangleT xs h m (h (k ':> v))
forall {k} (m :: Type -> Type) (xs :: [k]) (x :: k)
(h :: k -> Type).
Monad m =>
Membership xs x -> TangleT xs h m (h x)
hitchAt (Membership xs (k ':> v)
forall {k} {v} (xs :: [Assoc k v]) (k1 :: k) (v1 :: v).
Lookup xs k1 v1 =>
Membership xs (k1 ':> v1)
association :: Membership xs (k ':> v))
{-# INLINE lasso #-}
hitchAt :: Monad m => Membership xs x -> TangleT xs h m (h x)
hitchAt :: forall {k} (m :: Type -> Type) (xs :: [k]) (x :: k)
(h :: k -> Type).
Monad m =>
Membership xs x -> TangleT xs h m (h x)
hitchAt Membership xs x
k = RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
-> TangleT xs h m (h x)
forall {k} (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
-> TangleT xs h m a
TangleT (RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
-> TangleT xs h m (h x))
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
-> TangleT xs h m (h x)
forall a b. (a -> b) -> a -> b
$ do
xs :& Nullable h
mem <- RWST
(xs :& Compose (TangleT xs h m) h)
()
(xs :& Nullable h)
m
(xs :& Nullable h)
forall w (m :: Type -> Type) r s.
(Monoid w, Monad m) =>
RWST r w s m s
get
case Nullable h x -> Maybe (h x)
forall {k} (h :: k -> Type) (x :: k). Nullable h x -> Maybe (h x)
getNullable (Nullable h x -> Maybe (h x)) -> Nullable h x -> Maybe (h x)
forall a b. (a -> b) -> a -> b
$ Membership xs x -> (xs :& Nullable h) -> Nullable h x
forall {k} (xs :: [k]) (x :: k) (h :: k -> Type).
Membership xs x -> (xs :& h) -> h x
hlookup Membership xs x
k xs :& Nullable h
mem of
Just h x
a -> h x
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
forall a.
a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
forall (m :: Type -> Type) a. Monad m => a -> m a
return h x
a
Maybe (h x)
Nothing -> do
xs :& Compose (TangleT xs h m) h
tangles <- RWST
(xs :& Compose (TangleT xs h m) h)
()
(xs :& Nullable h)
m
(xs :& Compose (TangleT xs h m) h)
forall w (m :: Type -> Type) r s.
(Monoid w, Monad m) =>
RWST r w s m r
ask
h x
a <- TangleT xs h m (h x)
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
forall {k} (xs :: [k]) (h :: k -> Type) (m :: Type -> Type) a.
TangleT xs h m a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
unTangleT (TangleT xs h m (h x)
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x))
-> TangleT xs h m (h x)
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
forall a b. (a -> b) -> a -> b
$ Compose (TangleT xs h m) h x -> TangleT xs h m (h x)
forall {k1} {k2} (f :: k1 -> Type) (g :: k2 -> k1) (a :: k2).
Compose f g a -> f (g a)
getCompose (Compose (TangleT xs h m) h x -> TangleT xs h m (h x))
-> Compose (TangleT xs h m) h x -> TangleT xs h m (h x)
forall a b. (a -> b) -> a -> b
$ Membership xs x
-> (xs :& Compose (TangleT xs h m) h)
-> Compose (TangleT xs h m) h x
forall {k} (xs :: [k]) (x :: k) (h :: k -> Type).
Membership xs x -> (xs :& h) -> h x
hlookup Membership xs x
k xs :& Compose (TangleT xs h m) h
tangles
((xs :& Nullable h) -> xs :& Nullable h)
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m ()
forall w (m :: Type -> Type) s r.
(Monoid w, Monad m) =>
(s -> s) -> RWST r w s m ()
modify (((xs :& Nullable h) -> xs :& Nullable h)
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m ())
-> ((xs :& Nullable h) -> xs :& Nullable h)
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m ()
forall a b. (a -> b) -> a -> b
$ Optic
(->)
Identity
(xs :& Nullable h)
(xs :& Nullable h)
(Nullable h x)
(Nullable h x)
-> (Nullable h x -> Nullable h x)
-> (xs :& Nullable h)
-> xs :& Nullable h
forall s t a b. Optic (->) Identity s t a b -> (a -> b) -> s -> t
over (Membership xs x
-> Optic
(->)
Identity
(xs :& Nullable h)
(xs :& Nullable h)
(Nullable h x)
(Nullable h x)
forall (xs :: [k]) (h :: k -> Type) (x :: k).
ExtensibleConstr (:&) xs h x =>
Membership xs x -> Optic' (->) Identity (xs :& h) (h x)
forall k (f :: Type -> Type) (p :: Type -> Type -> Type)
(t :: [k] -> (k -> Type) -> Type) (xs :: [k]) (h :: k -> Type)
(x :: k).
(Extensible f p t, ExtensibleConstr t xs h x) =>
Membership xs x -> Optic' p f (t xs h) (h x)
pieceAt Membership xs x
k) ((Nullable h x -> Nullable h x)
-> (xs :& Nullable h) -> xs :& Nullable h)
-> (Nullable h x -> Nullable h x)
-> (xs :& Nullable h)
-> xs :& Nullable h
forall a b. (a -> b) -> a -> b
$ Nullable h x -> Nullable h x -> Nullable h x
forall a b. a -> b -> a
const (Nullable h x -> Nullable h x -> Nullable h x)
-> Nullable h x -> Nullable h x -> Nullable h x
forall a b. (a -> b) -> a -> b
$ Maybe (h x) -> Nullable h x
forall {k} (h :: k -> Type) (x :: k). Maybe (h x) -> Nullable h x
Nullable (Maybe (h x) -> Nullable h x) -> Maybe (h x) -> Nullable h x
forall a b. (a -> b) -> a -> b
$ h x -> Maybe (h x)
forall a. a -> Maybe a
Just h x
a
h x
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m (h x)
forall a.
a
-> RWST
(xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
forall (m :: Type -> Type) a. Monad m => a -> m a
return h x
a
runTangleT :: Monad m
=> xs :& Compose (TangleT xs h m) h
-> xs :& Nullable h
-> TangleT xs h m a
-> m (a, xs :& Nullable h)
runTangleT :: forall {k} (m :: Type -> Type) (xs :: [k]) (h :: k -> Type) a.
Monad m =>
(xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h)
-> TangleT xs h m a
-> m (a, xs :& Nullable h)
runTangleT xs :& Compose (TangleT xs h m) h
tangles xs :& Nullable h
rec0 (TangleT RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
m) = (\(a
a, xs :& Nullable h
s, ()
_) -> (a
a, xs :& Nullable h
s))
((a, xs :& Nullable h, ()) -> (a, xs :& Nullable h))
-> m (a, xs :& Nullable h, ()) -> m (a, xs :& Nullable h)
forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
<$> RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
-> (xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h)
-> m (a, xs :& Nullable h, ())
forall r w s (m :: Type -> Type) a.
RWST r w s m a -> r -> s -> m (a, s, w)
runRWST RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
m xs :& Compose (TangleT xs h m) h
tangles xs :& Nullable h
rec0
{-# INLINE runTangleT #-}
evalTangleT :: Monad m
=> xs :& Compose (TangleT xs h m) h
-> xs :& Nullable h
-> TangleT xs h m a
-> m a
evalTangleT :: forall {k} (m :: Type -> Type) (xs :: [k]) (h :: k -> Type) a.
Monad m =>
(xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h) -> TangleT xs h m a -> m a
evalTangleT xs :& Compose (TangleT xs h m) h
tangles xs :& Nullable h
rec0 (TangleT RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
m) = (a, ()) -> a
forall a b. (a, b) -> a
fst ((a, ()) -> a) -> m (a, ()) -> m a
forall (f :: Type -> Type) a b. Functor f => (a -> b) -> f a -> f b
<$> RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
-> (xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h)
-> m (a, ())
forall (m :: Type -> Type) r w s a.
Monad m =>
RWST r w s m a -> r -> s -> m (a, w)
evalRWST RWST (xs :& Compose (TangleT xs h m) h) () (xs :& Nullable h) m a
m xs :& Compose (TangleT xs h m) h
tangles xs :& Nullable h
rec0
{-# INLINE evalTangleT #-}
runTangles :: Monad m
=> xs :& Compose (TangleT xs h m) h
-> xs :& Nullable h
-> m (xs :& h)
runTangles :: forall {k} (m :: Type -> Type) (xs :: [k]) (h :: k -> Type).
Monad m =>
(xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h) -> m (xs :& h)
runTangles xs :& Compose (TangleT xs h m) h
ts xs :& Nullable h
vs = (xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h) -> TangleT xs h m (xs :& h) -> m (xs :& h)
forall {k} (m :: Type -> Type) (xs :: [k]) (h :: k -> Type) a.
Monad m =>
(xs :& Compose (TangleT xs h m) h)
-> (xs :& Nullable h) -> TangleT xs h m a -> m a
evalTangleT xs :& Compose (TangleT xs h m) h
ts xs :& Nullable h
vs (TangleT xs h m (xs :& h) -> m (xs :& h))
-> TangleT xs h m (xs :& h) -> m (xs :& h)
forall a b. (a -> b) -> a -> b
$ (forall (x :: k).
Membership xs x -> Nullable h x -> TangleT xs h m (h x))
-> (xs :& Nullable h) -> TangleT xs h m (xs :& h)
forall {k} (f :: Type -> Type) (xs :: [k]) (g :: k -> Type)
(h :: k -> Type).
Applicative f =>
(forall (x :: k). Membership xs x -> g x -> f (h x))
-> (xs :& g) -> f (xs :& h)
htraverseWithIndex (TangleT xs h m (h x) -> Nullable h x -> TangleT xs h m (h x)
forall a b. a -> b -> a
const (TangleT xs h m (h x) -> Nullable h x -> TangleT xs h m (h x))
-> (Membership xs x -> TangleT xs h m (h x))
-> Membership xs x
-> Nullable h x
-> TangleT xs h m (h x)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Membership xs x -> TangleT xs h m (h x)
forall {k} (m :: Type -> Type) (xs :: [k]) (x :: k)
(h :: k -> Type).
Monad m =>
Membership xs x -> TangleT xs h m (h x)
hitchAt) xs :& Nullable h
vs
{-# INLINE runTangles #-}