package accessor_base

  1. Overview
  2. Docs

Source file accessor_bool.ml

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

let true_ =
  [%accessor
    Accessor.variant
      ~match_:(fun bool -> if bool then First () else Second false)
      ~construct:(fun () -> true)]
;;

let false_ =
  [%accessor
    Accessor.variant
      ~match_:(fun bool -> if bool then Second true else First ())
      ~construct:(fun () -> false)]
;;

let negated = [%accessor Accessor.isomorphism ~get:not ~construct:not]