Skip to content

Decoder for Maybe a #1

@karls

Description

@karls

Hi!

I've been playing around with this library to see if I can reduce the burden of defining decoders for my Hasql queries. So far, it's been promising! However, I can't seem to find a way to write an instance for Decodable (Maybe a) to signify nullable values returned by a query (using LEFT OUTER JOIN for example).

I don't know much about GHC Generics, so I've been fumbling in the dark for a while. Ideally, I'd like to define something like instance (Decodable a) => Decodable (Maybe a), but after trying various approaches, I'm stuck. Am I missing something obvious? Is there a way to define such an instance?

Thanks!

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