The Algebra of Data, and the Calculus of Mutation (blog.lab49.com) 12 points by perplexes 16y ago ↗ HN
[–] fexl 16y ago ↗ Beautiful. I suppose the function signatures would be: peek : int * int^3 -> int pos : int * int^3 -> 3*int^2 poke : int * 3*int^2 -> int^3 The functions would behave like this: peek 2 (98,76,54) = 76 pos 2 (98,76,54) = (98,_,54) poke 77 (98,_,54) = (98,77,54) You could chain them like this: poke 99 (pos 1 (98,76,54)) = (99,76,54) poke 77 (pos 2 (98,76,54)) = (98,77,54) poke 55 (pos 3 (98,76,54)) = (98,76,55)
1 comment
[ 5.0 ms ] story [ 9.5 ms ] thread