Remix.run Logo
winwang 5 hours ago

I think it depends on what you mean by "is a function". You can think of a constant, `x` as `x_: () -> {x}` (i.e. everything can be indirected). It could be argued that this is "philosophically" "useful" since getting (using) the value of `x`, even as an actual constant, requires at the least loading it as an immediate into the ALU (or whatever execution unit).

Even non-functional relations can be turned into functions (domain has to change). Like a circle, which is not a function of the x-axis, can be parameterized by an angle theta (... `0 <= theta < 2pi`)

whateveracct 5 hours ago | parent [-]

I think in this context, it is function as in a lambda in LC.

The answer is pretty much, yes, everything can be a function. e.g. A KV Map can be a function "K -> Maybe V"

P.S. If this style of thinking appeals to you, go read Algebra Driven Design! https://leanpub.com/algebra-driven-design