diff options
author | Louis Pilfold <louis@lpil.uk> | 2020-03-28 14:09:58 +0000 |
---|---|---|
committer | Louis Pilfold <louis@lpil.uk> | 2020-03-28 14:09:58 +0000 |
commit | 61492947521a159724ec3c71c88120a22e6cd4cb (patch) | |
tree | 7378377c504506ac6a43788785e33119656b86ef /src | |
parent | a569191a5498703af60988a1ad92247f805b1a14 (diff) | |
download | gleam_stdlib-61492947521a159724ec3c71c88120a22e6cd4cb.tar.gz gleam_stdlib-61492947521a159724ec3c71c88120a22e6cd4cb.zip |
Slightly simplify Dynamic examples
Diffstat (limited to 'src')
-rw-r--r-- | src/gleam/dynamic.gleam | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gleam/dynamic.gleam b/src/gleam/dynamic.gleam index b080068..6bddfdf 100644 --- a/src/gleam/dynamic.gleam +++ b/src/gleam/dynamic.gleam @@ -53,8 +53,8 @@ pub external fn float(from: Dynamic) -> Result(Float, String) /// /// ## Examples /// ```gleam -/// import gleam/atom.{create_from_string, to_string} -/// to_string(atom(from(create_from_string("hello")))) == "hello" +/// import gleam/atom +/// atom(from(atom.create_from_string("hello"))) == OK("hello") /// atom(from(123)) == Error("Expected an Atom, got `123`") /// ``` pub external fn atom(from: Dynamic) -> Result(atom.Atom, String) @@ -76,7 +76,7 @@ pub external fn bool(from: Dynamic) -> Result(Bool, String) /// ```gleam /// import gleam/result /// let f = fn() { 1 } -/// result.map(thunk(from(f)), fn(v) { v == f}) == True +/// thunk(from(f)) |> result.is_ok == True /// thunk(from(123)) == Error("Expected a zero arity function, got `123`") /// ``` pub external fn thunk(from: Dynamic) -> Result(fn() -> Dynamic, String) |