aboutsummaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorTom Smeding <tom.smeding@gmail.com>2020-07-24 18:34:28 +0200
committerTom Smeding <tom.smeding@gmail.com>2020-07-24 19:02:21 +0200
commit5cb19c0df3f838965c1100731f9118f28f50796f (patch)
tree89a2cbfeed5de5f9a26238321610c3fd58e533b9 /utils
parenta9134688a2132c8f9abfff206f6e30614bb9aeff (diff)
Working basic type checker using Algorithm W
Diffstat (limited to 'utils')
-rw-r--r--utils/CC/IdSupply.hs29
1 files changed, 0 insertions, 29 deletions
diff --git a/utils/CC/IdSupply.hs b/utils/CC/IdSupply.hs
deleted file mode 100644
index 234f6cc..0000000
--- a/utils/CC/IdSupply.hs
+++ /dev/null
@@ -1,29 +0,0 @@
-module CC.IdSupply(IdSupply, runIdSupply, genId) where
-
-import Control.Monad.Trans
-
-
-data IdSupply a = IdSupply (Int -> (Int, a))
-
-instance Functor IdSupply where
- fmap f (IdSupply act) = IdSupply (fmap f . act)
-
-instance Applicative IdSupply where
- pure x = IdSupply (\idval -> (idval, x))
- IdSupply f <*> IdSupply x =
- IdSupply (\idval -> let (idval', f') = f idval
- in f' <$> x idval')
-
-instance Monad IdSupply where
- IdSupply x >>= f =
- IdSupply (\idval -> let (idval', x') = x idval
- IdSupply res = f x'
- in res idval')
-
-instance MonadTrans
-
-runIdSupply :: Int -> IdSupply a -> a
-runIdSupply startid (IdSupply f) = snd (f startid)
-
-genId :: IdSupply Int
-genId = IdSupply (\idval -> (idval + 1, idval))