Skip to content

Instantly share code, notes, and snippets.

View siddhartha-gadgil's full-sized avatar

Siddhartha Gadgil siddhartha-gadgil

View GitHub Profile
@siddhartha-gadgil
siddhartha-gadgil / bool.agda
Last active January 4, 2016 14:19
Booleans
data Bool : Set where
True : Bool
False: Bool
not : Bool → Bool
not True = False
not False = True
_&_ : Bool → Bool → Bool
True & True = True
@siddhartha-gadgil
siddhartha-gadgil / 0_reuse_code.js
Created January 27, 2014 02:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@siddhartha-gadgil
siddhartha-gadgil / BoolType.agda
Created March 17, 2014 04:18
Definition of Booleans
data Bool : Set where
true : Bool
false : Bool
not : Bool -> Bool
not true = false
not false = true
_&_ : Bool → Bool → Bool
true & true = true
false & _ = false
true & false = false
notnot : Bool -> Bool
notnot x = not (not x)
verytrue : Bool → Bool
verytrue = λ x → x & x
_xor_ : Bool → Bool → Bool
_xor_ = λ x y → (x & (not y)) || ((not x) & y)
data ℕ : Set where
zero : ℕ
succ : ℕ → ℕ
_+_ : ℕ → ℕ → ℕ
zero + n = n
(succ m) + n = succ (m + n)