Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In what sense is Constant Applicative Form applicative?

Tags:

haskell

I understand a CAF is a form in a sense of it being of specific shape in memory, or one of infinitely many possible graphic representations of some value it can be evaluated to. (It is noted that "constant applicative form" is synonymous to "static thunk".)

I understand it being constant in that there are no free variables and all the information necessary to evaluate a Constant Form is already contained therein. It's a shape that has no arrows pointing outwards.

But why "applicative"? I can't sleep at night due to this. Everyone says caf, caf, but who actually knows what that literally means? Does it have something to do with applicative functors (I guess not)? What other kinds of applicative forms does one get out there?

like image 503
Ignat Insarov Avatar asked Jan 28 '18 18:01

Ignat Insarov


2 Answers

A term in constant applicative form is a constant applied to (zero or more) other constants. (Of course each of those constants may require quite some computation before they're fully evaluated!)

like image 133
Daniel Wagner Avatar answered Sep 28 '22 18:09

Daniel Wagner


Every CAF is a supercombinator, and supercombinators are, long story short, functions that take other (possibly nullary) functions and apply them to one another.

So, my understanding of "applicative" in the CAF name is as referring to their supercombinatorish nature.

like image 25
0xd34df00d Avatar answered Sep 28 '22 16:09

0xd34df00d