Skip to content

A peer-to-peer stack for code collaboration

333 B
Raw Blame
{:module  'prelude/maybe
 :doc     "Functions for dealing with optional values."
 :exports '[cat-maybes]}

(import prelude/patterns :unqualified)

(def cat-maybes
  (fn [xs]
    (foldr (fn [x_ acc]
             (match x_
                    (/just 'x) (cons x acc)
                    _          acc))
           []
           xs)))