Closed vaclavsvejcar closed 3 years ago
FYI a reasonable work-around is to do the argument handling by itself in its own tiny source file, where this warning is disabled using:
{-# OPTIONS_GHC -Wno-partial-fields #-}
while for everywhere else in my project, my Cabal file defines -Wpartial-fields
giving me this check where I want it.
Hope this helps.
@tesujimath Thanks for this recommendation. In the meantime as I progressed with Haskell, I ended up using optparse-applicative
, so I guess this issue is no longer relevant and I can close it.
According to README, when I want to use multiple modes, I need to define data record with more constructors, like this
which unfortunately leads to issue with partial record field selectors and GHC complains about this:
I was wondering if there's another way how to define data types for multiple modes to avoid this?
One more minor question - is there any way to define only one mode and make it mandatory? Use case for this - right now I'd like to call my app with
myApp mode
, not justmyApp
, because I plan more modes in future and want to keep things consistent.Thanks a lot in advance :)