From 9822b4eed77dfa81a4330dc1e658f5ea959fae58 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Mon, 4 Nov 2019 14:48:59 -0500 Subject: [PATCH] Define a smart constructor for Lam. --- semantic-analysis/src/Analysis/Domain.hs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/semantic-analysis/src/Analysis/Domain.hs b/semantic-analysis/src/Analysis/Domain.hs index 5f1864df0..c676050c3 100644 --- a/semantic-analysis/src/Analysis/Domain.hs +++ b/semantic-analysis/src/Analysis/Domain.hs @@ -4,6 +4,7 @@ module Analysis.Domain , bool , string , record +, lam , Domain(..) ) where @@ -24,6 +25,9 @@ string = send . String record :: (Carrier sig m, Member Domain sig) => [(Name, m a)] -> m a record fs = send (Record fs) +lam :: (Eq a, Carrier sig m, Member Domain sig) => Maybe Name -> a -> m a -> m a +lam u n b = send (Lam u (abstract1 n b)) + data Domain f a = Unit