Skip to content

Commit

Permalink
Create flat_lambda.gleam
Browse files Browse the repository at this point in the history
  • Loading branch information
lpil authored Feb 24, 2022
1 parent 575d956 commit 539f36c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions flat_lambda.gleam
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import gleam/result
import app/db

pub fn main() {
db.connect(fn(db) {
result.then(db.create_user(db, "Tim"), fn(user) {
Ok(Nil)
})
})
}

pub fn main() {
with db = db.connect()
with user = result.then(db.create_user("Tim"))
Ok(Nil)
}

0 comments on commit 539f36c

Please sign in to comment.