Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
nickel-lang
https://nickel-lang.org/documentation
Admin
Documentation repository created by Site2MD.
Tokens:
453
Snippets:
7
Trust Score:
7.6
Update:
2 weeks ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Nickel configuration with SemanticVersion contract Source: https://nickel-lang.org Interactive Nickel configuration example with an intentional error in the version field. The SemanticVersion contract uses a regex pattern and std.contract.blame_with_message to report a validation failure. Run it in the REPL to see the error message. ```nickel let conf = { name = "NiCl", version = "0.0.1$", description = "My cool app!" } in let SemanticVersion = fun label value => let pattern = "^\\d{1,2}\\.\\d{1,2}(\\.\\d{1,2})?$" in if std.string.is_match pattern value then value else let msg = "invalid version number" in std.contract.blame_with_message msg label in let AppSchema = { name | String, version | SemanticVersion, description | String, } in conf | AppSchema ```