diff --git a/src/Low/Syntax.hs b/src/Low/Syntax.hs index a27b28f..1f74947 100644 --- a/src/Low/Syntax.hs +++ b/src/Low/Syntax.hs @@ -1,5 +1,6 @@ {-# LANGUAGE DeriveAnyClass #-} {-# LANGUAGE DeriveGeneric #-} +{-# LANGUAGE LambdaCase #-} module Low.Syntax where @@ -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)