package ppx_monad

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Source file ppx_monad_list.ml

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

let mk_return ~loc x =
  [%expr [[%e x]]]

let mk_bind ~loc e f =
  [%expr Stdlib.List.flatten (Stdlib.List.map [%e f] [%e e])]

let () = Ppx_monad.register "list"
    ~applies_on:"lst|list"
    ~mk_return ~mk_bind
OCaml

Innovation. Community. Security.