Skip to content

Instantly share code, notes, and snippets.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{arrows}
\begin{document}
\begin{tikzpicture}[scale=2.3]
\node (1) at (-0.77,0.5) {$1$};
\node (NL) at (0,1) {$N$};
{-# LANGUAGE DeriveDataTypeable #-}
import Data.Generics.Zipper
import Data.Data
-- | our tree def
data Tree a = Empty | Fork a (Tree a) (Tree a)
deriving (Typeable,Data)
@llelf
llelf / gist:3397364
Created August 19, 2012 20:11
fpfp-august
import Control.Monad.Logic
import Data.List
foo :: Logic Bool
foo = do [c2,c3,c4,c5,c6,c7,cJ,cA] <- sequence . replicate 8 $ return True `mplus` return False
guard $ c3 `thinks` sane cA
guard $ c4 `thinks` not (not (sane c2) && not (sane c3))
guard $ c5 `thinks` sane cA == sane c4
guard $ c6 `thinks` sane cA && sane c2
guard $ c7 `thinks` not (sane c5)
@llelf
llelf / gist:2340625
Created April 9, 2012 00:59
fpfp-april
-- MIND YOUR EYES! DIRTY CODE AHEAD.
import Control.Monad
import qualified Data.Map as M
import qualified Data.Set as S
import Data.List
import System
import System.IO
import Data.List
import Data.Ord
@llelf
llelf / gist:1974450
Created March 4, 2012 19:25
FPFP march
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Ord
import qualified Data.Set as S
type State = (Integer,Integer)
data Vessel = A | B deriving (Show,Eq)
@llelf
llelf / gist:1809436
Created February 12, 2012 16:22
FPFP Feb
import Data.List
import Data.Array
import Data.Maybe
import Data.Char
import Data.List.Split
import Control.Arrow
data File = A|B|C|D|E|F|G|H deriving (Enum,Show,Eq,Ord,Ix)
type Dist = Int