Skip to content

Instantly share code, notes, and snippets.

View joelburget's full-sized avatar

Joel Burget joelburget

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import { expect, test } from "bun:test";
import { createToken, Lexer, CstParser } from "chevrotain";
import type { CstNode, IToken } from "chevrotain";
const Integer = createToken({ name: "Integer", pattern: /0|[1-9]\d*/ });
const allTokens = [Integer];
const lexer = new Lexer(allTokens);
class Parser extends CstParser {
constructor() {
~/code/ocaml/monaco-editor main
❯ ts2ocaml jsoo --create-minimal-lib --preset=minimal --output-dir src-minimal monaco.d.ts
warn: type predicate is not supported and treated as boolean at line 98, col 35 of monaco.d.ts
> static isUri(thing: any): thing is Uri;
warn: type predicate is not supported and treated as boolean at line 567, col 39 of monaco.d.ts
> static isIPosition(obj: any): obj is IPosition;
warn: type predicate is not supported and treated as boolean at line 716, col 36 of monaco.d.ts
> static isIRange(obj: any): obj is IRange;
warn: type predicate is not supported and treated as boolean at line 829, col 40 of monaco.d.ts
> static isISelection(obj: any): obj is ISelection;
open Bonsai_web
open Core_kernel
open Js_of_ocaml
module Change = struct
type position =
{ ch: int
; line: int
}
# given an amount and coin denominations,
# compute the number of ways to make amount with coins of the given denoms
# 4, [1,2,3] -> 4
def ways_to_make(amount, denoms):
# ways to make 4
# ~ ways(4 - 3) + ways(4 - 2) + ways(4 - 1) ~
# ways(1, largest=1) + ways(2, largest=1)
# dim 1: amount
This file has been truncated, but you can view the full file.
dtrace: system integrity protection is on, some features will not be available
PID/THRD ELAPSD CPU SYSCALL(args) = return
27547/0x5b150b: 4 0 ulock_wake(0x1000002, 0x102F5A000, 0x0) = 0 0
27547/0x5b13b5: 4 0 ulock_wake(0x1000002, 0x102F5A000, 0x0) = 0 0
27547/0x5b1513: 4 1 ulock_wait(0x1010002, 0x102F5A000, 0x1102) = 1 0
27547/0x5b1513: 2 0 ulock_wake(0x1000002, 0x102F5A000, 0x0) = 0 0
27547/0x5b13b5: 2 0 ulock_wait(0x1010002, 0x102F5A000, 0x7C02) = 1 0
27547/0x5b150b: 2 0 ulock_wake(0x1000002, 0x102F5A000, 0x0) = 0 0
27547/0x5b150b: 1 0 ulock_wake(0x1000002, 0x102F5A000, 0x0) = 0 0
27547/0x5b13b5: 2 0 ulock_wait(0x1010002, 0x102F5A000, 0x7C02) = 1 0
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeOperators #-}
λ> :r
*** Chasing dependencies:
Chasing modules from: *Pact.Compile,*Pact.Eval,*Pact.Gas,*Pact.Native,*Pact.Native.Db,*Pact.Native.Internal,*Pact.Native.Time,*Pact.Native.Ops,*Pact.Native.Keysets,*Pact.Parse,*Pact.PersistPactDb,*Pact.Persist,*Pact.Persist.Pure,*Pact.Repl,*Pact.Repl.Lib,*Pact.Repl.Types,*Pact.Types.Exp,*Pact.Types.ExpParser,*Pact.Types.Gas,*Pact.Types.Hash,*Pact.Types.Info,*Pact.Types.Lang,*Pact.Types.Logger,*Pact.Types.Native,*Pact.Types.Parser,*Pact.Types.Persistence,*Pact.Types.Runtime,*Pact.Types.Orphans,*Pact.Types.Term,*Pact.Types.Type,*Pact.Types.Util,*Pact.Types.Version,*Crypto.Hash.Blake2Native,*Pact.Types.Typecheck,*Pact.Typechecker,*Pact.Analyze.Alloc,*Pact.Analyze.Eval,*Pact.Analyze.Eval.Invariant,*Pact.Analyze.Eval.Numerical,*Pact.Analyze.Eval.Prop,*Pact.Analyze.Eval.Core,*Pact.Analyze.Eval.Term,*Pact.Analyze.Check,*Pact.Analyze.Errors,*Pact.Analyze.Feature,*Pact.Analyze.LegacySFunArray,*Pact.Analyze.Model,*Pact.Analyze.Model.Dot,*Pact.Analyze.Model.Graph,*Pact.Analyze.Model.Tags,