[Haskell-cafe] Proposal: Non-recursive let

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Thu Jul 25 10:40:12 CEST 2013


On Thu, Jul 25, 2013 at 07:34:55PM +1200, Richard A. O'Keefe wrote:
> It's a queer thing, I always feel that the advice about
> keeping function bodies small is patronising nonsense for
> beginners and that *my* code is perfectly readable no matter
> how big it is, but end up wishing that *other* people kept
> *their* functions small.

For example, breaking this code into smaller functions could make it
transparent that 'token' is only used in 'ast1', 'title' is only used in
'headers1' and that the 'mv' that is the argument to 'write_period' is only
used in the Nothing branch of the massive case statement.

It seems there are a number of straightforward ways to make this code much
clearer that do not require non-recursive let.

Tom




More information about the Haskell-Cafe mailing list