Skip to content

How do you create a decoder with an fp-ts Option field? #598

@fillon

Description

@fillon

Hi,

How do you create a decoder with an Option type?

import * as D from 'io-ts/lib/Decoder'
import * as O from 'fp-ts/lib/Option'

const Response = D.array(D.struct({
    ip: D.string,
    countryName: O.Option<string> <-- ??
}))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions