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 g o = match o with | |
| None -> 0 | |
| Some x -> x | |
let f o = match o with | |
| None -> 0 | |
| Some x -> g o | |
let _ = f (Some 5) |
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
---- MODULE PossibleExtended ---- | |
VARIABLES i, j | |
vars == << i, j >> | |
Init == i = FALSE /\ j = FALSE | |
BodyATrue == /\ i' = TRUE | |
/\ UNCHANGED j |
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
import { | |
DBState as DBState, | |
Client as Client, | |
ScheduledTransaction as ScheduledTransaction, | |
CreateRecurringTransaction as CreateRecurringTransaction, | |
RecurringTransaction as RecurringTransaction, | |
} from "./react_ui/src/state.ts"; | |
import { | |
ScheduledTransaction as ScheduledTransactionModel, |
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
import { assert } from "https://deno.land/std@0.149.0/testing/asserts.ts"; | |
import fc from 'https://cdn.skypack.dev/fast-check'; | |
type BufferPosition = { | |
x: number; | |
y: number; | |
} | |
type ContentIndex = { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
def fib(n) | |
return 1 if n == 0 || n == 1 | |
return fib(n - 1) + fib(n - 2) | |
end | |
def fib2(n) | |
return 1 if n == 0 || n == 1 | |
return fib(n - 1) * fib(n - 2) | |
end |
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
import React, { useState } from 'react'; | |
import './App.css'; | |
enum SubStateType { | |
Initial, | |
Error, | |
Searching, | |
Movies | |
}; |
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 cardColor = c => | |
switch (c.suit) { | |
| Clubs => Black | |
| Spades => Black | |
| Diamonds => Black | |
| Hearts => Red | |
}; | |
let areCardsDifferentColor = (c1, c2) => cardColor(c1) != cardColor(c2); |
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 testLegalityOfFiveOfSpadesAndSixOfClubs = () => { | |
let fiveOfSpades = {suit: Spades, rank: 5}; | |
let sixOfClubs = {suit: Clubs, rank: 6}; | |
let isFiveToSixLegal = | |
isLegalMove(~source=fiveOfSpades, ~dest=sixOfClubs); | |
[ | |
Bool.assertEqual( | |
~expected=false, |
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 suit = | |
| Clubs | |
| Diamonds | |
| Hearts | |
| Spades; | |
type color = | |
| Red | |
| Black; |
NewerOlder