monadic-bang-0.2.2.2: GHC plugin to desugar ! into do-notation
Safe HaskellSafe-Inferred
LanguageGHC2021

MonadicBang.Internal.Effect.Uniques

Synopsis

Documentation

data Uniques m a where Source #

Uniques provides arbitrarily many unique GHC Uniques

Constructors

FreshUnique :: Uniques m Unique 

Instances

Instances details
Algebra sig m => Algebra ((Uniques :: (Type -> Type) -> Type -> Type) :+: sig) (UniquesC m) Source # 
Instance details

Defined in MonadicBang.Internal.Effect.Uniques

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (UniquesC m) -> (Uniques :+: sig) n a -> ctx () -> UniquesC m (ctx a) #

newtype UniquesC m a Source #

Constructors

UniquesC 

Instances

Instances details
Monad m => Applicative (UniquesC m) Source # 
Instance details

Defined in MonadicBang.Internal.Effect.Uniques

Methods

pure :: a -> UniquesC m a #

(<*>) :: UniquesC m (a -> b) -> UniquesC m a -> UniquesC m b #

liftA2 :: (a -> b -> c) -> UniquesC m a -> UniquesC m b -> UniquesC m c #

(*>) :: UniquesC m a -> UniquesC m b -> UniquesC m b #

(<*) :: UniquesC m a -> UniquesC m b -> UniquesC m a #

Functor m => Functor (UniquesC m) Source # 
Instance details

Defined in MonadicBang.Internal.Effect.Uniques

Methods

fmap :: (a -> b) -> UniquesC m a -> UniquesC m b #

(<$) :: a -> UniquesC m b -> UniquesC m a #

Monad m => Monad (UniquesC m) Source # 
Instance details

Defined in MonadicBang.Internal.Effect.Uniques

Methods

(>>=) :: UniquesC m a -> (a -> UniquesC m b) -> UniquesC m b #

(>>) :: UniquesC m a -> UniquesC m b -> UniquesC m b #

return :: a -> UniquesC m a #

Algebra sig m => Algebra ((Uniques :: (Type -> Type) -> Type -> Type) :+: sig) (UniquesC m) Source # 
Instance details

Defined in MonadicBang.Internal.Effect.Uniques

Methods

alg :: forall ctx (n :: Type -> Type) a. Functor ctx => Handler ctx n (UniquesC m) -> (Uniques :+: sig) n a -> ctx () -> UniquesC m (ctx a) #

runUniquesIO :: MonadIO m => Char -> UniquesC m a -> m a Source #

The "mask" (Char) supplied is purely cosmetic, making it easier to figure out where a Unique was born.

See Note [Uniques for wired-in prelude things and known masks] in GHC.Builtin.Uniques