| Safe Haskell | Safe-Inferred |
|---|---|
| Language | Haskell2010 |
Bluefin.Internal.CloneableHandle
Synopsis
- class Handle h => CloneableHandle h where
- newtype (h1 :~> h2) es = MkArrow (forall e. h1 e -> h2 (e :& es))
- newtype HandleCloner h1 h2 es = MkHandleCloner (forall r. h1 es -> (forall e. h2 e -> Eff (e :& es) r) -> Eff es r)
- newtype GenericCloneableHandle h e = MkGenericCloneableHandle (h e)
- class Handle h => GCloneableHandle h where
- newtype CloneableHandleD h = MkCloneableHandleD (forall e. HandleCloner h h e)
- withEffToIOCloneHandle :: (e1 <: es, CloneableHandle h) => IOE e1 -> h es -> ((forall r. (forall e. IOE e -> h e -> Eff e r) -> IO r) -> IO a) -> Eff es a
- app :: Handle h2 => (h1 :~> h2) e -> h1 e -> h2 e
- cloneHandleClass :: (e1 <: es, CloneableHandle h) => h e1 -> (forall e. h e -> Eff (e :& es) r) -> Eff es r
- cloneHandle2 :: (Handle h1, Handle h2, e1 <: es) => HandleCloner h1 h2 es -> h1 e1 -> (forall e. h2 e -> Eff (e :& es) r) -> Eff es r
- hcIOE :: HandleCloner IOE IOE e
- hcState :: HandleCloner (State s) (State s) e
- hcException :: HandleCloner (Exception ex) (Exception ex) e
- hcReader :: HandleCloner (Reader r) (Reader r) e
- hcHandleReader :: CloneableHandle h => HandleCloner (HandleReader h) (HandleReader h) e
- abstract :: Handle h2 => (forall e. h1 e -> h2 (e :& es)) -> (h1 :~> h2) es
- lmapHC :: (Handle h, Handle h2) => (h1 :~> h2) e -> HandleCloner h2 h e -> HandleCloner h1 h e
- pureHC :: h2 e -> HandleCloner h1 h2 e
- fmapHC :: (Handle h, Handle h1, Handle h2) => (h1 :~> h2) e -> HandleCloner h h1 e -> HandleCloner h h2 e
- apHC :: (Handle h, Handle h1, Handle h2) => HandleCloner h (h1 :~> h2) e -> HandleCloner h h1 e -> HandleCloner h h2 e
- liftHC2 :: forall h h1 h2 hr es. (Handle h, Handle h1, Handle h2) => (forall e. h1 e -> h2 e -> hr e) -> HandleCloner h h1 es -> HandleCloner h h2 es -> HandleCloner h hr es
- gCloneableHandle :: forall h. (Handle h, Generic1 h) => GCloneableHandle (Rep1 h) => CloneableHandleD h
- getHandleCloner :: GCloneableHandle h => HandleCloner h h e
- class MonadIO m => MonadUnliftIO (m :: Type -> Type) where
- withRunInIO :: ((forall a. m a -> IO a) -> IO b) -> m b
- class Monad m => MonadIO (m :: Type -> Type) where
- liftIO :: IO a -> m a
- class Generic1 (f :: k -> Type)
Documentation
class Handle h => CloneableHandle h where Source #
You can define a CloneableHandle instance for your Handle as
long as it is a product type of CloneableHandles. To define the
instance, use DerivingVia and GenericCloneableHandle. For
example:
data MyHandle e = MkMyHandle (ExceptionString e) (StateInt e) deriving (Generic,Generic1) deriving (Handle) viaOneWayCoercibleHandleMyHandle deriving (CloneableHandle) viaGenericCloneableHandleMyHandle instance (e<:es) =>OneWayCoercible(MyHandle e) (MyHandle es) whereoneWayCoercibleImpl=gOneWayCoercible
Instances
newtype (h1 :~> h2) es infixr 9 Source #
Instances
| (Handle h1, Handle h2, e <: es) => OneWayCoercible ((h1 :~> h2) e :: Type) ((h1 :~> h2) es :: Type) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods oneWayCoercibleImpl :: OneWayCoercibleD ((h1 :~> h2) e) ((h1 :~> h2) es) Source # | |
| (Handle h1, Handle h2) => Handle (h1 :~> h2) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods handleImpl :: HandleD (h1 :~> h2) Source # | |
newtype HandleCloner h1 h2 es Source #
Constructors
| MkHandleCloner (forall r. h1 es -> (forall e. h2 e -> Eff (e :& es) r) -> Eff es r) |
Instances
| (Handle h1, Handle h2) => OneWayCoercible (HandleCloner h1 h2 e :: Type) (HandleCloner h1 h2 es :: Type) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods oneWayCoercibleImpl :: OneWayCoercibleD (HandleCloner h1 h2 e) (HandleCloner h1 h2 es) Source # | |
| (Handle h1, Handle h2) => Handle (HandleCloner h1 h2) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods handleImpl :: HandleD (HandleCloner h1 h2) Source # | |
newtype GenericCloneableHandle h e Source #
You can use DerivingVia with GenericCloneableHandle to derive
a CloneableHandle instance for your type, as long as it is a
product type of CloneableHandles.
Constructors
| MkGenericCloneableHandle (h e) |
Instances
| (Handle h, e <: es) => OneWayCoercible (GenericCloneableHandle h e :: Type) (GenericCloneableHandle h es :: Type) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods oneWayCoercibleImpl :: OneWayCoercibleD (GenericCloneableHandle h e) (GenericCloneableHandle h es) Source # | |
| Handle h => Handle (GenericCloneableHandle h) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods | |
| (Handle h, Generic1 h, GCloneableHandle (Rep1 h)) => CloneableHandle (GenericCloneableHandle h) Source # | |
Defined in Bluefin.Internal.CloneableHandle Methods cloneableHandleImpl :: CloneableHandleD (GenericCloneableHandle h) Source # | |
class Handle h => GCloneableHandle h where Source #
Generic implementation detail of
GenericCloneableHandle. Bluefin users should never need to use
this directly.
Methods
Instances
| CloneableHandle h => GCloneableHandle (Rec1 h) Source # | A cloneable handle is generically cloneable |
Defined in Bluefin.Internal.CloneableHandle Methods gCloneableHandleImpl :: CloneableHandleD (Rec1 h) Source # | |
| (GCloneableHandle h1, GCloneableHandle h2) => GCloneableHandle (h1 :*: h2) Source # | A pair of cloneable handles is generically cloneable |
Defined in Bluefin.Internal.CloneableHandle Methods gCloneableHandleImpl :: CloneableHandleD (h1 :*: h2) Source # | |
| GCloneableHandle h => GCloneableHandle (M1 i t h) Source # | An annotated cloneable handle is generically cloneable |
Defined in Bluefin.Internal.CloneableHandle Methods gCloneableHandleImpl :: CloneableHandleD (M1 i t h) Source # | |
newtype CloneableHandleD h Source #
Constructors
| MkCloneableHandleD (forall e. HandleCloner h h e) |
cloneHandleClass :: (e1 <: es, CloneableHandle h) => h e1 -> (forall e. h e -> Eff (e :& es) r) -> Eff es r Source #
cloneHandle2 :: (Handle h1, Handle h2, e1 <: es) => HandleCloner h1 h2 es -> h1 e1 -> (forall e. h2 e -> Eff (e :& es) r) -> Eff es r Source #
hcException :: HandleCloner (Exception ex) (Exception ex) e Source #
hcHandleReader :: CloneableHandle h => HandleCloner (HandleReader h) (HandleReader h) e Source #
lmapHC :: (Handle h, Handle h2) => (h1 :~> h2) e -> HandleCloner h2 h e -> HandleCloner h1 h e Source #
pureHC :: h2 e -> HandleCloner h1 h2 e Source #
fmapHC :: (Handle h, Handle h1, Handle h2) => (h1 :~> h2) e -> HandleCloner h h1 e -> HandleCloner h h2 e Source #
apHC :: (Handle h, Handle h1, Handle h2) => HandleCloner h (h1 :~> h2) e -> HandleCloner h h1 e -> HandleCloner h h2 e infixl 9 Source #
liftHC2 :: forall h h1 h2 hr es. (Handle h, Handle h1, Handle h2) => (forall e. h1 e -> h2 e -> hr e) -> HandleCloner h h1 es -> HandleCloner h h2 es -> HandleCloner h hr es Source #
gCloneableHandle :: forall h. (Handle h, Generic1 h) => GCloneableHandle (Rep1 h) => CloneableHandleD h Source #
getHandleCloner :: GCloneableHandle h => HandleCloner h h e Source #
class MonadIO m => MonadUnliftIO (m :: Type -> Type) where #
Methods
withRunInIO :: ((forall a. m a -> IO a) -> IO b) -> m b #
Instances
| MonadUnliftIO IO | |
Defined in Control.Monad.IO.Unlift Methods withRunInIO :: ((forall a. IO a -> IO a) -> IO b) -> IO b # | |
| e <: es => MonadUnliftIO (EffReader (IOE e) es) Source # | You probably want to use |
Defined in Bluefin.Internal | |
| MonadUnliftIO m => MonadUnliftIO (IdentityT m) | |
Defined in Control.Monad.IO.Unlift Methods withRunInIO :: ((forall a. IdentityT m a -> IO a) -> IO b) -> IdentityT m b # | |
| MonadUnliftIO m => MonadUnliftIO (ReaderT r m) | |
Defined in Control.Monad.IO.Unlift Methods withRunInIO :: ((forall a. ReaderT r m a -> IO a) -> IO b) -> ReaderT r m b # | |
class Monad m => MonadIO (m :: Type -> Type) where #
Instances
class Generic1 (f :: k -> Type) #
Minimal complete definition
from1, to1
Instances
| Generic1 ZipList | |
Defined in Control.Applicative Associated Types type Rep1 ZipList :: k -> Type | |
| Generic1 Complex | |
Defined in Data.Complex Associated Types type Rep1 Complex :: k -> Type | |
| Generic1 Identity | |
Defined in Data.Functor.Identity Associated Types type Rep1 Identity :: k -> Type | |
| Generic1 First | |
Defined in Data.Monoid Associated Types type Rep1 First :: k -> Type | |
| Generic1 Last | |
Defined in Data.Monoid Associated Types type Rep1 Last :: k -> Type | |
| Generic1 Down | |
Defined in GHC.Generics Associated Types type Rep1 Down :: k -> Type | |
| Generic1 First | |
Defined in Data.Semigroup Associated Types type Rep1 First :: k -> Type | |
| Generic1 Last | |
Defined in Data.Semigroup Associated Types type Rep1 Last :: k -> Type | |
| Generic1 Max | |
Defined in Data.Semigroup Associated Types type Rep1 Max :: k -> Type | |
| Generic1 Min | |
Defined in Data.Semigroup Associated Types type Rep1 Min :: k -> Type | |
| Generic1 WrappedMonoid | |
Defined in Data.Semigroup Associated Types type Rep1 WrappedMonoid :: k -> Type | |
| Generic1 Dual | |
Defined in Data.Semigroup.Internal Associated Types type Rep1 Dual :: k -> Type | |
| Generic1 Product | |
Defined in Data.Semigroup.Internal Associated Types type Rep1 Product :: k -> Type | |
| Generic1 Sum | |
Defined in Data.Semigroup.Internal Associated Types type Rep1 Sum :: k -> Type | |
| Generic1 NonEmpty | |
Defined in GHC.Generics Associated Types type Rep1 NonEmpty :: k -> Type | |
| Generic1 Par1 | |
Defined in GHC.Generics Associated Types type Rep1 Par1 :: k -> Type | |
| Generic1 Digit | |
Defined in Data.Sequence.Internal Associated Types type Rep1 Digit :: k -> Type | |
| Generic1 Elem | |
Defined in Data.Sequence.Internal Associated Types type Rep1 Elem :: k -> Type | |
| Generic1 FingerTree | |
Defined in Data.Sequence.Internal Associated Types type Rep1 FingerTree :: k -> Type | |
| Generic1 Node | |
Defined in Data.Sequence.Internal Associated Types type Rep1 Node :: k -> Type | |
| Generic1 ViewL | |
Defined in Data.Sequence.Internal Associated Types type Rep1 ViewL :: k -> Type | |
| Generic1 ViewR | |
Defined in Data.Sequence.Internal Associated Types type Rep1 ViewR :: k -> Type | |
| Generic1 Tree | |
| Generic1 Maybe | |
Defined in GHC.Generics Associated Types type Rep1 Maybe :: k -> Type | |
| Generic1 Solo | |
Defined in GHC.Generics Associated Types type Rep1 Solo :: k -> Type | |
| Generic1 List | |
Defined in GHC.Generics Associated Types type Rep1 List :: k -> Type | |
| Generic1 (WrappedMonad m :: Type -> Type) | |
Defined in Control.Applicative Associated Types type Rep1 (WrappedMonad m) :: k -> Type | |
| Generic1 (Either a :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (Either a) :: k -> Type | |
| Generic1 (Arg a :: Type -> Type) | |
Defined in Data.Semigroup Associated Types type Rep1 (Arg a) :: k -> Type | |
| Functor m => Generic1 (MaybeT m :: Type -> Type) | |
Defined in Control.Monad.Trans.Maybe Associated Types type Rep1 (MaybeT m) :: k -> Type | |
| Generic1 ((,) a :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,) a) :: k -> Type | |
| Generic1 (Proxy :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 Proxy :: k -> Type | |
| Generic1 (U1 :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 U1 :: k -> Type | |
| Generic1 (V1 :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 V1 :: k -> Type | |
| Generic1 (WrappedArrow a b :: Type -> Type) | |
Defined in Control.Applicative Associated Types type Rep1 (WrappedArrow a b) :: k -> Type | |
| Generic1 (Kleisli m a :: Type -> Type) | |
Defined in Control.Arrow Associated Types type Rep1 (Kleisli m a) :: k -> Type | |
| Functor m => Generic1 (ExceptT e m :: Type -> Type) | |
Defined in Control.Monad.Trans.Except Associated Types type Rep1 (ExceptT e m) :: k -> Type | |
| Generic1 (ReaderT r m :: Type -> Type) | |
Defined in Control.Monad.Trans.Reader Associated Types type Rep1 (ReaderT r m) :: k -> Type | |
| Generic1 ((,,) a b :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,) a b) :: k -> Type | |
| Generic1 (Const a :: k -> Type) | |
Defined in Data.Functor.Const Associated Types type Rep1 (Const a) :: k -> Type | |
| Generic1 (Ap f :: k -> Type) | |
Defined in Data.Monoid Associated Types type Rep1 (Ap f) :: k -> Type | |
| Generic1 (Alt f :: k -> Type) | |
Defined in Data.Semigroup.Internal Associated Types type Rep1 (Alt f) :: k -> Type | |
| Generic1 (Rec1 f :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (Rec1 f) :: k -> Type | |
| Generic1 (URec (Ptr ()) :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (URec (Ptr ())) :: k -> Type | |
| Generic1 (URec Char :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (URec Char) :: k -> Type | |
| Generic1 (URec Double :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (URec Double) :: k -> Type | |
| Generic1 (URec Float :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (URec Float) :: k -> Type | |
| Generic1 (URec Int :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (URec Int) :: k -> Type | |
| Generic1 (URec Word :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (URec Word) :: k -> Type | |
| Generic1 (IdentityT f :: k -> Type) | |
Defined in Control.Monad.Trans.Identity Associated Types type Rep1 (IdentityT f) :: k -> Type | |
| Generic1 ((,,,) a b c :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,) a b c) :: k -> Type | |
| Generic1 (Product f g :: k -> Type) | |
Defined in Data.Functor.Product Associated Types type Rep1 (Product f g) :: k -> Type | |
| Generic1 (Sum f g :: k -> Type) | |
Defined in Data.Functor.Sum Associated Types type Rep1 (Sum f g) :: k -> Type | |
| Generic1 (f :*: g :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (f :*: g) :: k -> Type | |
| Generic1 (f :+: g :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (f :+: g) :: k -> Type | |
| Generic1 (K1 i c :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (K1 i c) :: k -> Type | |
| Generic1 ((,,,,) a b c d :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,) a b c d) :: k -> Type | |
| Functor f => Generic1 (Compose f g :: k -> Type) | |
Defined in Data.Functor.Compose Associated Types type Rep1 (Compose f g) :: k -> Type | |
| Functor f => Generic1 (f :.: g :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (f :.: g) :: k -> Type | |
| Generic1 (M1 i c f :: k -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 (M1 i c f) :: k -> Type | |
| Generic1 ((,,,,,) a b c d e :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,) a b c d e) :: k -> Type | |
| Generic1 ((,,,,,,) a b c d e f :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,) a b c d e f) :: k -> Type | |
| Generic1 ((,,,,,,,) a b c d e f g :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,) a b c d e f g) :: k -> Type | |
| Generic1 ((,,,,,,,,) a b c d e f g h :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,) a b c d e f g h) :: k -> Type | |
| Generic1 ((,,,,,,,,,) a b c d e f g h i :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,,) a b c d e f g h i) :: k -> Type | |
| Generic1 ((,,,,,,,,,,) a b c d e f g h i j :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,,,) a b c d e f g h i j) :: k -> Type | |
| Generic1 ((,,,,,,,,,,,) a b c d e f g h i j k :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,,,,) a b c d e f g h i j k) :: k -> Type | |
| Generic1 ((,,,,,,,,,,,,) a b c d e f g h i j k l :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,,,,,) a b c d e f g h i j k l) :: k -> Type | |
| Generic1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m) :: k -> Type | |
| Generic1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n :: Type -> Type) | |
Defined in GHC.Generics Associated Types type Rep1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n) :: k -> Type | |