projects
/
matthijs
/
master-project
/
cλash.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add catMaybesM and concatM helper functions.
[matthijs/master-project/cλash.git]
/
cλash
/
CLasH
/
Utils.hs
diff --git
a/cλash/CLasH/Utils.hs
b/cλash/CLasH/Utils.hs
index 3ce4b9ef37c3c6e8dd8d0661fe8f78c8095cc277..731de270b56ccb9764d589bc18102dea6d90705e 100644
(file)
--- a/
cλash/CLasH/Utils.hs
+++ b/
cλash/CLasH/Utils.hs
@@
-71,3
+71,14
@@
unzipM :: (Monad m) =>
m [(a, b)]
-> m ([a], [b])
unzipM = Monad.liftM unzip
+
+catMaybesM :: (Monad m) =>
+ m [Maybe a]
+ -> m [a]
+catMaybesM = Monad.liftM Maybe.catMaybes
+
+concatM :: (Monad m) =>
+ m [[a]]
+ -> m [a]
+concatM = Monad.liftM concat
+