[Haskell-beginners] GHC warnings
Patrick Mylund Nielsen
haskell at patrickmylund.com
Sat Feb 23 22:29:58 CET 2013
It's hlint: http://community.haskell.org/~ndm/hlint/
e.g.:
# sudo apt-get install hlint
# hlint src
(where src is the folder containing Haskell files)
or
# hlint src --report
to generate an HTML report.
On Sat, Feb 23, 2013 at 10:25 PM, Emanuel Koczwara <
poczta at emanuelkoczwara.pl> wrote:
> Hi,
>
> Why GHC doesn't tell me such things like hpaste? (example here:
> http://hpaste.org/82917)
>
> 27:12: Error: Use replicateM
> Found:
> sequence $ replicate gridSize getLine
> Why not:
> Control.Monad.replicateM gridSize getLine
>
>
> 50:14: Warning: Use list comprehension
> Found:
> if y > 0 then [(UP, (x, y - 1))] else []
> Why not:
> [(UP, (x, y - 1)) | y > 0]
>
>
> 81:1: Error: Eta reduce
> Found:
> sortByPathCost p ps = sortBy compareHeuristic ps
> Why not:
> sortByPathCost p = sortBy compareHeuristic
>
>
> Can I enable this kind of verbosity in GHC somehow?
>
> Emanuel
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130223/2bd05cb9/attachment.htm>
More information about the Beginners
mailing list