Thursday
Aug142008

Recursive Equations are the Assembly Language of Functional Programming

From Origami Programming by Jeremy Gibbons (in The Fun of Programming, Gibbons and de Moer, eds, 2003):

One style of functional programming is based purely on recursive equations.  Such equations are easy to explain, and adequate for any computational purpose, but hard to use well as programs get bigger and more complicated.  In a sense, recursive equations are the ‘assembly language’ of functional programming, and direct recursion the goto. As computer scientists discovered in the 1960s with structured programming, it is better to identify common patterns of use of such too-powerful tools, and capture these patterns as new constructions and abstractions.  In functional programming, in contrast to imperative programming, we can often express the new constructions as higher-order operations within the language, whereas the move from unstructured to structured programming entailed the development of new languages.
Wednesday
Aug132008

GADT Syntax for Haskell Type Definitions

From an exchange on the Haskell mailing list in October 2006:

Lennart Augustsson:
Well, I think the GADT type definition syntax is the syntax data type definitions should have had from the start. Too bad we didn't realize it 15 years ago.
Paul Hudak:
I agree! In my experience teaching Haskell, the current syntax is a bit confusing for newbies, and for years I've been telling students, "It really means this: ..." and then I write out a syntax more like GADT's.
I also think that if we had adopted this syntax from the beginning, GADT's would have been "discovered" far sooner than now.
Wednesday
Aug132008

Meteors

I woke at 4am this morning and looked out of the bedroom window.  There were a few whisps of cloud against the clear sky.  I recognized Alpha and Beta Arietis high up in the south.  A bright meteor (magnitude 1 or 2) streaked vertically down through Pegasus and Aquarius, followed by a fainter one a few seconds later.  Then I remembered: it was August the 13th, Perseids maximum, and my mother's birthday.  She would have been 74.

Friday
Aug082008

North Kensington Misplaced on Google Maps

I spent today in west London and got a little confused when finding my way around.  I have just discovered why:  Google Maps, which I used to plan my route beforehand, incorrectly shows North Kensington about 3km southeast from where it should be (in the same place that it --correctly-- shows South Kensington).  Fortunately the pocket street map I took with me did not contain this error.

Thursday
Aug072008

Concave Translucent Mushrooms

 

A few days ago I noticed some of these on a pile of wood-chips in the woods between Farnborough North and Frimley stations.  I also noticed that they seemed to change form between the mornings and the afternoons.  I have tentatively identified them as Coprinus lagopus, a type of ink-cap mushroom.  In the mornings their stems are straight (up to 12cm long) and their caps neat little inverted translucent grey umbrellas (up to 5cm across), as shown above.  By the late afternoon, the stems have drooped and the caps are ragged, shrivelled and blackened, as shown below.

However, by the afternoon, the next day's mushrooms are already thrusting their heads up: