[Haskell-cafe] Renaming constructors for readability

Henning Thielemann lemming at henning-thielemann.de
Wed Nov 14 10:42:15 EST 2007


On Wed, 14 Nov 2007, Jules Bean wrote:

> Henning Thielemann wrote:
> >
> > No problem, write a function like 'maybe' to inspect the data.
> >
> > Instead of 'f m' with
> > f :: Maybe T -> S
> > f (Just x) = g x
> > f Nothing  = h
>
> Yes. It is a problem.
>
> Do you write all your code using higher-order functions, never matching
> explicitly on constructors? I don't.

I do it more and more, because it let me switch the underlying data
structure more easily.


More information about the Haskell-Cafe mailing list