Skip to content

Commit

Permalink
rename map2 to decodeRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
bhansconnect committed Aug 2, 2024
1 parent 9c7d5d3 commit f0e6406
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions examples/sqlite3.roc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ main = \_ ->
body =
rows
|> List.map \{ id, task } ->
"row $(Num.toStr id), task: $(task)"
"row $(Num.toStr id), task: $(task)\n"
|> Str.joinWith "\n"
# Print out the results
Stdout.line! body
Expand All @@ -43,7 +43,7 @@ queryTodosByStatus = \dbPath, status ->
}
SQLite3.execute!
stmt
{ SQLite3.map2 <-
{ SQLite3.decodeRecord <-
id: SQLite3.i64 "id",
task: SQLite3.str "task",
}
6 changes: 3 additions & 3 deletions platform/SQLite3.roc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module [
prepareAndBind,
execute,
errToStr,
map2,
decodeRecord,
taggedValue,
str,
bytes,
Expand Down Expand Up @@ -105,8 +105,8 @@ reset = \@Stmt stmt ->
DecodeErr err : [FieldNotFound Str, SQLError Code Str]err
Decode a err := List Str -> (Stmt -> Task a (DecodeErr err))

map2 : Decode a err, Decode b err, (a, b -> c) -> Decode c err
map2 = \@Decode genFirst, @Decode genSecond, mapper ->
decodeRecord : Decode a err, Decode b err, (a, b -> c) -> Decode c err
decodeRecord = \@Decode genFirst, @Decode genSecond, mapper ->
cols <- @Decode
decodeFirst = genFirst cols
decodeSecond = genSecond cols
Expand Down

0 comments on commit f0e6406

Please sign in to comment.