Skip to content

Commit

Permalink
Add branchTerm function
Browse files Browse the repository at this point in the history
  • Loading branch information
ollef committed May 25, 2024
1 parent fbbac10 commit 94475bf
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Low/Syntax.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE LambdaCase #-}

module Low.Syntax where

Expand Down Expand Up @@ -41,6 +42,11 @@ data Branch v
| LiteralBranch !Literal !(Term v)
deriving (Eq, Show, Generic, Hashable)

branchTerm :: Branch v -> Term v
branchTerm = \case
ConstructorBranch _ t -> t
LiteralBranch _ t -> t

data Function v
= Body !PassBy !(Term v)
| Parameter !Name !PassBy !(Scope Function v)
Expand Down

0 comments on commit 94475bf

Please sign in to comment.