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, DataKinds, KindSignatures, FlexibleInstances, ScopedTypeVariables #-} | |
import Test.QuickCheck | |
import Test.QuickCheck.Gen | |
import Control.Applicative | |
import Data.List | |
-- Peano naturals (used on value and type level) | |
data Nat = Zero | Suc Nat |
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
data Eq a = Eq { | |
eq :: a -> a -> Bool, | |
neq :: a -> a -> Bool | |
} | |
(==) :: (?eq :: Eq a) => a -> a -> Bool | |
(==) = eq ?eq | |
(/=) :: (?eq :: Eq a) => a -> a -> Bool | |
(/=) = neq ?eq |
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 | |
import Data.List | |
import qualified Data.Map as M | |
import Control.Arrow ((&&&), (***)) | |
import Data.Char(isAlpha, toLower) | |
unscramble = curry $ fmap unwords | |
. uncurry mapM | |
. ( ( ( fmap head .) | |
. flip M.lookup |
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 <stdio.h> | |
/* BEGIN HACKERY */ | |
typedef struct field { | |
enum { | |
TABLE_NAME, | |
TABLE_FIELD, | |
TABLE_TERMINATOR | |
} tag; |
NewerOlder