This file contains 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
type nationality = | |
English | |
| Spainiard | |
| Ukrainian | |
| Japanese | |
| Norwegian | |
let print_nationality = function | |
English -> "English" | |
| Spainiard -> "Spainiard" |
This file contains 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
TZIP-21 (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-21/tzip-21.md) | |
TZIP-16 (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-16/tzip-16.md) | |
TZIP-12 (https://gitlab.com/tezos/tzip/-/blob/master/proposals/tzip-12/tzip-12.md) | |
- interface | |
single token type & multi token type | |
- token transfer semantics | |
- metadata | |
token & contract level |
This file contains 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
(* Implementation for Algorithm-W tutorial in OCaml | |
Reference: http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.7733&rep=rep1&type=pdf | |
*) | |
(* trivial utils *) | |
module SMap = Map.Make(String) | |
module SSet = Set.Make(String) | |
let rec zip xs ys = | |
match xs, ys with |
This file contains 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
{ | |
"checksum": "438ad176435950ec970bbda6417e5c3b", | |
"root": "ligo-main@link-dev:./esy.json", | |
"node": { | |
"temp-ligo-bin@0.25.2@d41d8cd9": { | |
"id": "temp-ligo-bin@0.25.2@d41d8cd9", | |
"name": "temp-ligo-bin", | |
"version": "0.25.2", | |
"source": { | |
"type": "install", |
This file contains 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
#include <caml/mlvalues.h> | |
#include <caml/memory.h> | |
#include <caml/alloc.h> | |
// Reference: http://decapode314.free.fr/ocaml/ocaml-wrapping-c.html | |
// Reference: https://ocaml.org/manual/intfc.html | |
// This stub return a (int,string) result | |
value esy_test_result(value unit) { |
This file contains 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
let make () : elem = ref @@ Root 0 | |
let find (x : elem) : elem = | |
let rec aux (x : elem) (xs : elem list) = | |
match !x with | |
| Root _ -> | |
let () = x := Root (List.length xs) in | |
let () = List.iter (fun x' -> x' := Link x) xs in | |
x |
This file contains 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
#!/usr/bin/env node | |
/* eslint-disable max-len, flowtype/require-valid-file-annotation, flowtype/require-return-type */ | |
/* global packageInformationStores, $$BLACKLIST, $$SETUP_STATIC_TABLES */ | |
// Used for the resolveUnqualified part of the resolution (ie resolving folder/index.js & file extensions) | |
// Deconstructed so that they aren't affected by any fs monkeypatching occuring later during the execution | |
const {statSync, lstatSync, readlinkSync, readFileSync, existsSync, realpathSync} = require('fs'); | |
const Module = require('module'); | |
const path = require('path'); |
This file contains 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
#lang racket | |
;;;;;;;;;;;;;;;; Hex conversion ;;;;;;;;;;;;;;;; | |
(define (hex-char-to-bin-list c) | |
(cond [(eq? #\0 c) (list 0 0 0 0)] | |
[(eq? #\1 c) (list 0 0 0 1)] | |
[(eq? #\2 c) (list 0 0 1 0)] | |
[(eq? #\3 c) (list 0 0 1 1)] | |
[(eq? #\4 c) (list 0 1 0 0)] | |
[(eq? #\5 c) (list 0 1 0 1)] |
This file contains 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
type str = "racecar" | |
// will require a-z | |
type Alphabet = 'r' | 'a' | 'c' | 'e' | |
type ReverseStr<Str extends string> = | |
Str extends '' | |
? Str | |
: Str extends `${infer Chr}${infer Str}` | |
? Chr extends Alphabet |
This file contains 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
open Angstrom; | |
type line = | |
| NewLine | |
| PassPort(string); | |
let newLine = char('\n') *> return(NewLine); | |
let passPort = | |
take_while(char => {char != '\n'}) >>= (s => return(PassPort(s))); | |
let parse = sep_by(newLine, passPort); | |
let string = "eyr:2021 hgt:168cm hcl:#fffffd pid:180778832 byr:1923 ecl:amb iyr:2019 cid:241 | |
hcl:#341e13 ecl:lzr eyr:2024 iyr:2014 pid:161cm byr:1991 cid:59 hgt:150cm |
NewerOlder