Coder Social home page Coder Social logo

autodocodec's Introduction

autodocodec's People

Contributors

a5ob7r avatar awjchen avatar daniel-chambers avatar dmoverton avatar joel-bach avatar kenranunderscore avatar mheinzel avatar michelk avatar norfairking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

autodocodec's Issues

Generic HasCodec

What do you think about adding a Generic deriving for HasCodec, with optional type level info to guide the instance creation.

data Example = Example
  { exampleTextField :: !Text,
    exampleIntField :: !Int
  }
  deriving stock (Show, Eq, Generic)
  deriving
    ( FromJSON, -- <- FromJSON instance for free.
      ToJSON, -- <- ToJSON instance for free.
      Swagger.ToSchema, -- <- Swagger schema for free.
      OpenAPI.ToSchema -- <- OpenAPI schema for free.
    )
    via (Autodocodec Example)
  deriving
    HasCodec via (Codec CodecExample Example)

type CodecExample =
  '[ Field "exampleTextField" "sample text field description" Required
   , Field "exampleIntField" "sample int field description" Required
   ]

I've done something similar to this on a project that is very similar to autodocodec.

UTCTime codec

Aeson has a lot of code for transcoding UTCTime, so I assume compatibility might be non-trivial, but something like might be a starting point:

instance HasCodec UTCTime where
  codec = bimapCodec fromText toText textCodec
    where
      fromText t = maybe (Left $ "can't parse time: " <> show t) Right . formatParseM iso8601Format $ T.unpack t
      toText = T.pack . formatShow iso8601Format  -- this is theoretically partial

Need help with conditional fields

I have a yaml where one fields dictates which other fields need to be present:

type: type1
field1_of_type1: foo
field2_of_type1: bar

If type has a different value, other fields need to be present:

type: type2
field1_of_type2: baz

In Haskell the data structure look like this:

data MyType where
     MyType :: (MyTypeClass a) => a -> MyType

-- I managed to write a FromJSON instance
instance FromJSON MyType where
    parseJSON = withObject "MyType" $ \o -> case H.lookup "type" o of
        Just (String "type1") -> MyType <$> type1Parser o
        Just (String "type2") -> MyType <$> type2Parser o

How would I translate this to autodocodec? I tried to use matchChoicesCodec, literalTextCodec or parseAlternatives but somehow got none of those to work.

Currently I have the following which does not compile:

type1Codec :: JSONObjectCodec Type1
type1Codec =
    Type1 <$> requiredField' "field1_of_type1"
        A..= field1
        <$> requiredField' "field2_of_type1"
        A..= field2

instance HasCodec MyType where
    codec =
        matchChoicesCodec
            [ (\o -> if lookup "type" o == Just (String "type1") then Just o else Nothing, type1Codec)
            ]
            (someFallBackCodec)

Fails to build with aeson 2

src/Autodocodec/Aeson/Encode.hs:52:33: error:
    • Couldn't match expected type ‘JSON.Key’ with actual type ‘Text’
    • In the first argument of ‘(JSON..=)’, namely ‘k’
      In the expression: k JSON..= go a c
      In a case alternative: RequiredKeyCodec k c _ -> k JSON..= go a c
   |
52 |       RequiredKeyCodec k c _ -> k JSON..= go a c
   |                                 ^

Arbitrary input validates against `Void` schema

Considering the test example in autodocodec-api-usage/test_resources/swagger-schema/either-void-bool.json, running that through a json schema validator seems to accept arbitrary input for the Left case, whereas I would expect the set of valid inputs to be empty.

either-void-bool.json, inlining definition "(Either Void Bool)":

{
  "properties": {
    "Left": {
      "additionalProperties": true
    },
    "Right": {
      "type": "boolean"
    }
  },
  "type": "object",
  "info": {
    "title": "",
    "version": ""
  },
  "paths": {},
  "swagger": "2.0"
}

Using https://www.jsonschemavalidator.net/, this appears to accept arbitrary input:
image

I would have expected something similar to:

{
  "properties": {
    "Left": {
      "additionalProperties": true,
      "not": {
        "anyOf": [
          {"type": "string"},
          {"type": "number"},
          {"type": "object"},
          {"type": "null"},
          {"type": "array"},
          {"type": "boolean"}
        ]
      }
    },
    "Right": {
      "type": "boolean"
    }
  },
  "type": "object",
  "info": {
    "title": "",
    "version": ""
  },
  "paths": {},
  "swagger": "2.0"
}

image

Which ought to reject any input.

I'd like to point out that I'm by no means an authority at interpreting openapi/jsonschema/..., but this behavior does seem wrong to me.

Recursive discriminated union ToSchema doc generation looping forever

I'm using discriminatedUnionCodec to create a discriminated union type, and then attempting to generate a ToSchema instance. However, upon loading up swagger in my app my app hangs in an infinite loop.

Profiling suggests this loop happens inside declareNamedSchemaVia, and I suspect it's because autodocodec doesn't realise my datatype is recursive.

My current code looks something like this:

