Skip to content

Commit

Permalink
Clean up example file
Browse files Browse the repository at this point in the history
  • Loading branch information
SophieBosio committed Apr 7, 2024
1 parent ffef976 commit 5cdece0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions examples/simple/variousTerms.con
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ or False False = False .
or x y = True .

adt Example = C Integer | D Boolean Boolean .
adt Num = C Integer .
adt Num = E Integer .

-- caseOfADT :: Example -> Integer . -- TODO: Detect conflicts between signatures and implementation
caseOfADT :: Example -> Boolean .
caseOfADT x = case x of
; (C {y}) -> False
; (D {w, z}) -> and w z
Expand Down Expand Up @@ -90,12 +91,10 @@ letInADT x = let y = x in (C {y}) .
alwaysLetInADT :: Example .
alwaysLetInADT = let x = 5 in (C {x}) .

letOutADT :: Num -> Integer .
letOutADT :: Example -> Integer .
letOutADT x = let (C {y}) = x in y.

alwaysLetOutADT :: Integer .
alwaysLetOutADT = let (C {x}) = (C {5}) in x .

main = letOutADT (C {15}) .

-- substitute x in (C {y})

0 comments on commit 5cdece0

Please sign in to comment.