[Haskell-cafe] learning advanced haskell

Neil Brown nccb2 at kent.ac.uk
Mon Jun 14 05:53:52 EDT 2010

On 14/06/10 06:42, Aran Donohue wrote:
> Hi Cafe,
> I've been doing Haskell for a few months, and I've written some 
> mid-sized programs and many small ones. I've read lots of 
> documentation and many papers, but I'm having difficulty making the 
> jump into some of the advanced concepts I've read about.
> How do people build intuitions for things like RankNTypes and arrows? 
> (Is the answer "Get a PhD in type theory?") Normally I learn by coding 
> up little exercise programs, but for these I don't have good 
> intuitions about the kinds of toy problems I ought to try to solve 
> that would lead me to understand these tools better.
> For systems like Template Haskell and SYB, I have difficulty judging 
> when I should use Haskell's simpler built-in semantic abstractions 
> like functions and typeclasses and when I should look to these other 
> mechanisms.
I'd second Ivan's suggestion to "learn-by-need".  For SYB and Template 
Haskell, and probably for most other fancy abstractions, you can get on 
happily without them in most cases.  When you start to think "there must 
be a better way!" while coding, that's when you should start looking for 
advanced features.

For example, if you find yourself writing the Nth boilerplate function 
that pattern-matches all cases in your ADT just to apply a function in 
its sub-types, that's when you'll want some form of generic programming 
like SYB.  And by that point you'll understand one of the problems that 
generic programming solves, which is halfway towards understanding the 
techniques themselves.

Hope that helps,


More information about the Haskell-Cafe mailing list