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
<Quashie> I'm heading to new york city and questioning my future | |
<Quashie> for the holidays | |
<nso95_> I'm questioning your future too [00:51] | |
<someoneigna> Well my future is going to be dark >_< | |
*** DarkCthulhu ([email protected]) has quit: Quit: Bye | |
*** raunicolae ([email protected]) has quit: Client Quit [00:52] | |
<reaga> i had a really good idea | |
*** DarkCthulhu ([email protected]) has joined channel ##programming | |
<Sprocklem> what now? | |
<reaga> what if.. what if a web page played the sound "isnt it annoying when |
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
#include <cstdint> | |
#include <iostream> | |
#include <set> | |
#include <vector> | |
#include <boost/rational.hpp> | |
using ext_coord = std::int64_t; | |
using int_coord = boost::rational<ext_coord>; |
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 Control.Applicative | |
data Person = Boy String | |
| Girl String | |
data Animal = Dog String | |
| Cat String | |
| Bug | |
boy (Dog n) = " plays with " ++ n |
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
{-# LANGUAGE GADTs #-} | |
import Control.Arrow | |
data Sized a where | |
Unit :: Sized () | |
Int :: Sized Int | |
Char :: Sized Char | |
Sum :: Sized a -> Sized b -> Sized (Either a b) | |
Prod :: Sized a -> Sized b -> Sized (a, b) |
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
Require Import List. | |
Section HList. | |
Variable A : Type. | |
Variable B : A -> Type. | |
Inductive hlist : list A -> Type := | |
| HNil : hlist nil | |
| HCons : forall x xs, B x -> hlist xs -> hlist (x :: xs). | |
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
In all cases, the subtree marked with an asterisk is one level shallower than its siblings. | |
CASE 1: | |
--------- --------- | |
| 1 | 4 | | 1 | 3 | | |
--------- --------- | |
/ | \ / | \ | |
a | e* a | \ | |
--------- ===> ----- ----- |
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
#include <stdint.h> | |
#include <stdlib.h> | |
#include "arena.h" | |
struct block { | |
union { | |
struct block *prev; | |
max_align_t nope; | |
}; |
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
lolcathost% ghci | |
GHCi, version 7.10.1: http://www.haskell.org/ghc/ :? for help | |
> type F a = (a, a) | |
> type G a = F (F a) | |
> type H a = G (G a) | |
> type I a = H (H a) | |
> type J a = I (I a) | |
> type K a = J (J a) | |
> let f :: a -> F a ; f x = (x, x) | |
> let g :: a -> G a ; g x = f (f x) |
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
datatype 'a tree | |
= Leaf | |
| Node of 'a tree * 'a * 'a tree | |
fun build (op <) = | |
let | |
fun loop nil = Leaf | |
| loop (x :: xs) = | |
let | |
val (xs, ys) = List.partition (fn y => y < x) xs |
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
merge xxs@(x:xs) yys@(y:ys) = | |
case compare x y of | |
LT -> x : merge xs yys | |
EQ -> x : merge xs ys | |
GT -> y : merge xxs ys | |
xs = map (*2) hamming | |
ys = map (*3) hamming | |
zs = map (*5) hamming |
OlderNewer