From 434dd829b3d87b257d86308752a892df66f1017f Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Thu, 21 Dec 2017 10:54:40 -0500 Subject: [PATCH] :memo: the Fresh constructors. --- src/Control/Monad/Effect/Fresh.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Control/Monad/Effect/Fresh.hs b/src/Control/Monad/Effect/Fresh.hs index 051a57177..65542e2c8 100644 --- a/src/Control/Monad/Effect/Fresh.hs +++ b/src/Control/Monad/Effect/Fresh.hs @@ -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