| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Borrow.Pure.BO.Unsafe
Description
This module provides unsafe internals of Control.Monad.Borrow.Pure. These are not meant to be used by end-users, so generally YOU SHOULD NOT import this module, and import Control.Monad.Borrow.Pure instead.
This module is meant for library authors who want to build a new API on top of Pure Borrow.
This module provides internals of BO and Alias, which can break the soundness guarded by the role system.
We STRONGLY recommend to you to import only the needed parts of the definitions, and not to import everything or qualified.
Synopsis
- newtype BO (α :: Lifetime) a = BO (State# (ForBO α) %1 -> (# State# (ForBO α), a #))
- newtype Alias (ak :: AliasKind) (α :: Lifetime) a = UnsafeAlias a
- unsafeUnalias :: forall (ak :: AliasKind) (α :: Lifetime) a. Alias ak α a %1 -> a
- unsafeMapAlias :: forall a b (ak :: AliasKind) (α :: Lifetime). (a %1 -> b) %1 -> Alias ak α a %1 -> Alias ak α b
- unsafeBOToLinIO :: forall (α :: Lifetime) a. BO α a %1 -> IO a
- unsafeLinIOToBO :: forall a (α :: Lifetime). IO a %1 -> BO α a
- unsafeBOToSystemIO :: forall (α :: Lifetime) a. BO α a %1 -> IO a
- unsafeSystemIOToBO :: forall a (α :: Lifetime). IO a %1 -> BO α a
- unsafeSTToBO :: forall s a (α :: Lifetime). ST s a %1 -> BO α a
- unsafeBOToST :: forall (α :: Lifetime) a s. BO α a %1 -> ST s a
- unsafeUnBO :: forall (α :: Lifetime) a. BO α a %1 -> State# (ForBO α) %1 -> (# State# (ForBO α), a #)
Internal definitions and utilities of core types.
newtype BO (α :: Lifetime) a Source #
Computation returning a that can be performed only during the lifetime α.
Internally it is a linear ST monad.
Instances
| (α >= β, a <: b) => (BO α a :: Type) <: (BO β b :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| Applicative (BO α) Source # | |
| Functor (BO α) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| Monad (BO α) Source # | |
| Applicative (BO α) Source # | |
| Functor (BO α) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| Monoid w => Monoid (BO α w) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| Semigroup w => Semigroup (BO α w) Source # | |
newtype Alias (ak :: AliasKind) (α :: Lifetime) a Source #
Alias of kind ak to a resource of type a.
Constructors
| UnsafeAlias a |
Instances
| Reborrowable Mut Source # | |
| Reborrowable Share Source # | |
| (α <= β, a <: b) => (Lend α a :: Type) <: (Lend β b :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| (α >= β, a <: b, b <: a) => (Mut α a :: Type) <: (Mut β b :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| (α >= β, a <: b) => (Share α a :: Type) <: (Share β b :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| bk ~ 'Mut => LinearOnly (Borrow bk α a :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal Methods linearOnly :: LinearOnlyWitness (Borrow bk α a) Source # | |
| Consumable (Borrow bk α a) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal | |
| k ~ 'Borrow 'Share => Dupable (Alias k α a) Source # | |
| k ~ 'Borrow 'Share => Movable (Alias k α a) Source # | |
| Affine (Borrow bk α a) Source # | |
unsafeMapAlias :: forall a b (ak :: AliasKind) (α :: Lifetime). (a %1 -> b) %1 -> Alias ak α a %1 -> Alias ak α b Source #