Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
The Algebra of Data, and the Calculus of Mutation (lab49.com)
12 points by perplexes on April 1, 2010 | hide | past | favorite | 1 comment


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)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: