-*- mode: org; coding: utf-8; -*-
guile-monads is a monads library for guile scheme.
With guix:
guix package -f guix.scm
(use-modules (monads))
(with-m m-seq
i <- '(1 2 3)
j <- '(2 4 6)
(return (list i j)))
; => ((1 2) (1 4) (1 6) (2 2) (2 4) (2 6) (3 2) (3 4) (3 6))
(use-modules (monads))
(reify m-seq (list (reflect-seq '(1 2 3))
(reflect-seq '(2 4 6))))
; => ((1 2) (1 4) (1 6) (2 2) (2 4) (2 6) (3 2) (3 4) (3 6))
Implemented monads are: Identity (m-id), Sequence/List (m-seq), State (m-state), Maybe (m-maybe), Continuation (m-cont) and Writer (m-writer).