mirror of
https://github.com/tweag/nickel.git
synced 2024-09-20 08:05:15 +03:00
Update stdlib to use the uniterm syntax
This commit is contained in:
parent
b252970dbb
commit
a8596b3cf2
@ -84,14 +84,14 @@
|
||||
"#m
|
||||
= fun x => %is_record% x,
|
||||
|
||||
typeof : Dyn -> <
|
||||
typeof : Dyn -> [|
|
||||
TypeNum,
|
||||
TypeBool,
|
||||
TypeStr,
|
||||
TypeFun,
|
||||
TypeList,
|
||||
TypeRecord,
|
||||
Other>
|
||||
Other |]
|
||||
| doc m#"
|
||||
Results in a value representing the type of the typed value.
|
||||
|
||||
@ -144,7 +144,7 @@
|
||||
"#m
|
||||
= fun x y => %deep_seq% x y,
|
||||
|
||||
hash : <Md5, Sha1, Sha256, Sha512> -> Str -> Str
|
||||
hash : [| Md5, Sha1, Sha256, Sha512 |] -> Str -> Str
|
||||
| doc m#"
|
||||
Hashes the given string provided the desired hash algorithm.
|
||||
|
||||
@ -156,7 +156,7 @@
|
||||
"#m
|
||||
= fun type s => %hash% type s,
|
||||
|
||||
serialize : <Json, Toml, Yaml> -> Dyn -> Str
|
||||
serialize : [| Json, Toml, Yaml |] -> Dyn -> Str
|
||||
| doc m#"
|
||||
Serializes the given value to the desired representation.
|
||||
|
||||
@ -171,7 +171,7 @@
|
||||
"#m
|
||||
= fun format x => %serialize% format (%deep_seq% x x),
|
||||
|
||||
deserialize : <Json, Toml, Yaml> -> Str -> Dyn
|
||||
deserialize : [| Json, Toml, Yaml |] -> Str -> Dyn
|
||||
| doc m#"
|
||||
Deserializes the given string to a nickel value given the encoding of the string.
|
||||
|
||||
|
@ -254,7 +254,7 @@
|
||||
"#m
|
||||
= fun f n => %generate% n f,
|
||||
|
||||
sort : forall a. (a -> a -> <Less, Equal, Greater>) -> List a -> List a
|
||||
sort : forall a. (a -> a -> [| Less, Equal, Greater |]) -> List a -> List a
|
||||
| doc m#"
|
||||
Sorts the given lists based on the provided comparison operator.
|
||||
|
||||
|
@ -177,7 +177,7 @@
|
||||
"#m
|
||||
= fun s => %str_chars% s,
|
||||
|
||||
code | #CharLiteral -> Num
|
||||
code | CharLiteral -> Num
|
||||
| doc m#"
|
||||
Results in the ascii code of the given character.
|
||||
|
||||
@ -193,7 +193,7 @@
|
||||
"#m
|
||||
= fun s => %char_code% s,
|
||||
|
||||
from_code | Num -> #CharLiteral
|
||||
from_code | Num -> CharLiteral
|
||||
| doc m#"
|
||||
Results in the character for a given ascii code. Any number outside the ascii range results in an error.
|
||||
|
||||
@ -382,7 +382,7 @@
|
||||
"#m
|
||||
= fun b => %to_str% b,
|
||||
|
||||
to_num | #NumLiteral -> Num
|
||||
to_num | NumLiteral -> Num
|
||||
| doc m#"
|
||||
Converts a string that represents an integer to that integer.
|
||||
|
||||
@ -394,7 +394,7 @@
|
||||
"#m
|
||||
= fun s => %num_from_str% s,
|
||||
|
||||
to_bool | #BoolLiteral -> Bool
|
||||
to_bool | BoolLiteral -> Bool
|
||||
| doc m#"
|
||||
Converts a string that represents a boolean to that boolean.
|
||||
|
||||
@ -410,7 +410,7 @@
|
||||
= fun s => s == "true",
|
||||
|
||||
// to_enum | #Ident -> < | Dyn> = fun s => %enum_from_str% s,
|
||||
to_enum | #Ident -> Dyn
|
||||
to_enum | Ident -> Dyn
|
||||
| doc m#"
|
||||
Converts any string that represents an enum variant to that enum variant.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user