data Predicate where
  And :: [Predicate] -> Predicate
  .
  .
  .

instance HasCodec Predicate where
  codec = object "predicate" $ objectCodec

instance HasObjectCodec Predicate where
  objectCodec = discriminatedUnionCodec "predicate" enc dec where

    enc :: Predicate -> (Discriminator, ObjectCodec Predicate ())
    enc = \case
      .
      .
      .
    dec :: HashMap Discriminator (Text, ObjectCodec Void Predicate)
    dec = HashMap.fromList [
      .
      .
      .
      ]

I think the issue is that the discriminatedUnionCodec expects ObjectCodec, but there doesn't seem to be a way to name an ObjectCodec. Both name and object have a result as a ValueCodec. But I can't put a ValueCodec into discriminatedUnionCodec, it's type signature requires ObjectCodec.

On the other hand, perhaps I'm just doing something wrong? Is there a way to have a recursive discriminated union that doesn't loop forever on ToSchema doc generation?

Sum type encoder in the README

I think it would be super useful to show in the readme how to make a schema for a sum type like e.g. data Color = Black | White that doesn't use DeriveGeneric. I imagine there must be an analogue of requiredField that takes a deserializer like HasSchema a => Text -> Either DeserializerErrorString a.

The readme currently shows how to product types, but it doesn't show sum types, which are also super important in Haskell.

How to use `oneOf` instead of `anyOf` for `eitherCodec`

Hey there,

I have the following codec:

data Ainur
  = Valar Text
  | Mayar Text
  deriving stock (Eq, Ord, Show, Generic)
  deriving (FromJSON, ToJSON, OpenAPI.ToSchema) via (Autodocodec Ainur)

instance HasCodec Ainur where
  codec =
    dimapCodec f g $
      eitherCodec
        (object "Valar" $ requiredField "domain" "Domain which the Valar rules over")
        (object "Mayar" $ requiredField "name" "Name of the Mayar")
    where
      f = \case
        Left domain -> Valar domain
        Right name -> Mayar name
      g = \case
        Valar domain -> Left domain
        Mayar name -> Right name

which generates the following OpenAPI 3 schema (the schemas for Valar and Mayar are omitted for brevity):

{
    "anyOf": [
        {
            "$ref": "#/components/schemas/Valar"
        },
        {
            "$ref": "#/components/schemas/Mayar"
        }
    ],
    "additionalProperties": true
}

The anyOf schema is not the one I am aiming for in this case as this implies that the following JSON object is valid:

{"domain":"Life","name":"Olorin"}

As the codec actually successfully decodes this object as Valar "Life", the current schema is correct for the codec but my question is now, if there is a way to define a codec which acts as a oneOf and rejects objects which contain additional properties (the resulting schema should not use additionalProperties either in that case). Thank you for your help!

Multi-line defaults

This example from dnscheck:

data CheckSpec = CheckSpec
  { specRetryPolicy :: !RetryPolicySpec,
    specChecks :: ![Check]
  }
  deriving stock (Show, Eq, Generic)
  deriving (FromJSON, ToJSON) via (Autodocodec CheckSpec)

instance Validity CheckSpec

instance HasCodec CheckSpec where
  codec =
    object "CheckSpec" $
      CheckSpec
        <$> optionalFieldWithDefault "retry-policy" defaultRetryPolicySpec "The retry policy for flaky checks due to network failures etc" .= specRetryPolicy
        <*> requiredField "checks" "The checks to perform" .= specChecks

data RetryPolicySpec = RetryPolicySpec
  { retryPolicySpecMaxRetries :: !Word,
    retryPolicySpecBaseDelay :: !Word
  }defaultRetryPolicySpec :: RetryPolicySpec
defaultRetryPolicySpec =
  RetryPolicySpec
    { retryPolicySpecMaxRetries = 10,
      retryPolicySpecBaseDelay = 100_000 -- 100 ms
    }
  deriving stock (Show, Eq, Generic)
  deriving (FromJSON, ToJSON) via (Autodocodec RetryPolicySpec)

instance Validity RetryPolicySpec

instance HasCodec RetryPolicySpec where
  codec =
    object "RetryPolicySpec" $
      RetryPolicySpec
        <$> optionalFieldWithDefault "max-retries" (retryPolicySpecMaxRetries defaultRetryPolicySpec) "The maximum number of retries" .= retryPolicySpecMaxRetries
        <*> optionalFieldWithDefault "base-delay" (retryPolicySpecBaseDelay defaultRetryPolicySpec) "The delay between the first and second try, in microseconds" .= retryPolicySpecBaseDelay
defaultRetryPolicySpec :: RetryPolicySpec
defaultRetryPolicySpec =
  RetryPolicySpec
    { retryPolicySpecMaxRetries = 10,
      retryPolicySpecBaseDelay = 100_000 -- 100 ms
    }

Has a multi-line default value.
The resulting schema looks like this;
default

Documentation on how to use type fields

Using a non-monadic parser means you cannot case-match on a field to determine what to parse next.
BUT we can still use type fields like this:

