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
(* taken from https://www.seas.upenn.edu/~cis500/current/sf/Basics.html *) | |
Inductive bool : Type := | |
| true : bool | |
| false : bool. | |
Definition negb (b : bool) : bool := | |
match b with | |
| true => false | |
| false => true |
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
const jsc = require('jsverify'); | |
const expect = require('expect.js'); | |
const check = require('core.check'); | |
describe('core.check', () => { | |
describe('given the right type it must pass', () => { | |
jsc.property('given an int when an int is expected it must pass', jsc.int16, | |
n => check.assert(check.Number(n)) === n | |
), |
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
const jsc = require('jsverify'); | |
const {assert} = require('chai'); | |
const pass = () => assert.isOk(true); | |
const fail = () => assert.fail(); | |
const {nullary, unary, binary, ternary} = require('core.arity'); | |
const {curry} = require('core.lambda'); | |
describe('arity', () => { |
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
const {constant, identity/*, substitution*/} = require('fantasy-combinators'); | |
const substitution = f => g => x => f(x)(g(x)); | |
const K = constant; | |
const I = identity; | |
const S = substitution; | |
const expect = require('expect.js'); | |
const jsc = require('jsverify'); |
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
const Validation = require('data.validation') | |
const Success = Validation.Success | |
const Failure = Validation.Failure | |
const expect = require('expect.js'); | |
describe('truth', () => { | |
it('will be true', () => { | |
expect(true).to.equal(true); | |
}) |
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
const Maybe = require('data.maybe'); | |
const Nothing = Maybe.Nothing; | |
const Just = Maybe.Just; | |
const expect = require('expect.js'); | |
describe('truth', () => { | |
it('will be true', () => { | |
expect(true).to.equal(true); | |
}) |
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
const expect = require('expect.js'); | |
const Either = require('data.either'); | |
const Left = Either.Left; | |
const Right = Either.Right; | |
describe('truth', () => { | |
it('will be true or mocha is not set up right', () => { | |
expect(true).to.equal(true); | |
}) | |
}); |
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
const expect = require('expect.js'); | |
const Maybe = require('data.maybe'); | |
const Nothing = Maybe.Nothing; | |
const Just = Maybe.Just | |
describe('truth', () => { | |
it('will be true', () => { | |
expect(true).to.equal(true); | |
}) | |
}) |
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
using System.Collections.Generic; | |
using System.Linq; | |
namespace Library | |
{ | |
public static class Fibonacci | |
{ | |
public static int Value(int n) | |
{ | |
return Values(n).Last(); |
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
using System.Linq; | |
using Data; | |
using Microsoft.EntityFrameworkCore; | |
using Xunit; | |
namespace Tests | |
{ | |
public class UserContextTests | |
{ | |
public UserContextTests() |