mirror of
https://github.com/github/semantic.git
synced 2024-11-24 08:54:07 +03:00
Rename binds to do'.
This commit is contained in:
parent
724ae1763f
commit
0797316ead
@ -111,7 +111,7 @@ prog4 = fromBody
|
||||
(Core.bool False))
|
||||
|
||||
prog5 :: File (Term Core User)
|
||||
prog5 = fromBody $ ann (binds
|
||||
prog5 = fromBody $ ann (do'
|
||||
[ Just (named' "mkPoint") :<- lams [named' "_x", named' "_y"] (ann (Core.record
|
||||
[ ("x", ann (pure "_x"))
|
||||
, ("y", ann (pure "_y"))
|
||||
@ -132,7 +132,7 @@ prog6 =
|
||||
]
|
||||
|
||||
ruby :: File (Term Core User)
|
||||
ruby = fromBody $ annWith callStack (rec (named' __semantic_global) (binds
|
||||
ruby = fromBody $ annWith callStack (rec (named' __semantic_global) (do'
|
||||
bindings
|
||||
( var "Class" ... __semantic_super .= var "Object"
|
||||
>>> record (map (\ (v :<- _) -> (v, var v)) bindings))))
|
||||
@ -198,7 +198,7 @@ ruby = fromBody $ annWith callStack (rec (named' __semantic_global) (binds
|
||||
infixr 1 >>>
|
||||
v :<- a >>>= b = annWith callStack (named' v :<- a Core.>>>= b)
|
||||
infixr 1 >>>=
|
||||
binds bindings body = foldr (>>>=) body bindings
|
||||
do' bindings body = foldr (>>>=) body bindings
|
||||
bool b = annWith callStack (Core.bool b)
|
||||
a .= b = annWith callStack (a Core..= b)
|
||||
|
||||
|
@ -7,7 +7,7 @@ module Data.Core
|
||||
, (>>>)
|
||||
, block
|
||||
, (>>>=)
|
||||
, binds
|
||||
, do'
|
||||
, (:<-)(..)
|
||||
, lam
|
||||
, lams
|
||||
@ -139,8 +139,8 @@ Named u n :<- a >>>= b = send (Named u a :>>= abstract1 n b)
|
||||
|
||||
infixr 1 >>>=
|
||||
|
||||
binds :: (Eq a, Foldable t, Carrier sig m, Member Core sig) => t (Maybe (Named a) :<- m a) -> m a -> m a
|
||||
binds bindings body = foldr (\ (n :<- a) -> maybe (a >>>) ((>>>=) . (:<- a)) n) body bindings
|
||||
do' :: (Eq a, Foldable t, Carrier sig m, Member Core sig) => t (Maybe (Named a) :<- m a) -> m a -> m a
|
||||
do' bindings body = foldr (\ (n :<- a) -> maybe (a >>>) ((>>>=) . (:<- a)) n) body bindings
|
||||
|
||||
data a :<- b = a :<- b
|
||||
deriving (Eq, Ord, Show)
|
||||
|
Loading…
Reference in New Issue
Block a user