HackerTrans
トップ新着トレンドコメント過去質問紹介求人

developedby

no profile record

コメント

developedby
·2 年前·議論
That's the main idea!
developedby
·2 年前·議論
Bending is an operation similar to folding, both in real life and in the language. While fold is recursive on data, bend is recursive on a boolean condition (like a pure while that supports multiple branching recursion points).

I was actually looking forward to seeing someone from Bend to make a comment like this
developedby
·2 年前·議論
The first `fork` is from using bend and passing the initial state

  The program above will initialize a state (`x = 0`), and then, for as long as `x < 3`,
  it will "fork" that state in two, creating a `Tree/Node`, and continuing with `x + 1`.
  When `x >= 3`, it will halt and return a `Tree/Leaf` with `7`.
  When all is done, the result will be assigned to the `tree` variable: