module Bool: sig
.. end
Boolean signals
val false' : bool Note.signal
false'
is const false
.
val true' : bool Note.signal
true'
is const true
.
val not : bool Note.signal -> bool Note.signal
not s
is map not s
.
val (&&) : bool Note.signal -> bool Note.signal -> bool Note.signal
s0 && s1
is l2 ( && ) s1 s2
.
val (||) : bool Note.signal -> bool Note.signal -> bool Note.signal
s0 || s1
is l2 ( || ) s1 s2
.
val edge : bool Note.signal -> bool Note.event
edge s
is changes s
.
val rise : bool Note.signal -> unit Note.event
rise s
is
E.filter_map (function true -> Some b | false -> None) (edge s)
.
val fall : bool Note.signal -> unit Note.event
fall s
is
E.filter_map (function true -> None | None -> Some b) (edge s)
val flip : init:bool -> 'a Note.event -> bool Note.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 _