data NSCheck = NSCheck
  { nsCheckDomain :: !Domain,
    nsCheckAddresses :: ![Domain]
  }
  deriving stock (Show, Eq, Generic)
  deriving (FromJSON, ToJSON) via (Autodocodec NSCheck)

instance Validity NSCheck

instance HasCodec NSCheck where
  codec =
    object "NSCheck" $
      typeField "ns" NSCheck
        <*> domainField .= nsCheckDomain
        <*> singleOrListFieldWith "value" "values" domainCodec "domains" .= nsCheckAddresses

typeField :: Text -> a -> ObjectCodec b a
typeField typeName a =
  a <$ requiredFieldWith' "type" (literalTextCodec typeName) .= const typeName

This could be documented better.

Appetite for JSON Schema enhancements?

We're considering trialling autodocodec-schema for a project, but its validation support doesn't seem to do everything that we'd need. The Autodocodec.Schema.JSONSchema type notes "this schema roundtrips to JSON, but it cannot expres[s] everything that a fully-featured json-schema may be able to express". For autodocodec-schema to be more useful on our project, we'd want it to be able to:

  • Validate a Value against a schema which contains $refs to other schemas. This could mean adding a variant of validateAccordingTo which takes a Map SchemaURI JSONSchema and using it like the one inside the state monad inside validateAccordingTo.
  • Adding support for other validations described by JSON Schema Validation, like the "enum" and "const" keywords, etc.

Are these sort of uses in-scope for the design and goals of autodocodec-schema, and are you able to accept PRs for them if we ended up building on top of it?

Profunctor instance for `Codec`

I was about to write a Profunctor instance for Codec when I noticed that you have dimap, rmap, and lmap in the library already but no actual instance. Is there a reason you don't provide the instance?

`Void` codec?

Hi!

We have some data types that vary according to some type family:

type family T x
data D x = C1 (T x) | C2 Int

type instance T 'ThisWay = String
type instance T 'ThatWay = Void

Ideally, it would be great to be able to write instance HasCodec (T x) => HasCodec (D x), and have everything work merrily. However, I think we'd need HasCodec Void. Would you be against this? Would you be interested in a PR?

Thanks!
Tom

Incorrect openapi when using two `parseAlternative`s

It looks like the openapi output is incorrect when using multiple parseAlternatives.

We have the following code:

data UserIDWithExternalIDs = UserIDWithExternalIDs
  { userIDWithExternalIDsUserID :: !PublicID,
    userIDWithExternalIDsExternalIDs :: !ExternalIDs
  }
  deriving stock (Eq, Show, Generic)
  deriving (ToJSON, FromJSON, OpenAPI.ToSchema) via (Autodocodec UserIDWithExternalIDs)

instance HasCodec UserIDWithExternalIDs where
  codec =
    object "UserIDWithExternalIDs" $
      UserIDWithExternalIDs
        <$> parseAlternative (requiredField "userId" "User ID (backwards compatible)") (requiredField "userID" "User ID") .= userIDWithExternalIDsUserID
        <*> parseAlternative (requiredField "externalIds" "All external ids associated with this user (backwards compatible)") (requiredField "externalIDs" "All external ids associated with this user") .= userIDWithExternalIDsExternalIDs

data ExternalIDs = ...

Which produces the following openapi definition:

"UserIDWithExternalIDs": {
    "anyOf": [
        {
            "required": [
                "externalIds"
            ],
            "type": "object",
            "properties": {
                "externalIds": {
                    "$ref": "#/components/schemas/ExternalIDs"
                }
            }
        },
        {
            "required": [
                "externalIDs"
            ],
            "type": "object",
            "properties": {
                "externalIDs": {
                    "$ref": "#/components/schemas/ExternalIDs"
                }
            }
        }
    ],
    "additionalProperties": true
},

This does not include the userId as a field.

When I remove one of the parseAlternatives:

instance HasCodec UserIDWithExternalIDs where
  codec =
    object "UserIDWithExternalIDs" $
      UserIDWithExternalIDs
        <$> requiredField "userId" "User ID (backwards compatible)" .= userIDWithExternalIDsUserID -- no more parseAlternative here
        <*> parseAlternative (requiredField "externalIds" "External IDs (backwards compatible)") (requiredField "externalIDs" "External IDs") .= userIDWithExternalIDsExternalIDs

The openapi definition does include the userId:

"UserIDWithExternalIDs": {
    "anyOf": [
        {
            "required": [
                "externalIds"
            ],
            "type": "object",
            "properties": {
                "externalIds": {
                    "$ref": "#/components/schemas/ExternalIDs"
                }
            }
        },
        {
            "required": [
                "externalIDs"
            ],
            "type": "object",
            "properties": {
                "externalIDs": {
                    "$ref": "#/components/schemas/ExternalIDs"
                }
            }
        }
    ],
    "required": [
        "userId"
    ],
    "additionalProperties": true,
    "type": "object",
    "properties": {
        "userId": {
            "type": "string",
            "description": "User ID (backwards compatible)\n..."
        }
    }
},

