Last active
August 29, 2015 14:25
-
-
Save Peaker/e1afbbcaf71b9c0cdb40 to your computer and use it in GitHub Desktop.
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 #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE PolyKinds #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE KindSignatures #-} | |
{-# LANGUAGE GADTs #-} | |
module KTuple where | |
type family Fst (xs :: (a, b)) :: a where | |
Fst '(x, y) = x | |
type family Snd (xs :: (a, b)) :: a where | |
Snd '(x, y) = y | |
type T = '(Int, String) | |
data Foo a r = Pure a (Fst r) | Foo (Foo a r) | |
newtype Fix f = Fix { unFix :: f '(Fix f, Fix f) } | |
type Foo' a b = Fix (Foo a) | |
foo :: () -> Snd T | |
foo _ = "Hello" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment