diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-09-06 10:55:12 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-09-06 10:55:46 +0200 |
commit | 0f94ac819d664b0c1f8feaf567648a3724b5eadb (patch) | |
tree | f4595bc2770b7c7423fe01e23a3d6842f580ce0b /src/Language/Tag.hs | |
parent | 393592e7c180415c8e4c45523c0cf0904fa7b7c1 (diff) |
Named source language
Diffstat (limited to 'src/Language/Tag.hs')
-rw-r--r-- | src/Language/Tag.hs | 22 |
1 files changed, 0 insertions, 22 deletions
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)) |