-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #620 from tweag/task/rename-stdlib-modules-2
Rename stdlib modules (remove trailing `s`)
- Loading branch information
Showing
54 changed files
with
280 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
let f = { f = fun x => if (x == 0) then 0 else f (x - 1) }.f in | ||
{ | ||
run = fun n => | ||
lists.map f (lists.generate functions.id n) | ||
list.map f (list.generate function.id n) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
{ | ||
run = fun n => | ||
let l = lists.generate (fun n => n*n) n in | ||
let l = lists.filter (fun n => n % 2 == 0) l in | ||
let l = lists.map (fun n => [n, n+1]) l in | ||
let l = lists.flatten l in | ||
lists.partition (fun n => n % 2 == 0) l | ||
let l = list.generate (fun n => n*n) n in | ||
let l = list.filter (fun n => n % 2 == 0) l in | ||
let l = list.map (fun n => [n, n+1]) l in | ||
let l = list.flatten l in | ||
list.partition (fun n => n % 2 == 0) l | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
let nums = [3288, 2438, 1462, 437, 17, 1929, 2595, 2702, 831, 3685, 1906, 420, 2646, 1906, 2539, 184, 299, 3455, 2320, 1471, 1812, 3837, 1000, 2097, 945, 1973, 1090, 2285, 2272, 1045, 848, 3194, 2113, 537, 1953, 561, 2082, 2416, 3182, 3660, 3379, 1458, 39, 2720, 2469, 811, 837, 548, 3021, 2961, 2860, 2092, 942, 2511, 1769, 168, 130, 2755, 2552, 1057, 2619, 1848, 2373, 2012, 2339, 2521, 3593, 2784, 3094, 2260, 1994, 690, 828, 1298, 3434, 2929, 2188, 1285, 3783, 3635, 971, 3334, 87, 1578, 1363, 533, 3634, 1874, 830, 3976, 1140, 789, 1483, 1966, 1626, 3552, 2968, 3301, 749, 2576] in | ||
let ascending = fun x y => if x < y then `Less else if (x == y) then `Equal else `Greater in | ||
{ | ||
run = fun n => lists.sort ascending nums | ||
run = fun n => list.sort ascending nums | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
{ | ||
sum = { | ||
run = fun n => | ||
let numbers = lists.generate functions.id n in | ||
lists.foldl (fun acc x => acc + x) 0 numbers | ||
let numbers = list.generate function.id n in | ||
list.foldl (fun acc x => acc + x) 0 numbers | ||
}, | ||
|
||
product = { | ||
run = fun n => | ||
let numbers = lists.generate functions.id n in | ||
lists.foldl (fun acc x => acc * x) 1 numbers | ||
let numbers = list.generate function.id n in | ||
list.foldl (fun acc x => acc * x) 1 numbers | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
run = fun s => | ||
let updateDict = fun dict char => | ||
if records.has_field char dict then | ||
if record.has_field char dict then | ||
dict -$ char & {"#{char}" = dict."#{char}" + 1} | ||
else | ||
dict & {"#{char}" = 1} in | ||
lists.foldl updateDict {} (strings.chars s) | ||
list.foldl updateDict {} (string.chars s) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
{ | ||
run = fun n m => | ||
let prefix = fun n => | ||
let l = lists.generate (fun _n => "a") n in | ||
lists.foldl (fun x y => x ++ y) "" l in | ||
let l = list.generate (fun _n => "a") n in | ||
list.foldl (fun x y => x ++ y) "" l in | ||
let makeRecStep = fun state k => | ||
let name = state.prevName ++ (strings.from_num k) in | ||
let name = state.prevName ++ (string.from_num k) in | ||
{ | ||
value = state.value & {"#{name}" = {}}, | ||
prevName = name, | ||
} in | ||
let topList = lists.generate functions.id m in | ||
let topList = list.generate function.id m in | ||
let makeRec = fun m => | ||
let l = lists.generate functions.id n in | ||
let result = lists.foldl makeRecStep {value = {}, prevName = prefix m} l in | ||
let l = list.generate function.id n in | ||
let result = list.foldl makeRecStep {value = {}, prevName = prefix m} l in | ||
result.value in | ||
let l = lists.map makeRec topList in | ||
lists.foldl (fun r1 r2 => r1 & r2) {} l | ||
let l = list.map makeRec topList in | ||
list.foldl (fun r1 r2 => r1 & r2) {} l | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.