package ppx_monad

  1. Overview
  2. Docs
A Syntax Extension for all Monadic Syntaxes

Install

Dune Dependency

Authors

Maintainers

Sources

v0.1.0.tar.gz
md5=9fc7e483877beb07c56c1d92875c5034
sha512=5efb1026d9b12f537d2c1f1c608c450de90267090dd81a4ce521d52ac752628248bed42c1a23898f5742970c81b24f1d030b029fa8beb4e4b7c33b7004ec196b

doc/src/ppx_monad_seq/ppx_monad_seq.ml.html

Source file ppx_monad_seq.ml

1
2
3
4
5
6
7
8
9
10
open Ppxlib

let mk_return ~loc x =
  [%expr Stdlib.Seq.return [%e x]]

let mk_bind ~loc e f =
  [%expr Stdlib.Seq.flat_map [%e f] [%e e]]

let () = Ppx_monad.register "seq"
    ~mk_return ~mk_bind
OCaml

Innovation. Community. Security.