Home
package
▶
Compare
num_asc
num_desc
str_asc
str_desc
▶
Maybe
some
none
is_eq
map
with_default
from_try
▶
ListUtils
map2
zip
find_first
find_last
find_first_index
find_last_indxex
find_last_index
split_at
split_on
split_on_list
split_if
split_first
split_first_if
split_last
split_last_if
split_at_indices
split_with_delims
split_with_delims_head
split_with_delims_tail
▶
NumUtils
is_approx_eq
is_approx_eq_to_places
▶
StrUtils
split_if
split_first_if
split_last_if
capitalize
uppercase
lowercase
pad_left
pad_right
▶
Unsafe
unwrap
Compare
.
num_asc
:
number
,
number
->
[
EQ
, ..[
GT
,
LT
]]
where
{
number
.is_gt :
number
,
number
->
Bool
,
number
.is_lt :
number
,
number
->
Bool
}
Compare
.
num_desc
:
number
,
number
->
[
EQ
, ..[
GT
,
LT
]]
where
{
number
.is_gt :
number
,
number
->
Bool
,
number
.is_lt :
number
,
number
->
Bool
}
Compare
.
str_asc
:
Str
,
Str
->
[
LT
, ..[
EQ
,
GT
]]
Compare
.
str_desc
:
Str
,
Str
->
[
LT
, ..[
EQ
,
GT
]]
Maybe
.
some
:
a
->
Maybe
(
a
)
Maybe
.
none
:
Maybe
(
Dec
)
Maybe
.
is_eq
:
Maybe
(
a
),
Maybe
(
a
)
->
Bool
where
{
a
.is_eq :
a
,
a
->
Bool
}
Maybe
.
map
:
Maybe
(
a
), (
a
->
b
)
->
Maybe
(
b
)
Maybe
.
with_default
:
Maybe
(
a
),
a
->
a
Maybe
.
from_try
:
Try
(
a
,
err
)
->
Maybe
(
a
)
ListUtils
.
map2
:
List
(
a
),
List
(
b
), (
a
,
b
->
c
)
->
List
(
c
)
ListUtils
.
zip
:
List
(
a
),
List
(
b
)
->
List
((
a
,
b
))
ListUtils
.
find_first
:
List
(
a
), (
a
->
Bool
)
->
Try
(
a
, [
NotFound
])
ListUtils
.
find_last
:
List
(
a
), (
a
->
Bool
)
->
Try
(
a
, [
NotFound
])
ListUtils
.
find_first_index
:
List
(
a
), (
a
->
Bool
)
->
Try
(
U64
, [
NotFound
])
ListUtils
.
find_last_indxex
:
List
(
a
), (
a
->
Bool
)
->
Try
(
U64
, [
NotFound
])
ListUtils
.
find_last_index
:
a
, (
b
->
Bool
)
->
[
Ok
(
c
),
Err
([
NotFound
])]
where
{
a
.len :
a
->
b
,
a
.rev :
a
->
List
(
b
),
c
.minus :
a
,
Dec
->
a
}
ListUtils
.
split_at
:
List
(
a
),
U64
->
{ before :
List
(
a
), others :
List
(
a
) }
ListUtils
.
split_on
:
List
(
a
),
a
->
List
(
List
(
a
))
where
{
a
.is_eq :
a
,
a
->
Bool
}
ListUtils
.
split_on_list
:
List
(
a
),
List
(
a
)
->
List
(
List
(
a
))
where
{
a
.is_eq :
a
,
a
->
Bool
}
ListUtils
.
split_if
:
List
(
a
), (
a
->
Bool
)
->
List
(
List
(
a
))
ListUtils
.
split_first
:
List
(
a
),
a
->
Try
({ after :
List
(
a
), before :
List
(
a
) }, [
NotFound
])
where
{
a
.is_eq :
a
,
a
->
Bool
}
ListUtils
.
split_first_if
:
List
(
a
), (
a
->
Bool
)
->
Try
({ after :
List
(
a
), before :
List
(
a
) }, [
NotFound
])
ListUtils
.
split_last
:
List
(
a
),
a
->
Try
({ after :
List
(
a
), before :
List
(
a
) }, [
NotFound
])
where
{
a
.is_eq :
a
,
a
->
Bool
}
ListUtils
.
split_last_if
:
List
(
a
), (
a
->
Bool
)
->
Try
({ after :
List
(
a
), before :
List
(
a
) }, [
NotFound
])
ListUtils
.
split_at_indices
:
List
(
a
),
List
(
U64
)
->
List
(
List
(
a
))
ListUtils
.
split_with_delims
:
List
(
a
), (
a
->
Bool
)
->
List
(
List
(
a
))
ListUtils
.
split_with_delims_head
:
List
(
a
), (
a
->
Bool
)
->
List
(
List
(
a
))
ListUtils
.
split_with_delims_tail
:
List
(
a
), (
a
->
Bool
)
->
List
(
List
(
a
))
NumUtils
.
is_approx_eq
:
F64
,
F64
->
Bool
NumUtils
.
is_approx_eq_to_places
:
F64
,
F64
,
U64
->
Bool
StrUtils
.
split_if
:
Str
, (
U8
->
Bool
)
->
List
(
Str
)
StrUtils
.
split_first_if
:
Str
, (
U8
->
Bool
)
->
Try
({ after :
Str
, before :
Str
}, [
NotFound
])
StrUtils
.
split_last_if
:
Str
, (
U8
->
Bool
)
->
Try
({ after :
Str
, before :
Str
}, [
NotFound
])
StrUtils
.
capitalize
:
Str
->
Str
StrUtils
.
uppercase
:
Str
->
Str
StrUtils
.
lowercase
:
Str
->
Str
StrUtils
.
pad_left
:
Str
,
U8
,
U64
->
Try
(
Str
, [
InvalidASCII
])
StrUtils
.
pad_right
:
Str
,
U8
,
U64
->
Try
(
Str
, [
InvalidASCII
])
Unsafe
.
unwrap
:
Try
(
a
,
err
)
->
a
package
Compare
Maybe
ListUtils
NumUtils
StrUtils
Unsafe