Surreal and natural numbers

Uncategorized 18 April 2007 | 0 Comments

After reading a recent post on Good Math, Bad Math concerning surreal numbers, I got to thinking about how to model these in Haskell. I came up with the following formulation: data Surreal = Zero | Plus Surreal | Minus Surreal … which also seems very similar to the usual construction for natural numbers: data [...]

Tagged in , ,

Exponential Bags: Integration of Types, continued

Uncategorized 11 April 2007 | 0 Comments

Derivatives of Containers claims to look for the ‘container which is its own derivative’; in other words, a type analogue of ex. They arrive at (approximated in ASCII and the notation used in my previous post): T[X] = Forall(n : N) Xn / Autn This is a little much for me, since I don’t understand [...]

Tagged in , , ,

Types as Functions (and Integration thereof)

Uncategorized 11 April 2007 | 0 Comments

After reading Differention of Datastructures, I think I finally understand what is meant by “types as functions”, and immediately I can see one direction in which to go from what is presented there. If we take integration to be the logical inverse of differentiation (which is defined in the article as ‘removal of an element [...]

Tagged in , , ,

Functional programming, APL and Unix pipes

Uncategorized 4 March 2007 | 5 Comments

I’ve noticed that when reading rather deeply-nested functional code in Haskell, the process taking place in reading the code seems to resemble trying to decipher APL more than anything else. This seems to be because functions which operate over lists are easily concatenated (possibly using the $ operator), because they operate on lists in their [...]

Tagged in , , , , ,