mirror of
https://github.com/github/semantic.git
synced 2024-12-26 08:25:19 +03:00
Define a smart constructor for multiple lambdas.
This commit is contained in:
parent
9822b4eed7
commit
2d362d9874
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user