[Haskell-beginners] Hutton ex 7.7 and 7.8

Francesco Ariis fa-ml at ariis.it
Fri Aug 24 10:00:27 UTC 2018


Hello Trent,

On Fri, Aug 24, 2018 at 02:45:46AM -0700, trent shipley wrote:
> I am mostly looking for style feedback, although if there are any obvious
> logic errors, I'd be "happy" to learn about those too.

Running hlint is always useful. e.g. it will spot redundant brackets:

    p.hs:35:40: Suggestion: Redundant bracket
    Found:
      (length xs) - 1
    Why not:
      length xs - 1

and unidiomatic expressions like

    p.hs:54:10: Warning: Use concatMap
    Found:
      concat . map (make8 . int2bin . ord)
    Why not:
      concatMap (make8 . int2bin . ord)



More information about the Beginners mailing list