Skip to content

Commit

Permalink
fix examples again
Browse files Browse the repository at this point in the history
  • Loading branch information
inoas committed Dec 16, 2024
1 parent 67bcea5 commit 3f032b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ gleam add given@1

```gleam
import given.{given, not_given}
import gleam/io
import gleam/option.{None, Some}
pub fn given_example() {
let user_understood = False
Expand Down Expand Up @@ -78,6 +76,8 @@ pub fn given_error_in_example() {
error_value
}
import gleam/option.{None, Some}
pub fn given_some_in_example() {
let an_option = Some("One Penny")
use some_value <- given.some_in(an_option, else_return: fn() { "Woof!" })
Expand Down Expand Up @@ -105,6 +105,8 @@ pub fn given_none_in_another_example() {
else_some_value
}
import gleam/io
pub fn main() {
given_example() |> io.debug()
// "🤯 Woof!"
Expand Down
6 changes: 4 additions & 2 deletions src/given/internal/examples.gleam
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import given.{given, not_given}
import gleam/io
import gleam/option.{None, Some}

pub fn given_example() {
let user_understood = False
Expand Down Expand Up @@ -42,6 +40,8 @@ pub fn given_error_in_example() {
error_value
}

import gleam/option.{None, Some}

pub fn given_some_in_example() {
let an_option = Some("One Penny")
use some_value <- given.some_in(an_option, else_return: fn() { "Woof!" })
Expand Down Expand Up @@ -69,6 +69,8 @@ pub fn given_none_in_another_example() {
else_some_value
}

import gleam/io

pub fn main() {
given_example() |> io.debug()
// "🤯 Woof!"
Expand Down

0 comments on commit 3f032b6

Please sign in to comment.