| Op | Signature |
|---|---|
i64.eqz |
[i64] -> i32 |
i64.eq |
[i64,i64] -> i32 |
i64.ne |
[i64,i64] -> i32 |
i64.lt_s |
[i64,i64] -> i32 |
i64.lt_u |
[i64,i64] -> i32 |
i64.gt_s |
[i64,i64] -> i32 |
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
| Equal: (A: Type) -> A -> A -> Type | |
| (A) (a) (b) | |
| equal_value<P: (b: A) -> Equal(A)(a)(b) -> Type> -> | |
| (equal: P(a)(equal<A><a>)) -> | |
| P(b)(equal_value) | |
| equal: <A: Type> -> <a: A> -> Equal(A)(a)(a) | |
| <A> <a> | |
| <P> (equal) |
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 FiniteEndoTypes where | |
| import System.IO | |
| -- for any finite n, there are n^n mappings from the set with n elements to | |
| -- itself | |
| -- for n == 2 | |
| -- {0,1} -> {0,0} 0 | |
| -- {0,1} -> {0,1} 1 |
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
| import Base# | |
| // There are eight possible winning lines in a game of tic-tac-toe | |
| // ---------------- | |
| // | 00 | 01 | 02 | | |
| // -----+----+----- | |
| // | 10 | 11 | 12 | | |
| // -----+----+----- | |
| // | 20 | 21 | 22 | | |
| // ---------------- |
"considering making single-line definitions with
;a syntax error to stop your kingdom of evil" --Victor Maia
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119
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 | |
| (type (;0;) (func (param i32))) | |
| (type (;1;) (func (result i32))) | |
| (type (;2;) (func (param i32) (result i32))) | |
| (type (;3;) (func (param f64) (result f64))) | |
| (type (;4;) (func (param f64 f64) (result f64))) | |
| (type (;5;) (func (param f64 f64) (result i64))) | |
| (type (;6;) (func (param i32 i32 i32 i32) (result i32))) | |
| (type (;7;) (func (param f64 f64) (result i32))) | |
| (type (;8;) (func (param i32 i32 i32 i32) (result f64))) |
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
| import Data.Nat | |
| import Data.InductionTree | |
| Array : {A : Type, n : Nat} -> Type | |
| case/Nat n | |
| | succ => [x : Array(A, n.pred), Array(A, n.pred)] | |
| | zero => A | |
| : Type | |
| // :::::::::: |
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
| import Relation.Binary | |
| import Relation.Equality | |
| // identity function | |
| id : {~A : Type, x:A} -> A | |
| x | |
| // composition function | |
| compose : {~A : Type, ~B : Type, ~C : Type, g : B -> C, f : A -> B, x : A} -> C | |
| g(f(x)) |
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
| import Data.Empty | |
| import Data.Unit | |
| Interval : Type | |
| $self | |
| { ~P : {i : Interval} -> Type | |
| , I0 : P(i0) | |
| , I1 : P(i1) | |
| , ~SG : I0 == I1 | |
| } -> [x : P(self) ~ I0 == I1] |
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
| // Let's start our lawful Functor abstraction | |
| T Functor {F : Type -> Type} | |
| | functor | |
| { map : {~A : Type , ~B : Type , f : A -> B, x : F(A)} -> F(B) | |
| , identity : {~A : Type , fa : F(A)} -> map(~A, ~A, id(~A),fa) == fa | |
| , composition : | |
| { ~A : Type | |
| , ~B : Type | |
| , ~C : Type |