ocramz / aeson-schema

Haskell JSON schema validator and parser generator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Tests still broken

Profpatsch opened this issue · comments

test/Data/Aeson/Schema/Examples.hs:20:30: error:
    • No instance for (MonadFail (Either a0))
        arising from a use of ‘mkPattern’
    • In the expression: mkPattern (Data.Text.pack ".+String$")
      In a pattern binding:
        Right p = mkPattern (Data.Text.pack ".+String$")
      In the expression:
        let Right p_ai47 = mkPattern (Data.Text.pack ".+String$") in p_ai47
   |
20 |       let schema = [schemaQQ| {
   |                              ^^...

test/Data/Aeson/Schema/Examples.hs:20:30: error:
    • No instance for (MonadFail (Either a1))
        arising from a use of ‘mkPattern’
    • In the expression: mkPattern (Data.Text.pack ".+Number$")
      In a pattern binding:
        Right p = mkPattern (Data.Text.pack ".+Number$")
      In the expression:
        let Right p_ai48 = mkPattern (Data.Text.pack ".+Number$") in p_ai48
   |
20 |       let schema = [schemaQQ| {
   |                              ^^...

test/Data/Aeson/Schema/Examples.hs:40:41: error:
    • No instance for (MonadFail (Either a2))
        arising from a use of ‘mkPattern’
    • In the expression: mkPattern (Data.Text.pack ".+String$")
      In a pattern binding:
        Right p = mkPattern (Data.Text.pack ".+String$")
      In the expression:
        let Right p_apIO = mkPattern (Data.Text.pack ".+String$") in p_apIO
   |
40 |       let additionalNumbers = [schemaQQ| {
   |                                         ^^...

test/Data/Aeson/Schema/Examples.hs:55:46: error:
    • No instance for (MonadFail (Either a3))
        arising from a use of ‘mkPattern’
    • In the expression: mkPattern (Data.Text.pack ".+String$")
      In a pattern binding:
        Right p = mkPattern (Data.Text.pack ".+String$")
      In the expression:
        let Right p_apJp = mkPattern (Data.Text.pack ".+String$") in p_apJp
   |
55 |       let noAdditionalProperties = [schemaQQ| {
   |                                              ^^...

test/Data/Aeson/Schema/Examples.hs:154:30: error:
    • No instance for (MonadFail (Either a4))
        arising from a use of ‘mkPattern’
    • In the expression: mkPattern (Data.Text.pack "^[a-z]$")
      In a pattern binding:
        Right p = mkPattern (Data.Text.pack "^[a-z]$")
      In the expression:
        let Right p_apQs = mkPattern (Data.Text.pack "^[a-z]$") in p_apQs
    |
154 |       let schema = [schemaQQ| {
    |                              ^^...

fwiw I think tests don't all pass even when they've been compiling but Inmaybbe misremembering...

Since this error is only due to the tests using Either, and we cannot avoid the MonadFail constraint since it is due to makeRegexM, I suggest we switch to Nothing.

We could also make newtype Error a = Error (Either String a) which we can write MonadFail for if we want to. Whatever works though.

For posterity, this shows up when compiling against GHC 8.8.1 e.g. see these CI logs : https://github.com/ocramz/aeson-schema/runs/6031979441?check_suite_focus=true#step:4:1082