| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Control.Monad.Borrow.Pure.Lifetime.Token
Synopsis
- data Linearly
- linearly :: Movable a => (Linearly %1 -> a) %1 -> a
- data Now (α :: Lifetime)
- class End (α :: Lifetime)
- data EndToken (α :: Lifetime)
- newtype After (α :: Lifetime) a = After (End α => a)
- unAfter :: forall (α :: Lifetime) a. End α => After α a %1 -> a
- withEnd :: forall (α :: Lifetime) r. EndToken α -> After α r %1 -> r
- class LinearOnly (a :: TYPE rep)
- withLinearly :: LinearOnly a => a %1 -> (Linearly, a)
- withLinearly# :: forall (a :: UnliftedType). LinearOnly a => a %1 -> (# Linearly, a #)
- endLifetime :: forall (i :: Nat). Now (Al i) %1 -> Ur (EndToken (Al i))
- data SomeNow where
- newLifetime :: Linearly %1 -> SomeNow
- newLifetime' :: Linearly %1 -> (forall (ι :: Nat). Now (Al ι) %1 -> a) %1 -> a
- nowStatic :: Now Static
- neverEnds :: (HasCallStack, End Static) => a
Documentation
Witness that the current computation is in a linear context.
Instances
| Consumable Linearly Source # | |
| Dupable Linearly Source # | |
| LinearOnly Linearly Source # | |
Defined in Control.Monad.Borrow.Pure.Lifetime.Token.Internal Methods | |
data Now (α :: Lifetime) Source #
Witness that the lifetime α is ongoing.
Instances
| LinearOnly (Now α :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.Lifetime.Token.Internal Methods linearOnly :: LinearOnlyWitness (Now α) Source # | |
| Affine (Now α) Source # | |
newtype After (α :: Lifetime) a Source #
Utility type to represent an object available after the lifetime α.
You can use Applicative and Monad instances to write After conveniently.
Instances
| (α <= β, a <: b) => (After α a :: Type) <: (After β b :: Type) Source # | |
| Applicative (After α) Source # | |
| Functor (After α) Source # | |
| Monad (After α) Source # | |
| Applicative (After α) Source # | |
| Functor (After α) Source # | |
class LinearOnly (a :: TYPE rep) Source #
A (non-bottom) value of the type a can only live in a linear context.
Minimal complete definition
Instances
| LinearOnly Linearly Source # | |
Defined in Control.Monad.Borrow.Pure.Lifetime.Token.Internal Methods | |
| LinearOnly (Now α :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.Lifetime.Token.Internal Methods linearOnly :: LinearOnlyWitness (Now α) Source # | |
| LinearOnly (Ref a :: Type) Source # | |
Defined in Data.Ref.Linear Methods linearOnly :: LinearOnlyWitness (Ref a) Source # | |
| LinearOnly (Vector a :: Type) Source # | |
Defined in Data.Vector.Mutable.Linear.Borrow Methods linearOnly :: LinearOnlyWitness (Vector a) Source # | |
| LinearOnly (Ref# a :: UnliftedType) Source # | |
Defined in Data.Ref.Linear.Unlifted Methods linearOnly :: LinearOnlyWitness (Ref# a) Source # | |
| bk ~ 'Mut => LinearOnly (Borrow bk α a :: Type) Source # | |
Defined in Control.Monad.Borrow.Pure.BO.Internal Methods linearOnly :: LinearOnlyWitness (Borrow bk α a) Source # | |
withLinearly :: LinearOnly a => a %1 -> (Linearly, a) Source #
withLinearly# :: forall (a :: UnliftedType). LinearOnly a => a %1 -> (# Linearly, a #) Source #
newLifetime :: Linearly %1 -> SomeNow Source #