Friday
Jul022010

Longhorn Beetle

Longhorn beetle Phytoecia cylindrica (Coleoptera: Cerambycidae).  These often hold their antennae in this T-shaped attitude.

Photos taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-02.

Thursday
Jul012010

Ichneumon Wasp

Probably Amblyteles armatorius (Hymenoptera: Ichneumonidae).

Photo taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-29.

Wednesday
Jun302010

Ephydrid Fly

An Ephydrid fly, possibly Notiphila riparia (Diptera: Ephydridae) based on this comment by 'Cranefly' at diptera.info.  It was standing on an aphid-infested burdock plant (Arctium sp.) that was growing on the dam at the lower end of the large lake.

Photos taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-27.

Tuesday
Jun292010

Damselfly

A female blue-tailed damselfly, Ischnura elegans (Odonata: Coenagrionidae).  The females of this species come in five different colour forms.  This pink form is known as rufescens.

Photo taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-20.

Tuesday
Jun292010

Another Reason to Learn Haskell

From Real World Haskell (O'Sullivan, Goerzen and Stewart, O'Reilly, 2009, page 38):

In "Function Types and Purity" on page 27 we talked about figuring out the behaviour of a function based on its type signature.  We can apply the same kind of reasoning to polymorphic functions.  Let's look again at fst:

  ghci :type fst
fst :: (a, b) -> a

First of all, notice that its argument contains two type variables, a and b, signifying that the elements of the tuple can be of different types.

The result type of fst is a.  We've already mentioned that parameteric polymorphism makes the real type inaccessible.  fst doesn't have enough information to construct a value of type a, nor can it turn an a into a b.  So the only possible valid behaviour (omitting infinite loops or crashes) it can have is to return the first element of the pair.

...

There is a deep mathematical sense in which any nonpathological function of type (a,b) -> a must do exactly what fst does.  ...

If this doesn't surpise you when you first come across it, then you haven't been paying attention.