[Haskell] best way to do generic programming?