It's not really comparable, but minimalistic spreadsheet applications always remind me of Dan Piponi's Haskell `loeb` function [0]---a "one-line" "spreadsheet" "implementation".
The blog post is very interesting to read, but here's the meat. We're looking for a function with type
loeb :: Functor f => f (f a -> a) -> f a
and without thinking about the meaning of it, we can implement it as loeb x = fmap (\a -> a (loeb x)) x
which embodies a certain, strange kind of recursion. It turns out that it's "spreadsheet recursion". We build a list of functions from lists of a to a like test :: [[Int] -> Int]
test = [ (!! 1), length, (!! 0) ] -- think [A1, length(A), A0]
then `loeb test` "completes" the list by applying the "result list" to each of the functions of the source list. loeb test == [3, 3, 3]
Laziness lets the recursion proceed despite "evaluating" the list from left to right. Infinite loops still fail loeb [(!! 0)] == [............ waiting
It's also interesting to think of how to do "spreadsheet recursion" on exotic data types like trees. data Binary a = Branch (Binary a) a (Binary a) | Tip
deriving (Show, Functor)
depth Tip = 0
depth (Branch l _ r) = succ (max (depth l) (depth r))
top default Tip = default
top _ (Branch _ a _) = a
> loeb (Branch Tip depth (Branch Tip (top 0) Tip))
Branch Tip 2 (Branch Tip 2 Tip)
[0] http://blog.sigfpe.com/2006/11/from-l-theorem-to-spreadsheet...