scotty-web / scotty

Haskell web framework inspired by Ruby's Sinatra, using WAI and Warp (Official Repository)
http://hackage.haskell.org/package/scotty
BSD 3-Clause "New" or "Revised" License
1.72k stars 134 forks source link

`ActionT`'s `MonadFail` instance removed in `scotty-0.20` #323

Closed RyanGlScott closed 1 year ago

RyanGlScott commented 1 year ago

PR #314 removed the MonadFail instance for ActionT, which I noticed when trying to upgrade one of my projects:

[2 of 2] Compiling Web.Scotty.Comet ( Web/Scotty/Comet.hs, interpreted )

Web/Scotty/Comet.hs:157:28: error:
    • No instance for (MonadFail
                         (Web.Scotty.Internal.Types.ActionT IO))
        arising from a use of ‘fail’
    • In the first argument of ‘($)’, namely ‘fail’
      In the expression:
        fail $ "Expected Object, received: " ++ show wrappedVal
      In a case alternative:
          _ -> fail $ "Expected Object, received: " ++ show wrappedVal
    |
157 |                       _ -> fail $ "Expected Object, received: " ++ show wrappedVal
    |                            ^^^^

This isn't documented in the CHANGELOG as a breaking change, so I'm unclear if this was intentional or not. If it was intentional, could you document in this in the CHANGELOG and suggest a recommended alternative?

ocramz commented 1 year ago

Whoops! Sorry @RyanGlScott , I missed this when autoderiving a bunch of instances. I can document this in the changelog, make a bugfix release and deprecate 20.0.

ocramz commented 1 year ago

Fixed this in #326

ocramz commented 1 year ago

@RyanGlScott does 0.20.1 work fine for you now?

RyanGlScott commented 1 year ago

I did some preliminary testing, and my projects all build without issue using scotty-0.20.1. Thanks!