bitemyapp / bloodhound

Haskell Elasticsearch client and query DSL
bitemyapp.com
BSD 3-Clause "New" or "Revised" License
424 stars 118 forks source link

Support GHC 8.8 #273

Closed wraithm closed 4 years ago

wraithm commented 4 years ago

I tried compiling bloodhound with GHC 8.8.3, and I got the following error:

    [ 4 of 16] Compiling Database.Bloodhound.Internal.Query

    /path/to/bloodhound/src/Database/Bloodhound/Internal/Query.hs:1626:26: error:
        • Could not deduce (MonadFail m) arising from a use of ‘fail’
          from the context: Monad m
            bound by the type signature for:
                       fieldTagged :: forall (m :: * -> *) a.
                                      Monad m =>
                                      (FieldName -> Object -> m a) -> Object -> m a
            at src/Database/Bloodhound/Internal/Query.hs:1623:1-71
          Possible fix:
            add (MonadFail m) to the context of
              the type signature for:
                fieldTagged :: forall (m :: * -> *) a.
                               Monad m =>
                               (FieldName -> Object -> m a) -> Object -> m a
        • In the expression: fail "Expected object with 1 field-named key"
          In a case alternative:
              _ -> fail "Expected object with 1 field-named key"
          In the expression:
            case HM.toList o of
              [(k, Object o')] -> f (FieldName k) o'
              _ -> fail "Expected object with 1 field-named key"
         |
    1626 |                     _ -> fail "Expected object with 1 field-named key"
         |
bitemyapp commented 4 years ago

I'd take a patch for this.