michiexile: (Default)
michiexile ([personal profile] michiexile) wrote in [personal profile] maradydd 2009-07-31 06:19 am (UTC)

Oh, but making numbers, or constants in general, into functions is very much in line with the underlying mathematics of functional programming.

An element of an object in a nice category - say, for instance a data type in an appropriate category of data types and computable functions - is a computable function from the terminal object (to which there is one unique map from every other object) to your object.

So, in Haskell terms, an element is just a 0-ary function
1 :: () -> Int
and then the compiler is gracious enough to give us syntax sugar for 0-ary functions.

Post a comment in response:

If you don't have an account you can create one now.
HTML doesn't work in the subject.
More info about formatting

If you are unable to use this captcha for any reason, please contact us by email at support@dreamwidth.org