diff options
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/Monad.v | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/common/Monad.v b/src/common/Monad.v index 773918a..8517186 100644 --- a/src/common/Monad.v +++ b/src/common/Monad.v @@ -39,4 +39,10 @@ Module MonadExtra(M : Monad). ret (r::rs) end. + Fixpoint collectlist {A : Type} (f : A -> mon unit) (l : list A) {struct l} : mon unit := + match l with + | nil => ret tt + | x::xs => do _ <- f x; collectlist f xs + end. + End MonadExtra. |