### Define and Validate Application Configuration Source: https://nickel-lang.org This snippet defines a configuration object and applies a schema with a custom contract for version validation. It demonstrates how to enforce data types and specific formats within configurations. ```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 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.