cleff-0.2.0.0: Fast and concise extensible effects
Copyright(c) 2021 Xy Ren
LicenseBSD3
Maintainerxy.r@outlook.com
Stabilityexperimental
Portabilitynon-portable (GHC only)
Safe HaskellTrustworthy
LanguageHaskell2010

Cleff.Fresh

Description

 
Synopsis

Effect

data Fresh u :: Effect where Source #

An effect capable of generating unique values. This effect can be useful in generating variable indices.

Constructors

Fresh :: Fresh u m u 

Operations

fresh :: Fresh u :> es => Eff es u Source #

Interpretations

freshIntToState :: Eff (Fresh Int ': es) ~> Eff (State Int ': es) Source #

Interpret a Fresh Int effect in terms of State Int.

runFreshUnique :: IOE :> es => Eff (Fresh Unique ': es) ~> Eff es Source #

Interpret a Fresh Unique effect in terms of IO actions.