haskell-beam / beam

A type-safe, non-TH Haskell SQL library and ORM
https://haskell-beam.github.io/beam/
577 stars 170 forks source link

Upgrade to optparse-applicative 0.14 #111

Closed reactormonk closed 6 years ago

reactormonk commented 6 years ago

I'm trying to compile beam with resolver lts-10.3, but after adding import Options.Applicative.Common, it fails with

beam/beam-migrate/tools/Migrate.hs:40:25: error:
    • Variable not in scope: infoIntersperse :: ParserInfo a -> Bool
    • Perhaps you meant one of these:
        ‘noIntersperse’ (imported from Options.Applicative),
        data constructor ‘NoIntersperse’ (imported from Options.Applicative.Types),
        data constructor ‘Intersperse’ (imported from Options.Applicative.Types)
   |
40 |   let p = runParser (if infoIntersperse info then SkipOpts else AllowOpts) CmdStart (infoParser info) a
   |                         ^^^^^^^^^^^^^^^

beam/beam-migrate/tools/Migrate.hs:40:51: error:
    Data constructor not in scope: SkipOpts :: ArgPolicy
   |
40 |   let p = runParser (if infoIntersperse info then SkipOpts else AllowOpts) CmdStart (infoParser info) a
   |                                                   ^^^^^^^^

beam/beam-migrate/tools/Migrate.hs:40:65: error:
    Data constructor not in scope: AllowOpts :: ArgPolicy
   |
40 |   let p = runParser (if infoIntersperse info then SkipOpts else AllowOpts) CmdStart (infoParser info) a
   |                                                                 ^^^^^^^^^

Maybe the new parser policy FowardOptions covers this usecase? https://www.stackage.org/haddock/lts-10.3/optparse-applicative-0.14.0.0/Options-Applicative-Types.html#t:ArgPolicy

tathougies commented 6 years ago

This module (beam-migrate/tools/Migrate.hs) was on its way out. After the nextgen-beam-migrate merge, it's no longer there. I've verified beam compiles on lts-10.3. In fact I just made that the default resolver in stack.yaml, and updated all the constraints. Let me know if it's working for you.