;; also known as bind in haskell (bind-func flatmap:[List{!b}*,List{!a}*,[List{!b}*,!a]*]* (lambda (M f) ;; alternative 'direct' implementation ;; (Cons$ M (x xs) (append (f x) (flatmap xs f)) (Nil)))) (join (fmap f M))))