Make schema order match declaration order?

Is it possible/advisable to change the associativity of something somewhere (possibly it's here?https://github.com/NorfairKing/autodocodec/blob/fa4d53e6c7694427c9d777b883fc446c4f3651b0/autodocodec-schema/src/Autodocodec/Schema.hs#LL396C1-L399C64) in a way that would result in the order that fields are listed in the JSON schema matching the order in which they are listed in the declaration of codecs like the one below? I understand that JSON is order-insensitive with regard to how these fields are arranged, but human editors aren't and editors prepopulate things according to the schema order.

instance HasCodec Example where
  codec =
    object "Example" $
      Example
        <$> requiredField "text" "documentation for the text field" .= exampleTextField
        <*> requiredField "int" "documentation for the int field" .= exampleIntField

Example in README doesn't compile

The example in the top-level README doesn't compile as it is. Could you please add the neccecary language extensions and imports? Thanks a lot.

aeson-2.2 incompatibity

autodocodec> [5 of 9] Compiling Autodocodec.Aeson.Encode ( src/Autodocodec/Aeson/Encode.hs, dist/build/Autodocodec/Aeson/Encode.o, dist/build/Autodocodec/Aeson/Encode.dyn_o )
autodocodec> src/Autodocodec/Aeson/Encode.hs:40:25: error: [GHC-83865]
autodocodec>     • Couldn't match expected type ‘JSON.Value’
autodocodec>                   with actual type ‘f2 v -> JSON.Value’
autodocodec>     • Probable cause: ‘JSON.liftToJSON’ is applied to too few arguments
autodocodec>       In the expression:
autodocodec>         JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In the expression:
autodocodec>         \case
autodocodec>           NullCodec -> JSON.Null
autodocodec>           BoolCodec _ -> toJSON (a :: Bool)
autodocodec>           StringCodec _ -> toJSON (a :: Text)
autodocodec>           NumberCodec _ _ -> toJSON (a :: Scientific)
autodocodec>           ArrayOfCodec _ c -> toJSON (fmap (`go` c) (a :: Vector _))
autodocodec>           ObjectOfCodec _ oc -> JSON.Object (goObject a oc)
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>           ValueCodec -> (a :: JSON.Value)
autodocodec>           EqCodec value c -> go value c
autodocodec>           BimapCodec _ g c -> go (g a) c
autodocodec>           EitherCodec _ c1 c2
autodocodec>             -> case (a :: Either _ _) of
autodocodec>                  Left a1 -> go a1 c1
autodocodec>                  Right a2 -> go a2 c2
autodocodec>           CommentCodec _ c -> go a c
autodocodec>           ReferenceCodec _ c -> go a c
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:40:20)
autodocodec>    |
autodocodec> 40 |       HashMapCodec c -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:40:42: error: [GHC-83865]
autodocodec>     • Couldn't match type ‘JSON.Value’ with ‘Bool’
autodocodec>       Expected: v -> Bool
autodocodec>         Actual: v -> JSON.Value
autodocodec>     • In the first argument of ‘JSON.liftToJSON’, namely ‘(`go` c)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |
autodocodec> 40 |       HashMapCodec c -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |                                          ^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:40:70: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: [v] -> JSON.Value
autodocodec>                   with actual type: HashMap k v
autodocodec>     • In the third argument of ‘JSON.liftToJSON’, namely
autodocodec>         ‘(a :: HashMap _ _)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:40:20)
autodocodec>    |
autodocodec> 40 |       HashMapCodec c -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |                                                                      ^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:41:21: error: [GHC-83865]
autodocodec>     • Couldn't match expected type ‘JSON.Value’
autodocodec>                   with actual type ‘f3 v -> JSON.Value’
autodocodec>     • Probable cause: ‘JSON.liftToJSON’ is applied to too few arguments
autodocodec>       In the expression:
autodocodec>         JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In the expression:
autodocodec>         \case
autodocodec>           NullCodec -> JSON.Null
autodocodec>           BoolCodec _ -> toJSON (a :: Bool)
autodocodec>           StringCodec _ -> toJSON (a :: Text)
autodocodec>           NumberCodec _ _ -> toJSON (a :: Scientific)
autodocodec>           ArrayOfCodec _ c -> toJSON (fmap (`go` c) (a :: Vector _))
autodocodec>           ObjectOfCodec _ oc -> JSON.Object (goObject a oc)
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>           ValueCodec -> (a :: JSON.Value)
autodocodec>           EqCodec value c -> go value c
autodocodec>           BimapCodec _ g c -> go (g a) c
autodocodec>           EitherCodec _ c1 c2
autodocodec>             -> case (a :: Either _ _) of
autodocodec>                  Left a1 -> go a1 c1
autodocodec>                  Right a2 -> go a2 c2
autodocodec>           CommentCodec _ c -> go a c
autodocodec>           ReferenceCodec _ c -> go a c
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:41:16)
autodocodec>    |
autodocodec> 41 |       MapCodec c -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:41:38: error: [GHC-83865]
autodocodec>     • Couldn't match type ‘JSON.Value’ with ‘Bool’
autodocodec>       Expected: v -> Bool
autodocodec>         Actual: v -> JSON.Value
autodocodec>     • In the first argument of ‘JSON.liftToJSON’, namely ‘(`go` c)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |
autodocodec> 41 |       MapCodec c -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |                                      ^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:41:66: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: [v] -> JSON.Value
autodocodec>                   with actual type: Map k v
autodocodec>     • In the third argument of ‘JSON.liftToJSON’, namely
autodocodec>         ‘(a :: Map _ _)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:41:16)
autodocodec>    |
autodocodec> 41 |       MapCodec c -> JSON.liftToJSON (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |                                                                  ^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:89:25: error: [GHC-83865]
autodocodec>     • Couldn't match type: f0 v -> JSON.Encoding
autodocodec>                      with: JSON.Encoding' JSON.Value
autodocodec>       Expected: JSON.Encoding
autodocodec>         Actual: f0 v -> JSON.Encoding
autodocodec>     • Probable cause: ‘JSON.liftToEncoding’ is applied to too few arguments
autodocodec>       In the expression:
autodocodec>         JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToEncoding
autodocodec>                  (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In the expression:
autodocodec>         \case
autodocodec>           NullCodec -> JSON.null_
autodocodec>           BoolCodec _ -> JSON.bool (a :: Bool)
autodocodec>           StringCodec _ -> JSON.text (a :: Text)
autodocodec>           NumberCodec _ _ -> JSON.scientific (a :: Scientific)
autodocodec>           ArrayOfCodec _ c -> JSON.list (`go` c) (V.toList (a :: Vector _))
autodocodec>           ObjectOfCodec _ oc -> JSON.pairs (goObject a oc)
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToEncoding
autodocodec>                  (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>           ValueCodec -> JSON.value (a :: JSON.Value)
autodocodec>           EqCodec value c -> go value c
autodocodec>           BimapCodec _ g c -> go (g a) c
autodocodec>           EitherCodec _ c1 c2
autodocodec>             -> case (a :: Either _ _) of
autodocodec>                  Left a1 -> go a1 c1
autodocodec>                  Right a2 -> go a2 c2
autodocodec>           CommentCodec _ c -> go a c
autodocodec>           ReferenceCodec _ c -> go a c
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:89:20)
autodocodec>    |
autodocodec> 89 |       HashMapCodec c -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:89:46: error: [GHC-83865]
autodocodec>     • Couldn't match type ‘JSON.Encoding' JSON.Value’ with ‘Bool’
autodocodec>       Expected: v -> Bool
autodocodec>         Actual: v -> JSON.Encoding
autodocodec>     • In the first argument of ‘JSON.liftToEncoding’, namely ‘(`go` c)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToEncoding
autodocodec>                  (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |
autodocodec> 89 |       HashMapCodec c -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |                                              ^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:89:74: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: [v] -> JSON.Encoding
autodocodec>                   with actual type: HashMap k v
autodocodec>     • In the third argument of ‘JSON.liftToEncoding’, namely
autodocodec>         ‘(a :: HashMap _ _)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToEncoding
autodocodec>                  (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:89:20)
autodocodec>    |
autodocodec> 89 |       HashMapCodec c -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>    |                                                                          ^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:90:21: error: [GHC-83865]
autodocodec>     • Couldn't match type: f1 v -> JSON.Encoding
autodocodec>                      with: JSON.Encoding' JSON.Value
autodocodec>       Expected: JSON.Encoding
autodocodec>         Actual: f1 v -> JSON.Encoding
autodocodec>     • Probable cause: ‘JSON.liftToEncoding’ is applied to too few arguments
autodocodec>       In the expression:
autodocodec>         JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In the expression:
autodocodec>         \case
autodocodec>           NullCodec -> JSON.null_
autodocodec>           BoolCodec _ -> JSON.bool (a :: Bool)
autodocodec>           StringCodec _ -> JSON.text (a :: Text)
autodocodec>           NumberCodec _ _ -> JSON.scientific (a :: Scientific)
autodocodec>           ArrayOfCodec _ c -> JSON.list (`go` c) (V.toList (a :: Vector _))
autodocodec>           ObjectOfCodec _ oc -> JSON.pairs (goObject a oc)
autodocodec>           HashMapCodec c
autodocodec>             -> JSON.liftToEncoding
autodocodec>                  (`go` c) (`go` listCodec c) (a :: HashMap _ _)
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>           ValueCodec -> JSON.value (a :: JSON.Value)
autodocodec>           EqCodec value c -> go value c
autodocodec>           BimapCodec _ g c -> go (g a) c
autodocodec>           EitherCodec _ c1 c2
autodocodec>             -> case (a :: Either _ _) of
autodocodec>                  Left a1 -> go a1 c1
autodocodec>                  Right a2 -> go a2 c2
autodocodec>           CommentCodec _ c -> go a c
autodocodec>           ReferenceCodec _ c -> go a c
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:90:16)
autodocodec>    |
autodocodec> 90 |       MapCodec c -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:90:42: error: [GHC-83865]
autodocodec>     • Couldn't match type ‘JSON.Encoding' JSON.Value’ with ‘Bool’
autodocodec>       Expected: v -> Bool
autodocodec>         Actual: v -> JSON.Encoding
autodocodec>     • In the first argument of ‘JSON.liftToEncoding’, namely ‘(`go` c)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |
autodocodec> 90 |       MapCodec c -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |                                          ^^^^^^
autodocodec> src/Autodocodec/Aeson/Encode.hs:90:70: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: [v] -> JSON.Encoding
autodocodec>                   with actual type: Map k v
autodocodec>     • In the third argument of ‘JSON.liftToEncoding’, namely
autodocodec>         ‘(a :: Map _ _)’
autodocodec>       In the expression:
autodocodec>         JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Encode.hs:90:16)
autodocodec>    |
autodocodec> 90 |       MapCodec c -> JSON.liftToEncoding (`go` c) (`go` listCodec c) (a :: Map _ _)
autodocodec>    |                                                                      ^^^^^^^^^^^^
autodocodec> [6 of 9] Compiling Autodocodec.Aeson.Decode ( src/Autodocodec/Aeson/Decode.hs, dist/build/Autodocodec/Aeson/Decode.o, dist/build/Autodocodec/Aeson/Decode.dyn_o )
autodocodec> src/Autodocodec/Aeson/Decode.hs:79:25: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: Parser (HashMap w1 w2)
autodocodec>                   with actual type: Value -> Parser (f0 [v])
autodocodec>     • Probable cause: ‘liftParseJSON’ is applied to too few arguments
autodocodec>       In the expression:
autodocodec>           liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>             Parser (HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (HashMap _ _)
autodocodec>       In the expression:
autodocodec>         \case
autodocodec>           NullCodec
autodocodec>             -> case (value :: Value) of
autodocodec>                  Null -> pure ()
autodocodec>                  _ -> typeMismatch "Null" value
autodocodec>           BoolCodec mname
autodocodec>             -> case mname of
autodocodec>                  Nothing -> parseJSON value
autodocodec>                  Just name -> withBool (T.unpack name) pure value
autodocodec>           StringCodec mname
autodocodec>             -> case mname of
autodocodec>                  Nothing -> parseJSON value
autodocodec>                  Just name -> withText (T.unpack name) pure value
autodocodec>           NumberCodec mname mBounds
autodocodec>             -> (\ f
autodocodec>                   -> case mname of
autodocodec>                        Nothing -> parseJSON value >>= f
autodocodec>                        Just name -> withScientific (T.unpack name) f value)
autodocodec>                  (\ s
autodocodec>                     -> case maybe Right checkNumberBounds mBounds s of
autodocodec>                          Left err -> fail err
autodocodec>                          Right s' -> pure s')
autodocodec>           ArrayOfCodec mname c
autodocodec>             -> (\ f
autodocodec>                   -> case mname of
autodocodec>                        Nothing -> parseJSON value >>= f
autodocodec>                        Just name -> withArray (T.unpack name) f value)
autodocodec>                  (\ vector
autodocodec>                     -> forM
autodocodec>                          (V.indexed (vector :: Vector Value))
autodocodec>                          (\ (ix, v) -> go v c JSON.<?> Index ix))
autodocodec>           ObjectOfCodec mname c
autodocodec>             -> (\ f
autodocodec>                   -> case mname of
autodocodec>                        Nothing -> parseJSON value >>= f
autodocodec>                        Just name -> withObject (T.unpack name) f value)
autodocodec>                  (\ object_ -> (`go` c) (object_ :: Object))
autodocodec>           HashMapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (HashMap _ _)
autodocodec>           MapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (Map _ _)
autodocodec>           ValueCodec -> pure (value :: Value)
autodocodec>           EqCodec expected c
autodocodec>             -> do actual <- go value c
autodocodec>                   if expected == actual then pure actual else fail $ unwords ...
autodocodec>           BimapCodec f _ c
autodocodec>             -> do old <- go value c
autodocodec>                   case f old of
autodocodec>                     Left err -> ...
autodocodec>                     Right new -> ...
autodocodec>           EitherCodec u c1 c2
autodocodec>             -> let
autodocodec>                  leftParser v = ...
autodocodec>                  ....
autodocodec>                in
autodocodec>                  case u of
autodocodec>                    PossiblyJointUnion -> ...
autodocodec>                    DisjointUnion -> ...
autodocodec>           DiscriminatedUnionCodec propertyName _ m
autodocodec>             -> do discriminatorValue <- (value :: Object)
autodocodec>                                           .: Compat.toKey propertyName
autodocodec>                   case HashMap.lookup discriminatorValue m of
autodocodec>                     Nothing -> ...
autodocodec>                     Just (_, c) -> ...
autodocodec>           CommentCodec _ c -> go value c
autodocodec>           ReferenceCodec _ c -> go value c
autodocodec>           RequiredKeyCodec k c _
autodocodec>             -> do valueAtKey <- (value :: Object) .: Compat.toKey k
autodocodec>                   go valueAtKey c JSON.<?> Key (Compat.toKey k)
autodocodec>           OptionalKeyCodec k c _
autodocodec>             -> do let ...
autodocodec>                   forM mValueAtKey $ \ valueAtKey -> ...
autodocodec>           OptionalKeyWithDefaultCodec k c defaultValue _
autodocodec>             -> do let ...
autodocodec>                   case mValueAtKey of
autodocodec>                     Nothing -> ...
autodocodec>                     Just valueAtKey -> ...
autodocodec>           OptionalKeyWithOmittedDefaultCodec k c defaultValue mDoc
autodocodec>             -> go value $ OptionalKeyWithDefaultCodec k c defaultValue mDoc
autodocodec>           PureCodec a -> pure a
autodocodec>           ApCodec ocf oca
autodocodec>             -> go (value :: Object) ocf <*> go (value :: Object) oca
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:79:20)
autodocodec>    |
autodocodec> 79 |       HashMapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (HashMap _ _)
autodocodec>    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Decode.hs:79:40: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: Maybe [v]
autodocodec>                   with actual type: Value -> Parser v
autodocodec>     • In the first argument of ‘liftParseJSON’, namely ‘(`go` c)’
autodocodec>       In the expression:
autodocodec>           liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>             Parser (HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (HashMap _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:79:20)
autodocodec>    |
autodocodec> 79 |       HashMapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (HashMap _ _)
autodocodec>    |                                        ^^^^^^
autodocodec> src/Autodocodec/Aeson/Decode.hs:79:67: error: [GHC-83865]
autodocodec>     • Couldn't match type ‘Value’ with ‘Value -> Parser [[v]]’
autodocodec>       Expected: Value -> Parser [[v]]
autodocodec>         Actual: context1
autodocodec>     • In the third argument of ‘liftParseJSON’, namely ‘value’
autodocodec>       In the expression:
autodocodec>           liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>             Parser (HashMap _ _)
autodocodec>       In a \case alternative:
autodocodec>           HashMapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (HashMap _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:79:20)
autodocodec>    |
autodocodec> 79 |       HashMapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (HashMap _ _)
autodocodec>    |                                                                   ^^^^^
autodocodec> src/Autodocodec/Aeson/Decode.hs:80:21: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: Parser (Map w1 w2)
autodocodec>                   with actual type: Value -> Parser (f1 [v])
autodocodec>     • Probable cause: ‘liftParseJSON’ is applied to too few arguments
autodocodec>       In the expression:
autodocodec>           liftParseJSON (`go` c) (`go` listCodec c) value :: Parser (Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (Map _ _)
autodocodec>       In the expression:
autodocodec>         \case
autodocodec>           NullCodec
autodocodec>             -> case (value :: Value) of
autodocodec>                  Null -> pure ()
autodocodec>                  _ -> typeMismatch "Null" value
autodocodec>           BoolCodec mname
autodocodec>             -> case mname of
autodocodec>                  Nothing -> parseJSON value
autodocodec>                  Just name -> withBool (T.unpack name) pure value
autodocodec>           StringCodec mname
autodocodec>             -> case mname of
autodocodec>                  Nothing -> parseJSON value
autodocodec>                  Just name -> withText (T.unpack name) pure value
autodocodec>           NumberCodec mname mBounds
autodocodec>             -> (\ f
autodocodec>                   -> case mname of
autodocodec>                        Nothing -> parseJSON value >>= f
autodocodec>                        Just name -> withScientific (T.unpack name) f value)
autodocodec>                  (\ s
autodocodec>                     -> case maybe Right checkNumberBounds mBounds s of
autodocodec>                          Left err -> fail err
autodocodec>                          Right s' -> pure s')
autodocodec>           ArrayOfCodec mname c
autodocodec>             -> (\ f
autodocodec>                   -> case mname of
autodocodec>                        Nothing -> parseJSON value >>= f
autodocodec>                        Just name -> withArray (T.unpack name) f value)
autodocodec>                  (\ vector
autodocodec>                     -> forM
autodocodec>                          (V.indexed (vector :: Vector Value))
autodocodec>                          (\ (ix, v) -> go v c JSON.<?> Index ix))
autodocodec>           ObjectOfCodec mname c
autodocodec>             -> (\ f
autodocodec>                   -> case mname of
autodocodec>                        Nothing -> parseJSON value >>= f
autodocodec>                        Just name -> withObject (T.unpack name) f value)
autodocodec>                  (\ object_ -> (`go` c) (object_ :: Object))
autodocodec>           HashMapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (HashMap _ _)
autodocodec>           MapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (Map _ _)
autodocodec>           ValueCodec -> pure (value :: Value)
autodocodec>           EqCodec expected c
autodocodec>             -> do actual <- go value c
autodocodec>                   if expected == actual then pure actual else fail $ unwords ...
autodocodec>           BimapCodec f _ c
autodocodec>             -> do old <- go value c
autodocodec>                   case f old of
autodocodec>                     Left err -> ...
autodocodec>                     Right new -> ...
autodocodec>           EitherCodec u c1 c2
autodocodec>             -> let
autodocodec>                  leftParser v = ...
autodocodec>                  ....
autodocodec>                in
autodocodec>                  case u of
autodocodec>                    PossiblyJointUnion -> ...
autodocodec>                    DisjointUnion -> ...
autodocodec>           DiscriminatedUnionCodec propertyName _ m
autodocodec>             -> do discriminatorValue <- (value :: Object)
autodocodec>                                           .: Compat.toKey propertyName
autodocodec>                   case HashMap.lookup discriminatorValue m of
autodocodec>                     Nothing -> ...
autodocodec>                     Just (_, c) -> ...
autodocodec>           CommentCodec _ c -> go value c
autodocodec>           ReferenceCodec _ c -> go value c
autodocodec>           RequiredKeyCodec k c _
autodocodec>             -> do valueAtKey <- (value :: Object) .: Compat.toKey k
autodocodec>                   go valueAtKey c JSON.<?> Key (Compat.toKey k)
autodocodec>           OptionalKeyCodec k c _
autodocodec>             -> do let ...
autodocodec>                   forM mValueAtKey $ \ valueAtKey -> ...
autodocodec>           OptionalKeyWithDefaultCodec k c defaultValue _
autodocodec>             -> do let ...
autodocodec>                   case mValueAtKey of
autodocodec>                     Nothing -> ...
autodocodec>                     Just valueAtKey -> ...
autodocodec>           OptionalKeyWithOmittedDefaultCodec k c defaultValue mDoc
autodocodec>             -> go value $ OptionalKeyWithDefaultCodec k c defaultValue mDoc
autodocodec>           PureCodec a -> pure a
autodocodec>           ApCodec ocf oca
autodocodec>             -> go (value :: Object) ocf <*> go (value :: Object) oca
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:80:16)
autodocodec>    |
autodocodec> 80 |       MapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (Map _ _)
autodocodec>    |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
autodocodec> src/Autodocodec/Aeson/Decode.hs:80:36: error: [GHC-83865]
autodocodec>     • Couldn't match expected type: Maybe [v]
autodocodec>                   with actual type: Value -> Parser v
autodocodec>     • In the first argument of ‘liftParseJSON’, namely ‘(`go` c)’
autodocodec>       In the expression:
autodocodec>           liftParseJSON (`go` c) (`go` listCodec c) value :: Parser (Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (Map _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:80:16)
autodocodec>    |
autodocodec> 80 |       MapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (Map _ _)
autodocodec>    |                                    ^^^^^^
autodocodec> src/Autodocodec/Aeson/Decode.hs:80:63: error: [GHC-83865]
autodocodec>     • Couldn't match type ‘Value’ with ‘Value -> Parser [[v]]’
autodocodec>       Expected: Value -> Parser [[v]]
autodocodec>         Actual: context1
autodocodec>     • In the third argument of ‘liftParseJSON’, namely ‘value’
autodocodec>       In the expression:
autodocodec>           liftParseJSON (`go` c) (`go` listCodec c) value :: Parser (Map _ _)
autodocodec>       In a \case alternative:
autodocodec>           MapCodec c
autodocodec>             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
autodocodec>                  Parser (Map _ _)
autodocodec>     • Relevant bindings include
autodocodec>         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:80:16)
autodocodec>    |
autodocodec> 80 |       MapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (Map _ _)
autodocodec>    |                                                               ^^^^^
autodocodec> [9 of 9] Compiling Paths_autodocodec ( dist/build/autogen/Paths_autodocodec.hs, dist/build/Paths_autodocodec.o, dist/build/Paths_autodocodec.dyn_o )
error: builder for '/nix/store/842kg44cwi3x0riw4zvasjcpra2910an-autodocodec-0.2.0.3.drv' failed with exit code 1;
       last 10 log lines:
       >       In a \case alternative:
       >           MapCodec c
       >             -> liftParseJSON (`go` c) (`go` listCodec c) value ::
       >                  Parser (Map _ _)
       >     • Relevant bindings include
       >         c :: JSONCodec v (bound at src/Autodocodec/Aeson/Decode.hs:80:16)
       >    |
       > 80 |       MapCodec c -> liftParseJSON (`go` c) (`go` listCodec c) value :: JSON.Parser (Map _ _)
       >    |                                                               ^^^^^
       > [9 of 9] Compiling Paths_autodocodec ( dist/build/autogen/Paths_autodocodec.hs, dist/build/Paths_autodocodec.o, dist/build/Paths_autodocodec.dyn_o )

caught by https://gitlab.horizon-haskell.net/package-sets/horizon-core/-/jobs/426081

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.