Christian Stryczynski

Freelance software developer. Haskelling at night. Hopefully unconventional. Fan of Dvorak

Disable Haskell warnings and errors in a single file

If you want to super charge your Haskell, I would highly recommend having -Wall enabled (show all warnings), this can be done on a project-basis by having a .ghci file with the following line:
    :set -Wall

Things like unnessary imports, unused defintitions become warnings and if you avoid these things your code becomes a lot more lean.

However sometimes I find I'm writing a new module and I'm experimenting and all these errors get in the way. Well you can turn them off in just a specific file by adding a 'no' option like one of the following lines:

    {-# OPTIONS -Wno-unused-matches #-}
    {-# OPTIONS -Wno-unused-imports #-}

Written by Christian Stryczynski on Tuesday March 21, 2017

Permalink - Tag: haskell

« Functional programming has made me a worse programmer - My introduction with digestive-functors »