@@ -385,7 +385,7 @@ pub fn run(data: Dynamic, decoder: Decoder(t)) -> Result(t, List(DecodeError)) {
385385/// ```
386386///
387387/// ```gleam
388- /// dynamic.from(Nil )
388+ /// dynamic.nil( )
389389/// |> decode.run(decode.optional(decode.int))
390390/// // -> Ok(option.None)
391391/// ```
@@ -621,7 +621,7 @@ fn run_dynamic_function(
621621/// # Examples
622622///
623623/// ```gleam
624- /// let result = decode.run(dynamic.from ("Hello!"), decode.string)
624+ /// let result = decode.run(dynamic.string ("Hello!"), decode.string)
625625/// assert result == Ok("Hello!")
626626/// ```
627627///
@@ -648,7 +648,7 @@ fn dynamic_string(from data: Dynamic) -> Result(String, String) {
648648/// # Examples
649649///
650650/// ```gleam
651- /// let result = decode.run(dynamic.from (True), decode.bool)
651+ /// let result = decode.run(dynamic.bool (True), decode.bool)
652652/// assert result == Ok(True)
653653/// ```
654654///
@@ -670,7 +670,7 @@ fn decode_bool(data: Dynamic) -> #(Bool, List(DecodeError)) {
670670/// # Examples
671671///
672672/// ```gleam
673- /// let result = decode.run(dynamic.from (147), decode.int)
673+ /// let result = decode.run(dynamic.int (147), decode.int)
674674/// assert result == Ok(147)
675675/// ```
676676///
@@ -689,7 +689,7 @@ fn dynamic_int(data: Dynamic) -> Result(Int, Int)
689689/// # Examples
690690///
691691/// ```gleam
692- /// let result = decode.run(dynamic.from (3.14), decode.float)
692+ /// let result = decode.run(dynamic.float (3.14), decode.float)
693693/// assert result == Ok(3.14)
694694/// ```
695695///
@@ -708,8 +708,8 @@ fn dynamic_float(data: Dynamic) -> Result(Float, Float)
708708/// # Examples
709709///
710710/// ```gleam
711- /// let result = decode.run(dynamic.from (3.14), decode.dynamic)
712- /// assert result == Ok(dynamic.from (3.14))
711+ /// let result = decode.run(dynamic.float (3.14), decode.dynamic)
712+ /// assert result == Ok(dynamic.float (3.14))
713713/// ```
714714///
715715pub const dynamic : Decoder ( Dynamic ) = Decoder ( decode_dynamic )
@@ -723,7 +723,7 @@ fn decode_dynamic(data: Dynamic) -> #(Dynamic, List(DecodeError)) {
723723/// # Examples
724724///
725725/// ```gleam
726- /// let result = decode.run(dynamic.from (<<5, 7>>), decode.bit_array)
726+ /// let result = decode.run(dynamic.bit_array (<<5, 7>>), decode.bit_array)
727727/// assert result == Ok(<<5, 7>>)
728728/// ```
729729///
@@ -744,7 +744,10 @@ fn dynamic_bit_array(data: Dynamic) -> Result(BitArray, BitArray)
744744///
745745/// ```gleam
746746/// let result =
747- /// decode.run(dynamic.from([1, 2, 3]), decode.list(of: decode.int))
747+ /// [1, 2, 3]
748+ /// |> list.map(dynamic.int)
749+ /// |> dynamic.list
750+ /// |> decode.run(decode.list(of: decode.int))
748751/// assert result == Ok([1, 2, 3])
749752/// ```
750753///
@@ -770,13 +773,13 @@ fn decode_list(
770773/// # Examples
771774///
772775/// ```gleam
773- /// let values = dict.from_list ([
774- /// #("one", 1 ),
775- /// #("two", 2 ),
776+ /// let values = dynamic.properties ([
777+ /// #(dynamic.string( "one"), dynamic.int(1) ),
778+ /// #(dynamic.string( "two"), dynamic.int(2) ),
776779/// ])
777780///
778781/// let result =
779- /// decode.run(dynamic.from( values) , decode.dict(decode.string, decode.int))
782+ /// decode.run(values, decode.dict(decode.string, decode.int))
780783/// assert result == Ok(values)
781784/// ```
782785///
@@ -837,12 +840,12 @@ fn decode_dict(data: Dynamic) -> Result(Dict(Dynamic, Dynamic), Nil)
837840/// # Examples
838841///
839842/// ```gleam
840- /// let result = decode.run(dynamic.from (100), decode.optional(decode.int))
843+ /// let result = decode.run(dynamic.int (100), decode.optional(decode.int))
841844/// assert result == Ok(option.Some(100))
842845/// ```
843846///
844847/// ```gleam
845- /// let result = decode.run(dynamic.from(Nil ), decode.optional(decode.int))
848+ /// let result = decode.run(dynamic.nil( ), decode.optional(decode.int))
846849/// assert result == Ok(option.None)
847850/// ```
848851///
@@ -864,7 +867,7 @@ pub fn optional(inner: Decoder(a)) -> Decoder(Option(a)) {
864867///
865868/// ```gleam
866869/// let decoder = decode.int |> decode.map(int.to_string)
867- /// let result = decode.run(dynamic.from (1000), decoder)
870+ /// let result = decode.run(dynamic.int (1000), decoder)
868871/// assert result == Ok("1000")
869872/// ```
870873///
@@ -897,7 +900,7 @@ pub fn map_errors(
897900///
898901/// ```gleam
899902/// let decoder = decode.string |> decode.collapse_errors("MyThing")
900- /// let result = decode.run(dynamic.from (1000), decoder)
903+ /// let result = decode.run(dynamic.int (1000), decoder)
901904/// assert result == Error([DecodeError("MyThing", "Int", [])])
902905/// ```
903906///
@@ -941,7 +944,7 @@ pub fn then(decoder: Decoder(a), next: fn(a) -> Decoder(b)) -> Decoder(b) {
941944/// decode.int |> decode.map(int.to_string),
942945/// decode.float |> decode.map(float.to_string),
943946/// ])
944- /// decode.run(dynamic.from (1000), decoder)
947+ /// decode.run(dynamic.int (1000), decoder)
945948/// // -> Ok("1000")
946949/// ```
947950///
0 commit comments