-
Get started • • BigchainDB
-
Kadena: Scalable Blockchain | Smarter Contracts
-
kadena-io/pact: The Pact Smart Contract Language
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Emly.Parser | |
| open Emly.UntypedAST | |
| open FParsec | |
| open FParsec.CharParsers | |
| open Emly.ParserUtils | |
| open Emly.ParserUtils.IndentationParserWithoutBacktracking | |
| let keywords = | |
| Set.ofList ["let"; "fun"; "rec"; "impure"; "in"; "of"; "if"; "then"; "else"; "match"; "with"; "type"; "foreign"; "mutable"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module Result = { | |
| type result('a, 'b) = | |
| | Ok('a) | |
| | Error('b); | |
| let isOk = (result_) => | |
| switch result_ { | |
| | Ok(_) => true | |
| | Error(_) => false | |
| }; | |
| let isError = (result_) => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // @flow | |
| import { guard, object, string, number } from 'decoders' | |
| import type { Decoder } from 'decoders' | |
| // This is the type-level "function" that pulls the generic out of the decoder | |
| type ExtractDecoderType = <T>(d: Decoder<T>) => T | |
| // Now we define our run-time decoder, without defining the type first... | |
| const person = object({ | |
| name: string, |
OlderNewer