Skip to content

Change the implementation of optional #131

@mlms13

Description

@mlms13

Now that we have a null decoder, we can decode optional values as:

let optional =
  decoder => alt(null |> map(() => None), decoder |> map(Option.pure))

See #124

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions