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
Sjoerds-iMac:~ sjoerd$ brew install -vd ncursesw | |
==> Build Environment | |
CC: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CXX: /usr/bin/c++ => /usr/bin/c++-4.2 | |
LD: /usr/bin/cc => /usr/bin/gcc-4.2 | |
CFLAGS: -O3 -march=core2 -msse4 -w -pipe | |
CXXFLAGS: -O3 -march=core2 -msse4 -w -pipe | |
MAKEFLAGS: -j8 | |
PKG_CONFIG_PATH: /usr/lib/pkgconfig:/usr/local/lib/pkgconfig:/opt/local/lib/pkgconfig: | |
==> Downloading http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.7.tar.gz |
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 TypeOperators #-} | |
import Web.Zwaluw | |
import Prelude hiding (id, (.)) | |
import Control.Category | |
import Data.Char | |
data Expr | |
= Variable String |
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 TypeOperators, RankNTypes, TupleSections #-} | |
import Prelude hiding ((^)) | |
import Control.Monad | |
import Lens | |
-- Like fclabels, but with failure in get to allow for labels on sum types. | |
type Label f a = forall r. Lens Maybe Id f f r (a :- r) |
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.Generics.Multiplate | |
import Data.Functor.Constant | |
import Data.Functor.Identity | |
data Expr = Con Int | |
| Add Expr Expr | |
| Mul Expr Expr |
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 TypeOperators, OverloadedStrings, TemplateHaskell #-} | |
import Web.Zwaluw | |
import Web.Zwaluw.TH | |
import Prelude hiding (id, (.)) | |
import Control.Category | |
import Data.Char | |
import Data.Foldable (foldMap) |
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 TypeOperators, TypeFamilies, GADTs, UndecidableInstances, RankNTypes, MultiParamTypeClasses, TypeSynonymInstances #-} | |
data End i | |
data Arg s r | |
data Rec i r | |
type family Apply f a :: * | |
data Univ desc is r i where |
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 TypeFamilies, GADTs, RankNTypes #-} | |
data Tip | |
data Node x y z | |
data Tree a where | |
Tip :: Tree Tip | |
Node :: Tree x -> y -> Tree z -> Tree (Node x y z) | |
type family Mirror 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
{-# LANGUAGE TypeOperators, TypeFamilies, GADTs, UndecidableInstances #-} | |
-- Type level functions | |
type family Apply f a :: * | |
data f :.: g -- function composition | |
type instance Apply (f :.: g) a = Apply f (Apply g a) | |
data Fst | |
type instance Apply Fst (a, b) = a | |
data Snd | |
type instance Apply Snd (a, b) = 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
import Data.Monoid | |
import Data.Function | |
class (Ord m, Monoid m) => Metric m where | |
ins :: Int -> m | |
del :: Int -> m | |
delta :: Int -> Int -> m | |
distance :: Metric m => [Int] -> [Int] -> m | |
distance [] [] = mempty |
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, KindSignatures, TypeFamilies, FlexibleInstances, FlexibleContexts, MultiParamTypeClasses, UndecidableInstances, StandaloneDeriving #-} | |
import Control.Applicative | |
import Control.Arrow | |
import Data.Key | |
import Data.Distributive | |
import Data.Functor.Bind | |
import Data.Functor.Representable | |
import Data.Functor.Adjunction |