-
Notifications
You must be signed in to change notification settings - Fork 47
Closed
Description
Is there a reason cmapMIf and cmapM_If are not implemented (other than: they didn't seem necessary, or nobody has needed them yet)?
I just tried implementing cmapM_If myself, but maybe they should actually be included in the library itself? What do you think?
Here's my attempt at an implementation for cmapM_If (It doesn't compile though, and I'm too much of a haskell beginner to fix it...):
cmapM_If :: forall w m cp c.
( Get w m cp
, Get w m c
, Members w m c
)
=> (cp -> Bool)
-> (c -> SystemT w m ())
-> SystemT w m ()
cmapM_If cond sys = do
sp :: Storage cp <- getStore
s :: Storage c <- getStore
sl <- lift $ explMembers (s, sp)
U.forM_ sl $ \ety -> do
p <- explGet sp ety
when (cond p) $ do
x <- lift $ explGet s ety
sys xReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels