package ppx_monad

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

Source file ppx_monad_ppx_monad.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
open Ppxlib

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

let mk_bind ~loc e f =
  [%expr bind [%e e] [%e f]]

let mk_fail ~loc x =
  [%expr fail [%e x]]

let mk_catch ~loc e f =
  [%expr catch [%e e] [%e f]]

let () = Ppx_monad_lib.register "monad"
    ~applies_on:"m|monad"
    ~mk_return ~mk_bind
    ~mk_fail ~mk_catch
OCaml

Innovation. Community. Security.