Composability siiky (13 Dec 2023 20:06 UTC)
Re: Composability Marc Nieper-Wißkirchen (14 Dec 2023 07:12 UTC)
Re: Composability siiky (19 Dec 2023 19:41 UTC)
Re: Composability siiky (19 Dec 2023 20:59 UTC)
Re: Composability siiky (19 Dec 2023 21:40 UTC)

Composability siiky 13 Dec 2023 20:06 UTC

If f1 and f2 are procedures returning instances of the same "monad", how
is one supposed to compose usage of the two?

(define-syntactic-monad $ a b)
($ define (f1)
   (values a a))
($ define (f2)
   (values b b))

(let ((a 1) (b 2))
   ($ let*-values ((() (f1))
                   (() (f2)))
     (values a b))) ; => (values 2 2)

This is how much I understand of it so far. Is one supposed to use
"regular" syntactic constructs instead?

(let*-values (((a1 b1) ($ f1))
               ((a2 b2) ($ f2)))
   (values a2 b1)) ; => (values 2 1)

Thanks,
siiky