lowerslop

This commit is contained in:
2026-07-05 20:13:49 -06:00
parent a2c93938ca
commit 08a18f159f
5 changed files with 61 additions and 6 deletions
+17
View File
@@ -1,10 +1,17 @@
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE TemplateHaskell #-}
module Gyehoek.CPS.Syntax
( Val(..)
, Kappa(..)
, Exp(..)
, Name(..)
, Prim(..)
, pattern Halt
, pattern Halt1
, _MkKappa
, _ExpPrim
, _ExpFix
, _ExpApply
)
where
@@ -16,6 +23,7 @@ import Data.List (List)
import GHC.Generics (Generic)
import Language.SexpGrammar.Generic
import Control.Category
import Control.Lens
import Data.Text qualified as T
import Data.Generics.Labels
import Prelude hiding ((.), id)
@@ -38,6 +46,15 @@ data Exp
| ExpApply Val (List Val)
deriving (Show, Generic)
pattern Halt :: List Val -> Exp
pattern Halt xs = ExpApply (ValVar "halt") xs
pattern Halt1 :: Val -> Exp
pattern Halt1 x = ExpApply (ValVar "halt") [x]
makePrisms ''Kappa
makePrisms ''Exp
-- SexpIso instances