From 0f94ac819d664b0c1f8feaf567648a3724b5eadb Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Fri, 6 Sep 2024 10:55:12 +0200 Subject: Named source language --- src/Language/Tag.hs | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 src/Language/Tag.hs (limited to 'src/Language/Tag.hs') diff --git a/src/Language/Tag.hs b/src/Language/Tag.hs deleted file mode 100644 index 9356073..0000000 --- a/src/Language/Tag.hs +++ /dev/null @@ -1,22 +0,0 @@ -{-# LANGUAGE BangPatterns #-} -module Language.Tag ( - Tag(..), genTag, -) where - -import Data.IORef -import System.IO.Unsafe - -import AST - - -data Tag t = Tag (STy t) Int - deriving (Show) - -{-# NOINLINE tagCounter #-} -tagCounter :: IORef Int -tagCounter = unsafePerformIO $ newIORef 1 - -{-# NOINLINE genTag #-} -genTag :: handle -> STy t -> Tag t -genTag !_ ty = - unsafePerformIO $ Tag ty <$> atomicModifyIORef' tagCounter (\i -> (succ i, i)) -- cgit v1.2.3-70-g09d2