Skip to content

docopt does not compile with ghc-8.8.2 #33

@peti

Description

@peti
[ 6 of 10] Compiling System.Console.Docopt.Public ( System/Console/Docopt/Public.hs, dist/build/System/Console/Docopt/Public.o )

System/Console/Docopt/Public.hs:195:17: error:
    • Could not deduce (MonadFail m) arising from a use of ‘fail’
      from the context: Monad m
        bound by the type signature for:
                   getFirstArg :: forall (m :: * -> *).
                                  Monad m =>
                                  Arguments -> Option -> m String
        at System/Console/Docopt/Public.hs:193:1-57
      Possible fix:
        add (MonadFail m) to the context of
          the inferred type of failure :: m a
          or the type signature for:
               getFirstArg :: forall (m :: * -> *).
                              Monad m =>
                              Arguments -> Option -> m String
    • In the expression: fail $ "no argument given: " ++ show opt
      In an equation for ‘failure’:
          failure = fail $ "no argument given: " ++ show opt
      In the expression:
        let failure = fail $ "no argument given: " ++ show opt
        in
          case opt `M.lookup` args of
            Nothing -> failure
            Just val
              -> case val of
                   MultiValue vs -> ...
                   Value v -> return v
                   _ -> failure
    |
195 |   let failure = fail $ "no argument given: " ++ show opt
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 7 of 10] Compiling System.Console.Docopt.UsageParse ( System/Console/Docopt/UsageParse.hs, dist/build/System/Console/Docopt/UsageParse.o )

System/Console/Docopt/UsageParse.hs:7:1: warning: [-Wunused-imports]
    The import of ‘dropWhile’ from module ‘Data.List’ is redundant
  |
7 | import           Data.List (nub, sortBy, maximumBy, dropWhile, dropWhileEnd)
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[ 8 of 10] Compiling System.Console.Docopt.QQ ( System/Console/Docopt/QQ.hs, dist/build/System/Console/Docopt/QQ.o )

System/Console/Docopt/QQ.hs:59:25: error:
    • No instance for (MonadFail ((->) String))
        arising from a use of ‘fail’
    • In the first argument of ‘(.)’, namely ‘fail’
      In the expression: fail . (++ " context unsupported")
      In an equation for ‘unsupported’:
          unsupported = fail . (++ " context unsupported")
   |
59 |     where unsupported = fail . (++ " context unsupported")
   |                         ^^^^

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions