From d0be08027a9f4c3c1cd3dadf26d8d8d49b89d573 Mon Sep 17 00:00:00 2001 From: crumbtoo Date: Wed, 22 Nov 2023 15:41:36 -0700 Subject: [PATCH] TIM export list and ifExample2 --- src/Core/Examples.hs | 6 +++++- src/TIM.hs | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Core/Examples.hs b/src/Core/Examples.hs index 50d3a6b..b83a21e 100644 --- a/src/Core/Examples.hs +++ b/src/Core/Examples.hs @@ -64,10 +64,14 @@ arithExample2 = [coreProg| main = negate# ((+#) 2 ((*#) 5 3)); |] -ifExample = [coreProg| +ifExample1 = [coreProg| main = if# True 2 3; |] +ifExample2 = [coreProg| + main = if# (id True) 2 3; +|] + facExample = [coreProg| fac n = if# ((==#) n 0) 1 ((*#) n (fac ((-#) n 1))) main = fac 3; diff --git a/src/TIM.hs b/src/TIM.hs index 840eb88..dcfc108 100644 --- a/src/TIM.hs +++ b/src/TIM.hs @@ -3,7 +3,8 @@ {-# LANGUAGE ViewPatterns #-} {-# LANGUAGE TemplateHaskell #-} module TIM - where + ( module Core.Examples + ) where ---------------------------------------------------------------------------------- import Data.Map (Map, (!?), (!)) import Data.Map qualified as M @@ -21,6 +22,7 @@ import Lens.Micro import Lens.Micro.TH import Data.Pretty import Data.Heap +import Core.Examples import Core ----------------------------------------------------------------------------------