{-# LANGUAGE EmptyDataDecls, FlexibleContexts #-}
-- -fallow-undecidable-instances
-- .$Header: c:/Source/Haskell/Combine/Control/Combine/RCS/Test.hs,v 1.6 2011/09/14 02:00:57 dosuser Exp dosuser $
module Control.Combine.Test where
import Data.Type.Eq
import Data.Type.Nat
import Control.Combine hiding (C)
data A
data B
data C
data D
data E
type Fn = A -> B -> C -> D -> E
t1 :: (FlipType Z Fn ((a -> b -> c) -> (b -> a -> c)),
TypeCast ((a -> b -> c) -> (b -> a -> c))
(Fn -> B -> A -> C -> D -> E)) =>
(a -> b -> c) -> (b -> a -> c)
t1 = flip
t2 :: (FlipType (S Z) Fn ((a -> b -> c) -> (b -> a -> c)),
TypeCast ((a -> b -> c) -> (b -> a -> c))
((B -> C -> D -> E) -> (C -> B -> D -> E))) =>
(a -> b -> c) -> (b -> a -> c)
t2 = flip
t3 :: (FlipType (S (S Z)) Fn ((a -> b -> c) -> (b -> a -> c)),
TypeCast ((a -> b -> c) -> (b -> a -> c))
((C -> D -> E) -> (D -> C -> E))) =>
(a -> b -> c) -> (b -> a -> c)
t3 = flip
fn :: Fn
fn = undefined
fl :: FlipType n f ((a -> b -> c) -> (b -> a -> c)) =>
n -> f -> ((a -> b -> c) -> (b -> a -> c))
fl _ _ = flip
t4 :: Fn -> B -> A -> C -> D -> E
t4 = fl zero fn
t5 :: (B -> C -> D -> E) -> (C -> B -> D -> E)
t5 = fl one fn
t6 :: (C -> D -> E) -> (D -> C -> E)
t6 = fl two fn
{-
ab :: A -> B
ab = undefined
bc :: B -> C
bc = undefined
cd :: C -> D
cd = undefined
de :: D -> E
de = undefined
abc :: A -> B -> C
abc = undefined
abcd :: A -> B -> C -> D
abcd = undefined
-}
t7 :: (B -> C) -> (A -> B) -> (A -> C)
t7 = compose zero
t8 :: (C -> D) -> (A -> B -> C) -> (A -> B -> D)
t8 = compose one
t9 :: (D -> E) -> (A -> B -> C -> D) -> (A -> B -> C -> E)
t9 = compose two
rt :: RotType n a b => n -> a -> b
rt = undefined
t10 :: A -> B -> C -> D -> E
t10 = rot zero fn
t11 :: B -> A -> C -> D -> E
t11 = rot one fn
t12 :: C -> A -> B -> D -> E
t12 = rot two fn
t13 :: D -> A -> B -> C -> E
t13 = rot three fn
t14 :: (C -> D -> E) -> (A -> B -> D) -> (A -> B -> C -> E)
t14 = compose one . rot one
-- vim: expandtab:tabstop=4:shiftwidth=4