pure-borrow
Safe HaskellNone
LanguageGHC2021

Control.Monad.Borrow.Pure.Experimental.Reborrowable

Documentation

class Reborrowable (bor :: Lifetime -> k -> Type) where Source #

Methods

locally' :: forall (α :: Lifetime) (a :: k) (α' :: Lifetime) r. bor α a %1 -> (forall (β :: Lifetime). bor (β /\ α) a %1 -> BO/\ α') (After β r)) %1 -> BO α' (r, bor α a) Source #

Executes an operation on a borrow in sub lifetime. You may need -XImpredicativeTypes extension to use this function.

Generalization of reborrowing' and sharing' that works for both Mut and Share borrows.

Instances

Instances details
Reborrowable Mut Source # 
Instance details

Defined in Control.Monad.Borrow.Pure.Experimental.Reborrowable

Methods

locally' :: forall (α :: Lifetime) a (α' :: Lifetime) r. Mut α a %1 -> (forall (β :: Lifetime). Mut/\ α) a %1 -> BO/\ α') (After β r)) %1 -> BO α' (r, Mut α a) Source #

Reborrowable Share Source # 
Instance details

Defined in Control.Monad.Borrow.Pure.Experimental.Reborrowable

Methods

locally' :: forall (α :: Lifetime) a (α' :: Lifetime) r. Share α a %1 -> (forall (β :: Lifetime). Share/\ α) a %1 -> BO/\ α') (After β r)) %1 -> BO α' (r, Share α a) Source #

Reborrowable (Borrows bk :: Lifetime -> [Type] -> Type) Source # 
Instance details

Defined in Control.Monad.Borrow.Pure.Experimental.Borrows

Methods

locally' :: forall (α :: Lifetime) (a :: [Type]) (α' :: Lifetime) r. Borrows bk α a %1 -> (forall (β :: Lifetime). Borrows bk (β /\ α) a %1 -> BO/\ α') (After β r)) %1 -> BO α' (r, Borrows bk α a) Source #

locally :: forall {k} bor (α :: Lifetime) (a :: k) (α' :: Lifetime) r. Reborrowable bor => bor α a %1 -> (forall (β :: Lifetime). bor (β /\ α) a %1 -> BO/\ α') r) %1 -> BO α' (r, bor α a) Source #

locally_ :: forall {k} bor r (α :: Lifetime) (a :: k) (α' :: Lifetime). (Reborrowable bor, Consumable r) => bor α a %1 -> (forall (β :: Lifetime). bor (β /\ α) a %1 -> BO/\ α') r) %1 -> BO α' (bor α a) Source #