apply   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/examples/contrib/algebraic_data_types.xtm

Implementation

;; also known as <*> or ap
(bind-func apply:[List{!b}*,List{[!b,!a]*}*,List{!a}*]*
  (lambda (F1 F2)
    (Cons$ F1 (f fs)
           (Cons$ F2 (x xs)
                  (Cons (f x) (apply fs xs))
                  (Nil))
           (Nil))))


Back to Index

Similar Entries