mirror of
https://github.com/github/semantic.git
synced 2024-12-22 06:11:49 +03:00
📝 the Fresh constructors.
This commit is contained in:
parent
32215499f0
commit
434dd829b3
@ -8,8 +8,8 @@ type TName = Int
|
||||
|
||||
-- | An effect offering a (resettable) sequence of always-incrementing, and therefore “fresh,” type variables.
|
||||
data Fresh a where
|
||||
Reset :: TName -> Fresh ()
|
||||
Fresh :: Fresh TName
|
||||
Reset :: TName -> Fresh () -- ^ Reset the sequence of variable names. Useful to avoid complicated alpha-equivalence comparisons when iteratively recomputing the results of an analysis til convergence.
|
||||
Fresh :: Fresh TName -- ^ Get a fresh variable name, guaranteed unused since the last reset.
|
||||
|
||||
class Monad m => MonadFresh m where
|
||||
fresh :: m TName
|
||||
|
Loading…
Reference in New Issue
Block a user