Skip to content

Instantly share code, notes, and snippets.

@hatemogi
Created February 19, 2021 13:46
Show Gist options
  • Save hatemogi/a3161347609de484730807a6a2912637 to your computer and use it in GitHub Desktop.
Save hatemogi/a3161347609de484730807a6a2912637 to your computer and use it in GitHub Desktop.
type Signal = LazyList[Boolean]
def inv(xs: => Signal): Signal = xs map { ! _ }
def reg(init: => Boolean, d: => Signal): Signal = init #:: d
val tff: Signal = {
def d: Signal = inv(q)
def q: Signal = reg(false, d)
q
}
tff take 10 foreach println
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment