Skip to content

functor

Pannous edited this page Dec 19, 2022 · 10 revisions

A functor is a higher order function which takes code blocks (closures) or function pointers as argument.

They can be evaluated with () or !

E.g.

map function on list := for each l in list: function!(l)
map square on [1 2 3] == [1 4 9]

IF condition:block then:block otherwise:block?
  if(condition()) : then()
  else otherwise()
end

redefining if. calling optional blocks results in nop_ if empty

Home

Philosophy

data & code blocks

features

inventions

evaluation

keywords

iteration

tasks

examples

todo : bad ideas and open questions

⚠️ specification and progress are out of sync

Clone this wiki locally