Provides methods commonly declared by companion objects for specialised decoder types.
Most libraries that use kantan.codecs will declare type aliases for decoders - CellDecoder in kantan.csv, for example. DecoderCompanion lets such types have a useful companion object without a lot of code duplication.
Creates a new Decoder instance from the specified function.
Creates a new Decoder instance from the specified function.
This method turns the specified function safe. The error message might end up being a bit generic though - use from if you want to deal with errors explicitly.