@@ -14,12 +14,12 @@ pub external type Dynamic
1414pub type Decoder ( t) =
1515 fn ( Dynamic ) -> Result ( t, String )
1616
17- /// Convert any Gleam data into `Dynamic` data.
17+ /// Converts any Gleam data into `Dynamic` data.
1818///
1919pub external fn from ( a) -> Dynamic =
2020 "gleam_stdlib" "identity"
2121
22- /// Unsafely cast a Dynamic value into any other type.
22+ /// Unsafely casts a Dynamic value into any other type.
2323///
2424/// This is an escape hatch for the type system that may be useful when wrapping
2525/// native Erlang APIs. It is to be used as a last measure only!
@@ -29,7 +29,7 @@ pub external fn from(a) -> Dynamic =
2929pub external fn unsafe_coerce ( Dynamic ) -> a =
3030 "gleam_stdlib" "identity"
3131
32- /// Check to see whether a Dynamic value is a bit_string, and return the bit_string if
32+ /// Checks to see whether a Dynamic value is a bit_string, and return the bit_string if
3333/// it is.
3434///
3535/// ## Examples
@@ -43,7 +43,7 @@ pub external fn unsafe_coerce(Dynamic) -> a =
4343pub external fn bit_string ( from : Dynamic ) -> Result ( BitString , String ) =
4444 "gleam_stdlib" "decode_bit_string"
4545
46- /// Check to see whether a Dynamic value is a string, and return the string if
46+ /// Checks to see whether a Dynamic value is a string, and return the string if
4747/// it is.
4848///
4949/// ## Examples
@@ -64,7 +64,7 @@ pub fn string(from: Dynamic) -> Result(String, String) {
6464 } )
6565}
6666
67- /// Check to see whether a Dynamic value is an int, and return the int if it
67+ /// Checks to see whether a Dynamic value is an int, and return the int if it
6868/// is.
6969///
7070/// ## Examples
@@ -78,7 +78,7 @@ pub fn string(from: Dynamic) -> Result(String, String) {
7878pub external fn int ( from : Dynamic ) -> Result ( Int , String ) =
7979 "gleam_stdlib" "decode_int"
8080
81- /// Check to see whether a Dynamic value is an float, and return the float if
81+ /// Checks to see whether a Dynamic value is an float, and return the float if
8282/// it is.
8383///
8484/// ## Examples
@@ -92,7 +92,7 @@ pub external fn int(from: Dynamic) -> Result(Int, String) =
9292pub external fn float ( from : Dynamic ) -> Result ( Float , String ) =
9393 "gleam_stdlib" "decode_float"
9494
95- /// Check to see whether a Dynamic value is an atom, and return the atom if
95+ /// Checks to see whether a Dynamic value is an atom, and return the atom if
9696/// it is.
9797///
9898/// ## Examples
@@ -107,7 +107,7 @@ pub external fn float(from: Dynamic) -> Result(Float, String) =
107107pub external fn atom ( from : Dynamic ) -> Result ( atom . Atom , String ) =
108108 "gleam_stdlib" "decode_atom"
109109
110- /// Check to see whether a Dynamic value is an bool, and return the bool if
110+ /// Checks to see whether a Dynamic value is an bool, and return the bool if
111111/// it is.
112112///
113113/// ## Examples
@@ -121,7 +121,7 @@ pub external fn atom(from: Dynamic) -> Result(atom.Atom, String) =
121121pub external fn bool ( from : Dynamic ) -> Result ( Bool , String ) =
122122 "gleam_stdlib" "decode_bool"
123123
124- /// Check to see whether a Dynamic value is a function that takes no arguments,
124+ /// Checks to see whether a Dynamic value is a function that takes no arguments,
125125/// and return the function if it is.
126126///
127127/// ## Examples
@@ -137,7 +137,7 @@ pub external fn bool(from: Dynamic) -> Result(Bool, String) =
137137pub external fn thunk ( from : Dynamic ) -> Result ( fn ( ) -> Dynamic , String ) =
138138 "gleam_stdlib" "decode_thunk"
139139
140- /// Check to see whether a Dynamic value is a list, and return the list if it
140+ /// Checks to see whether a Dynamic value is a list, and return the list if it
141141/// is.
142142///
143143/// If you wish to decode all the elements in the list use the `typed_list`
@@ -154,7 +154,7 @@ pub external fn thunk(from: Dynamic) -> Result(fn() -> Dynamic, String) =
154154pub external fn list ( from : Dynamic ) -> Result ( List ( Dynamic ) , String ) =
155155 "gleam_stdlib" "decode_list"
156156
157- /// Check to see whether a Dynamic value is a result, and return the result if
157+ /// Checks to see whether a Dynamic value is a result, and return the result if
158158/// it is
159159///
160160/// ## Examples
@@ -188,7 +188,7 @@ pub fn result(from: Dynamic) -> Result(Result(Dynamic, Dynamic), String) {
188188 }
189189}
190190
191- /// Check to see whether a Dynamic value is a result of a particular type, and
191+ /// Checks to see whether a Dynamic value is a result of a particular type, and
192192/// return the result if it is
193193///
194194/// The `ok` and `error` arguments are decoders for decoding the `Ok` and
@@ -224,7 +224,7 @@ pub fn typed_result(
224224 }
225225}
226226
227- /// Check to see whether a Dynamic value is a list of a particular type, and
227+ /// Checks to see whether a Dynamic value is a list of a particular type, and
228228/// return the list if it is.
229229///
230230/// The second argument is a decoder function used to decode the elements of
@@ -254,7 +254,7 @@ pub fn typed_list(
254254 |> result.then(list.try_map(_, decoder_type))
255255}
256256
257- /// Check to see if a Dynamic value is an Option of a particular type, and return
257+ /// Checks to see if a Dynamic value is an Option of a particular type, and return
258258/// the Option if it is.
259259///
260260/// The second argument is a decoder function used to decode the elements of
@@ -284,7 +284,7 @@ pub fn option(
284284 }
285285}
286286
287- /// Check to see if a Dynamic value is a map with a specific field, and return
287+ /// Checks to see if a Dynamic value is a map with a specific field, and return
288288/// the value of the field if it is.
289289///
290290/// This will not succeed on a record.
@@ -301,7 +301,7 @@ pub fn option(
301301pub external fn field(from: Dynamic, named: a) -> Result(Dynamic, String) =
302302 "gleam_stdlib" "decode_field"
303303
304- /// Check to see if the Dynamic value is a tuple large enough to have a certain
304+ /// Checks to see if the Dynamic value is a tuple large enough to have a certain
305305/// index, and return the value of that index if it is.
306306///
307307/// ## Examples
@@ -318,7 +318,7 @@ pub external fn field(from: Dynamic, named: a) -> Result(Dynamic, String) =
318318pub external fn element(from: Dynamic, position: Int) -> Result(Dynamic, String) =
319319 "gleam_stdlib" "decode_element"
320320
321- /// Check to see if the Dynamic value is a 2 element tuple.
321+ /// Checks to see if the Dynamic value is a 2 element tuple.
322322///
323323/// If you do not wish to decode all the elements in the tuple use the
324324/// `typed_tuple2` function instead.
@@ -337,7 +337,7 @@ pub external fn element(from: Dynamic, position: Int) -> Result(Dynamic, String)
337337pub external fn tuple2(from: Dynamic) -> Result(tuple(Dynamic, Dynamic), String) =
338338 "gleam_stdlib" "decode_tuple2"
339339
340- /// Check to see if the Dynamic value is a 2 element tuple containing two
340+ /// Checks to see if the Dynamic value is a 2 element tuple containing two
341341/// specifically typed elements.
342342///
343343/// If you wish to decode all the elements in the list use the `typed_tuple2`
@@ -368,11 +368,11 @@ pub fn typed_tuple2(
368368 Ok(tuple(a, b))
369369}
370370
371- /// Check to see if the Dynamic value is map.
371+ /// Checks to see if the Dynamic value is map.
372372///
373373/// ## Examples
374374///
375- /// > import gleam/map
375+ /// > import gleam/map
376376/// > map(from(map.new()))
377377/// Ok(map.new())
378378///
@@ -385,7 +385,7 @@ pub fn typed_tuple2(
385385pub external fn map(from: Dynamic) -> Result(Map(Dynamic, Dynamic), String) =
386386 "gleam_stdlib" "decode_map"
387387
388- /// Join multiple decoders into one. When run they will each be tried in turn
388+ /// Joins multiple decoders into one. When run they will each be tried in turn
389389/// until one succeeds, or they all fail.
390390///
391391/// ## Examples
0 commit comments