Archive for May, 2007

Type inference rocks

Monday, May 28th, 2007

I just wrote the following snippet of code for my dissertation:


intNatI :: Int :~= Nat
intNatI = Iso {
            to   = fromInteger . toInteger,
            from = fromInteger . toInteger }

The components to and from have totally different types (to is Int -> Nat, from is Nat -> Int). Yay for type inference! :)

Buffalo buffalo Buffalo buffalo buffalo buffalo Buffalo buffalo

Thursday, May 10th, 2007

The title of this entry (if you take “buffalo” to be 1) the obvious noun with identical plural, 2) capitalised, the proper noun referring to the American city, and 3) a verb meaning approximately “bully”) is a grammatically correct sentence of English. (I first came across it in The Language Instinct by Stephen Pinker, but was reminded of it recently.)

In fact, according to Wikipedia, for any n ≥ 1, buffalon is a grammatically correct sentence, if you disregard capitalisation. (“Buffalo!”, “Buffalo buffalo”, “Buffalo buffalo buffalo”, etc.)

Don’t you just love natural language?