From c104ab358db94d9040cd694d675eadb60d593d89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szikszai=20Guszt=C3=A1v?= Date: Wed, 9 Aug 2023 05:25:12 +0200 Subject: [PATCH] Update documentation of `Object.Decode` functions (#626) --- core/source/Object/Decode.mint | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/source/Object/Decode.mint b/core/source/Object/Decode.mint index 5edc97bf1..85649fcf2 100644 --- a/core/source/Object/Decode.mint +++ b/core/source/Object/Decode.mint @@ -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, @@ -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, @@ -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, @@ -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})` @@ -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})` @@ -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})`