Legend:
Library
Module
Module type
Parameter
Class
Class type
Library
Module
Module type
Parameter
Class
Class type
All user defined decoders conform to the module signature decoder.
For e.g.
module Fruit = struct
type t =
| Apple
| Orange
| Pineapple
let t : t Wtr.decoder =
Wtr.create_decoder ~name:"fruit" ~decode:(function
| "apple" -> Some Apple
| "orange" -> Some Orange
| "pineapple" -> Some Pineapple
| _ -> None)
end