[Haskell-cafe] Re: How does one get off haskell?

braver deliverable at gmail.com
Fri Jun 18 13:14:47 EDT 2010


On Jun 18, 12:59 pm, "Edward Z. Yang" <ezy... at MIT.EDU> wrote:
> ... I would still prefer Haskel
> for a system intended for production; with the pain of making sure you've
> handled all of the possible constructors for the data you're operating
> on, you also have a pretty good assurance that you haven't forgotten
> anything stupid.

Absolutely.  You suddenly feel naked when a working dynamic system
must pass assurances, and all those unit tests are just busywork of
the script kiddies trying to make it look reliable. :)  Nothing like a
good static type system to be able to trust the thing more.  However,
some things are hard to catch even with strict typing.  Here's an
example from my current program:

dstarts = M.fromList $ map dayUsers (groupBy ((==) `on` snd) dranges)

This was a bug.  dranges is a [(User, (Int,Int))], and I needed the
first int of the pair, not the whole pair.  But groupBy would take
either.  I had to identify it and replace by

dstarts = M.fromList $ map dayUsers (groupBy ((==) `on` fst . snd)
dranges)

-- which feel almost like Clojure's easy tweaking.  Both things type
check unless I add the type signature for dstarts.  But where to add
them is not clear from the get-go, and you want to use inference where
you think what you mean is clear...  which sometimes is not.

-- Alexy


More information about the Haskell-Cafe mailing list