package note

  1. Overview
  2. Docs

Boolean signals

val false' : bool signal

false' is const false.

val true' : bool signal

true' is const true.

val not : bool signal -> bool signal

not s is map not s.

val (&&) : bool signal -> bool signal -> bool signal

s0 && s1 is l2 ( && ) s1 s2.

val (||) : bool signal -> bool signal -> bool signal

s0 || s1 is l2 ( || ) s1 s2.

val edge : bool signal -> bool event

edge s is changes s.

val rise : bool signal -> unit event

rise s is E.filter_map (function true -> Some b | false -> None) (edge s).

val fall : bool signal -> unit event

fall s is E.filter_map (function true -> None | None -> Some b) (edge s)

val flip : init:bool -> 'a event -> bool signal

flip ~init e is a signal whose boolean value flips each time e occurs. init provides the signal value at creation time.

  • [flip b e]0 = not b if [e]0 = Some _
  • [flip b e]t = init if [e]<=t = None
  • [flip b e]t = not [flip b e]t-dt if [e]t = Some _
OCaml

Innovation. Community. Security.