Skip to content

Decoding 'Maybe Whatever' with .: doesn't throw an error at compile time #614

Closed
@kvanbere

Description

@kvanbere

Decoding 'Maybe Whatever' with (.:) doesn't throw an error at compile time. It just lets you know that it fails at run time, throwing an error instead of returning Nothing when the key doesn't exist.

This really isn't ideal. Could the API be 'safe-by-default' and only allow you to decode Maybe Whatever with (.:?) and not (.:) ? In my use cases I've never wanted to fail at runtime if the key doesn't exist and I intended to decode 'Maybe Whatever' but forgot to update the FromJSON instance.

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