1
1
mirror of https://github.com/github/semantic.git synced 2024-12-27 00:44:57 +03:00

Define a smart constructor for multiple lambdas.

This commit is contained in:
Rob Rix 2019-11-04 15:36:55 -05:00
parent 9822b4eed7
commit 2d362d9874
No known key found for this signature in database
GPG Key ID: F188A01508EA1CF7

View File

@ -5,6 +5,7 @@ module Analysis.Domain
, string
, record
, lam
, lams
, Domain(..)
) where
@ -28,6 +29,9 @@ 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))
lams :: (Eq a, Foldable t, Carrier sig m, Member Domain sig) => t (Maybe Name, a) -> m a -> m a
lams names body = foldr (uncurry lam) body names
data Domain f a
= Unit