{-# LANGUAGE AllowAmbiguousTypes #-}
{-# HLINT ignore "Use const" #-}
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
module Data.Effect.Provider.Implicit where
data ImplicitProvider' c i e (f :: Type -> Type) (a :: Type) where
WithImplicit ::
i ->
(forall g. (c g, e g) => (forall x. f x -> g x) -> g a) ->
ImplicitProvider' c i e f a
makeKeyedEffect [] [''ImplicitProvider']
type MonadImplicitProvider i e = ImplicitProvider Monad i e
type ApplicativeImplicitProvider i e = ImplicitProvider Applicative i e
(.!) ::
forall c e i f a.
SendSigBy ImplicitProviderKey (ImplicitProvider' c i e) f =>
i ->
(forall g. (c g, e g) => g a) ->
f a
i
i .! :: forall (c :: (* -> *) -> Constraint) (e :: (* -> *) -> Constraint)
i (f :: * -> *) a.
SendSigBy ImplicitProviderKey (ImplicitProvider' c i e) f =>
i -> (forall (g :: * -> *). (c g, e g) => g a) -> f a
.! forall (g :: * -> *). (c g, e g) => g a
m = forall i (c :: (* -> *) -> Constraint)
(e :: (* -> *) -> Constraint) a (f :: * -> *).
SendSigBy ImplicitProviderKey (ImplicitProvider' c i e) f =>
i
-> (forall (g :: * -> *).
(c g, e g) =>
(forall x. f x -> g x) -> g a)
-> f a
withImplicit i
i \forall x. f x -> g x
_ -> forall (g :: * -> *). (c g, e g) => g a
m
{-# INLINE (.!) #-}
(..!) ::
forall c e i f a.
SendSigBy ImplicitProviderKey (ImplicitProvider' c i e) f =>
i ->
(forall g. (c g, e g) => f ~> g -> g a) ->
f a
i
i ..! :: forall (c :: (* -> *) -> Constraint) (e :: (* -> *) -> Constraint)
i (f :: * -> *) a.
SendSigBy ImplicitProviderKey (ImplicitProvider' c i e) f =>
i -> (forall (g :: * -> *). (c g, e g) => (f ~> g) -> g a) -> f a
..! forall (g :: * -> *). (c g, e g) => (f ~> g) -> g a
f = forall i (c :: (* -> *) -> Constraint)
(e :: (* -> *) -> Constraint) a (f :: * -> *).
SendSigBy ImplicitProviderKey (ImplicitProvider' c i e) f =>
i
-> (forall (g :: * -> *).
(c g, e g) =>
(forall x. f x -> g x) -> g a)
-> f a
withImplicit i
i forall (g :: * -> *). (c g, e g) => (f ~> g) -> g a
f
{-# INLINE (..!) #-}