Skip to content

Commit

Permalink
Update documentation of Object.Decode functions (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdotdesign authored Aug 9, 2023
1 parent 2ee1c70 commit c104ab3
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions core/source/Object/Decode.mint
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Object.Decode {
/*
Decodes the object as an `Array` using the given decoder.
Object.Decode.array(`["A", "B"]`, Object.Decode.string, ) == Result::Ok(["a", "b"])
Object.Decode.array(`["A", "B"]`, Object.Decode.string) == Result::Ok(["a", "b"])
*/
fun array (
input : Object,
Expand All @@ -25,7 +25,7 @@ module Object.Decode {
Decodes a field from an object using the given decoder.
Object.Decode.field(
"field", Object.Decode.string, `{field: "Value"}`) == Result::Ok("Value")
`{field: "Value"}`, "field", Object.Decode.string) == Result::Ok("Value")
*/
fun field (
input : Object,
Expand All @@ -38,8 +38,8 @@ module Object.Decode {
/*
Decodes the object as a `Maybe(a)` using the given decoder.
Object.Decode.maybe(Object.Decode.String, `"A"`) == Result::Ok(Maybe::Just("A"))
Object.Decode.maybe(Object.Decode.String, `null`) == Result::Ok(Maybe::Nothing)
Object.Decode.maybe(`"A"`, Object.Decode.String) == Result::Ok(Maybe::Just("A"))
Object.Decode.maybe(`null`, Object.Decode.String) == Result::Ok(Maybe::Nothing)
*/
fun maybe (
input : Object,
Expand All @@ -51,7 +51,7 @@ module Object.Decode {
/*
Decodes the object as a `Number`
Object.Decode.boolean(`0`) == Result::Ok(0)
Object.Decode.number(`0`) == Result::Ok(0)
*/
fun number (input : Object) : Result(Object.Error, Number) {
`Decoder.number(#{input})`
Expand All @@ -60,7 +60,7 @@ module Object.Decode {
/*
Decodes the object as a `String`
Object.Decode.boolean(`"A"`) == Result::Ok("A")
Object.Decode.string(`"A"`) == Result::Ok("A")
*/
fun string (input : Object) : Result(Object.Error, String) {
`Decoder.string(#{input})`
Expand All @@ -69,7 +69,7 @@ module Object.Decode {
/*
Decodes the object as a `Time`
Object.Decode.boolean(`"new Date()"`)
Object.Decode.time(`"new Date()"`)
*/
fun time (input : Object) : Result(Object.Error, Time) {
`Decoder.time(#{input})`
Expand Down

0 comments on commit c104ab3

Please sign in to comment.