Skip to content

Instantly share code, notes, and snippets.

@mlieberman85
Created May 13, 2024 14:24
Show Gist options
  • Save mlieberman85/712129d6cb51b84270d7ae1545d5af76 to your computer and use it in GitHub Desktop.
Save mlieberman85/712129d6cb51b84270d7ae1545d5af76 to your computer and use it in GitHub Desktop.
let language = "javascript" in
let JavascriptContract = std.contract.from_predicate (fun x => std.string.contains "npm" x) in
let RustContract = std.contract.from_predicate(fun x => std.string.contains "cargo" x) in
let CommonContract = std.contract.from_predicate(fun x => std.string.contains "artifact" x) in
let contract_array = if language == "javascript" then [CommonContract, JavascriptContract] else [CommonContract, RustContract] in
let ContractSequence = std.contract.Sequence contract_array in
let data = "npm run artifact" in
data | ContractSequence
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment