TIM export list and ifExample2

This commit is contained in:
crumbtoo
2023-11-22 15:41:36 -07:00
parent ae39579c97
commit d0be08027a
2 changed files with 8 additions and 2 deletions

View File

@@ -64,10 +64,14 @@ arithExample2 = [coreProg|
main = negate# ((+#) 2 ((*#) 5 3)); main = negate# ((+#) 2 ((*#) 5 3));
|] |]
ifExample = [coreProg| ifExample1 = [coreProg|
main = if# True 2 3; main = if# True 2 3;
|] |]
ifExample2 = [coreProg|
main = if# (id True) 2 3;
|]
facExample = [coreProg| facExample = [coreProg|
fac n = if# ((==#) n 0) 1 ((*#) n (fac ((-#) n 1))) fac n = if# ((==#) n 0) 1 ((*#) n (fac ((-#) n 1)))
main = fac 3; main = fac 3;

View File

@@ -3,7 +3,8 @@
{-# LANGUAGE ViewPatterns #-} {-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TemplateHaskell #-}
module TIM module TIM
where ( module Core.Examples
) where
---------------------------------------------------------------------------------- ----------------------------------------------------------------------------------
import Data.Map (Map, (!?), (!)) import Data.Map (Map, (!?), (!))
import Data.Map qualified as M import Data.Map qualified as M
@@ -21,6 +22,7 @@ import Lens.Micro
import Lens.Micro.TH import Lens.Micro.TH
import Data.Pretty import Data.Pretty
import Data.Heap import Data.Heap
import Core.Examples
import Core import Core
---------------------------------------------------------------------------------- ----------------------------------------------------------------------------------