Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 7 additions & 9 deletions lib/Hash.trp
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,13 @@ let

(*--- Module ---*)
val Hash = {
hashString = hashString,
hashMultiplyShift = hashMultiplyShift,
hashInt = hashInt,
hashNumber = hashNumber,
hashList = hashList,
hash = hash
hashString,
hashMultiplyShift,
hashInt,
hashNumber,
hashList,
hash
}

in [ ("Hash", Hash)
, ("hash", hash)
]
in [ ("Hash", Hash), ("hash", hash) ]
end
32 changes: 14 additions & 18 deletions lib/HashMap.trp
Original file line number Diff line number Diff line change
Expand Up @@ -202,24 +202,20 @@ let (* NOTE: The map is implemented as a Hash Array Mapped Trie (HAMT), i.e. a p

(*--- Module ---*)
val HashMap = {
(* Construction *)
empty = empty,
singleton = singleton,
insert = insert,
remove = remove,
(* Queries *)
null = null,
size = size,
findOpt = findOpt,
find = find,
mem = mem,
(* Manipulation *)
fold = fold,
(* List Conversion*)
keys = keys,
values = values,
toList = toList,
fromList = fromList
empty,
singleton,
insert,
remove,
null,
size,
findOpt,
find,
mem,
fold,
keys,
values,
toList,
fromList
}

in [ ("HashMap", HashMap) ]
Expand Down
26 changes: 11 additions & 15 deletions lib/HashSet.trp
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,17 @@ let (* NOTE: The set is implemented as a HashMap with dummy values, `()`. This i

(*--- Module ---*)
val HashSet = {
(* Construction *)
empty = empty,
singleton = singleton,
insert = insert,
remove = remove,
(* Queries *)
null = null,
size = size,
mem = mem,
(* Manipulation *)
fold = fold,
(* List Conversion*)
elems = elems,
toList = toList,
fromList = fromList
empty,
singleton,
insert,
remove,
null,
size,
mem,
fold,
elems,
toList,
fromList
}

in [ ("HashSet", HashSet) ]
Expand Down
47 changes: 20 additions & 27 deletions lib/List.trp
Original file line number Diff line number Diff line change
Expand Up @@ -169,33 +169,26 @@ let (* -- List Access -- *)

(*--- Module ---*)
val List = {
head = head,
tail = tail,
nth = nth,

null = null,
elem = elem,
length = length,

reverse = reverse,
append = append,
revAppend = revAppend,
appendAt = appendAt,
sublist = sublist,

map = map,
mapi = mapi,
foldl = foldl,
filter = filter,
filteri = filteri,
partition = partition,

range = range,

sort = sort
head,
tail,
nth,
null,
elem,
length,
reverse,
append,
revAppend,
appendAt,
sublist,
map,
mapi,
foldl,
filter,
filteri,
partition,
range,
sort
}

in [ ("List", List),
("length", length)
]
in [ ("List", List), ("length", length) ]
end
31 changes: 14 additions & 17 deletions lib/ListPair.trp
Original file line number Diff line number Diff line change
Expand Up @@ -64,22 +64,19 @@ let (* -- ListPair Generation -- *)

(*--- Module ---*)
val ListPair = {
zip = zip,
unzip = unzip,

null = null,
length = length,

reverse = reverse,
append = append,
revAppend = revAppend,

findOpt = findOpt,
find = find,
mem = mem,

map = map,
foldl = foldl
zip,
unzip,
null,
length,
reverse,
append,
revAppend,
findOpt,
find,
mem,
map,
foldl
}

in [ ("ListPair", ListPair) ] end
in [ ("ListPair", ListPair) ]
end
39 changes: 20 additions & 19 deletions lib/Number.trp
Original file line number Diff line number Diff line change
Expand Up @@ -93,25 +93,26 @@ let (** Largest (safe) possible integral value. Anything larger than this cannot

(*--- Module ---*)
val Number = {
maxInt = maxInt,
minInt = minInt,
precision = precision,
maxInt32 = maxInt32,
minInt32 = minInt32,
maxNum = maxNum,
minNum = minNum,
abs = abs,
min = min,
max = max,
ceil = ceil,
floor = floor,
round = round,
sqrt = sqrt,
isInt = isInt,
toInt = toInt,
toInt32 = toInt32,
toString = toString,
fromString = fromString
maxInt,
minInt,
precision,
maxInt32,
minInt32,
maxNum,
minNum,
abs,
min,
max,
ceil,
floor,
round,
sqrt,
isInt,
toInt,
toInt32,
toString,
fromString
}

in [("Number", Number)]
end
38 changes: 18 additions & 20 deletions lib/StencilVector.trp
Original file line number Diff line number Diff line change
Expand Up @@ -146,26 +146,24 @@ let (*--- Constants ---*)

(* TODO: Lift list functions `mapi`, `find` and `filter`? *)

(*--- Module ---*)
val StencilVector = {
(* Constants *)
maskBits = maskBits,
maskMax = maskMax,
(* Functions *)
empty = empty,
singleton = singleton,
get = get,
getOrDefault = getOrDefault,
set = set,
unset = unset,
mem = mem,
valid = valid,
null = null,
mask = mask,
length = length,
map = map,
fold = fold
maskBits,
maskMax,
empty,
singleton,
get,
getOrDefault,
set,
unset,
mem,
valid,
null,
mask,
length,
map,
fold
}
in (* Export public functions *)
[ ("StencilVector", StencilVector)
]

in [ ("StencilVector", StencilVector) ]
end
23 changes: 12 additions & 11 deletions lib/String.trp
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,18 @@ let (** The maximum length of a string.

(*--- Module ---*)
val String = {
maxSize = maxSize,
size = size,
sub = sub,
subCode = subCode,
substring = substring,
concat = concat,
concatWith = concatWith,
implode = implode,
explode = explode,
map = map,
translate = translate
maxSize,
size,
sub,
subCode,
substring,
concat,
concatWith,
implode,
explode,
map,
translate
}

in [("String", String)]
end
14 changes: 7 additions & 7 deletions lib/Unit.trp
Original file line number Diff line number Diff line change
Expand Up @@ -112,13 +112,13 @@ let

(*--- Module ---*)
val Unit = {
group = group,
it = it,
isEq = isEq,
isTrue = isTrue,
isFalse = isFalse,
isNeq = isNeq,
run = run
group,
it,
isEq,
isTrue,
isFalse,
isNeq,
run
}

in [ ("Unit", Unit) ]
Expand Down
Loading