From 2f07d890433bebedc136037ad9cce2eed25b0437 Mon Sep 17 00:00:00 2001 From: Mirek Kratochvil Date: Wed, 14 Dec 2022 22:56:47 +0100 Subject: 10h vacuum cleaner sound --- app/IR.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/IR.hs') diff --git a/app/IR.hs b/app/IR.hs index f17547d..cfb0b9a 100644 --- a/app/IR.hs +++ b/app/IR.hs @@ -17,7 +17,7 @@ data Id = deriving (Show, Eq, Ord) data PrlgInt - = CallI Id [PrlgInt] --TODO this should be Int + = CallI Int [PrlgInt] | LiteralI Int | ListI [PrlgInt] (Maybe PrlgInt) -- only exists before desugaring | VarI Int Int -- VarI localIndex strTableString @@ -41,7 +41,7 @@ internPrlg = go go t (LiteralS str) = LiteralI <$> strtablize t str go t (CallS str ps) = let (t', i) = strtablize t str - in CallI (Id i $ length ps) <$> mapAccumL go t' ps + in CallI i <$> mapAccumL go t' ps go t (ListS elems Nothing) = flip ListI Nothing <$> mapAccumL go t elems go t (ListS elems (Just tail)) = let (t', tail') = go t tail -- cgit v1.2.3