module Control.Monad.MultiPass.Utils.InstanceTest
(
testInstrument1, TestInstrument1
, testInstrument2, TestInstrument2
, testInstrument3, TestInstrument3
, testInstrument4, TestInstrument4
)
where
import Control.Monad.MultiPass
type TestInstrument1 f r w
= PassS (PassS (PassS PassZ)) (WrappedType1 f r w)
testInstrument1 :: TestInstrument1 f r w
testInstrument1 =
PassS $ PassS $ PassS $
PassZ $ WrappedType1 $ testBody1
type UnwrappedType1 f r w p1 p2 p3 tc
= f p1 tc
-> f p2 tc
-> f p3 tc
-> MultiPassMain r w tc (p3 ())
newtype WrappedType1 f r w p1 p2 p3 tc =
WrappedType1 (UnwrappedType1 f r w p1 p2 p3 tc)
instance MultiPassAlgorithm
(WrappedType1 f r w p1 p2 p3 tc)
(UnwrappedType1 f r w p1 p2 p3 tc)
where
unwrapMultiPassAlgorithm (WrappedType1 f) = f
testBody1
:: Monad p3
=> UnwrappedType1 f r w p1 p2 p3 tc
testBody1 _ _ _ =
mkMultiPassMain
(return ())
(\() -> return ())
(\() -> return (return ()))
type TestInstrument2 f r w
= PassS (PassS (PassS (PassS PassZ))) (WrappedType2 f r w)
testInstrument2 :: TestInstrument2 f r w
testInstrument2 =
PassS $ PassS $ PassS $ PassS $
PassZ $ WrappedType2 $ testBody2
type UnwrappedType2 f r w p1 p2 p3 p4 tc
= f p1 p2 tc
-> f p3 p4 tc
-> f p1 p3 tc
-> f p2 p4 tc
-> MultiPassMain r w tc (p4 ())
newtype WrappedType2 f r w p1 p2 p3 p4 tc =
WrappedType2 (UnwrappedType2 f r w p1 p2 p3 p4 tc)
instance MultiPassAlgorithm
(WrappedType2 f r w p1 p2 p3 p4 tc)
(UnwrappedType2 f r w p1 p2 p3 p4 tc)
where
unwrapMultiPassAlgorithm (WrappedType2 f) = f
testBody2
:: Monad p4
=> UnwrappedType2 f r w p1 p2 p3 p4 tc
testBody2 _ _ _ _ =
mkMultiPassMain
(return ())
(\() -> return ())
(\() -> return (return ()))
type TestInstrument3 f r w
= PassS (PassS (PassS (PassS (PassS (PassS PassZ)))))
(WrappedType3 f r w)
testInstrument3 :: TestInstrument3 f r w
testInstrument3 =
PassS $ PassS $ PassS $ PassS $ PassS $ PassS $
PassZ $ WrappedType3 $ testBody3
type UnwrappedType3 f r w p1 p2 p3 p4 p5 p6 tc
= f p1 p2 p3 tc
-> f p4 p5 p6 tc
-> f p1 p3 p4 tc
-> f p2 p4 p6 tc
-> MultiPassMain r w tc (p6 ())
newtype WrappedType3 f r w p1 p2 p3 p4 p5 p6 tc =
WrappedType3 (UnwrappedType3 f r w p1 p2 p3 p4 p5 p6 tc)
instance MultiPassAlgorithm
(WrappedType3 f r w p1 p2 p3 p4 p5 p6 tc)
(UnwrappedType3 f r w p1 p2 p3 p4 p5 p6 tc)
where
unwrapMultiPassAlgorithm (WrappedType3 f) = f
testBody3
:: Monad p6
=> UnwrappedType3 f r w p1 p2 p3 p4 p5 p6 tc
testBody3 _ _ _ _ =
mkMultiPassMain
(return ())
(\() -> return ())
(\() -> return (return ()))
type TestInstrument4 f r w
= PassS (PassS (PassS (PassS (PassS (PassS (PassS (PassS PassZ)))))))
(WrappedType4 f r w)
testInstrument4 :: TestInstrument4 f r w
testInstrument4 =
PassS $ PassS $ PassS $ PassS $ PassS $ PassS $ PassS $ PassS $
PassZ $ WrappedType4 $ testBody4
type UnwrappedType4 f r w p1 p2 p3 p4 p5 p6 p7 p8 tc
= f p1 p2 p3 p4 tc
-> f p5 p6 p7 p8 tc
-> f p1 p3 p5 p7 tc
-> f p2 p4 p6 p8 tc
-> MultiPassMain r w tc (p8 ())
newtype WrappedType4 f r w p1 p2 p3 p4 p5 p6 p7 p8 tc =
WrappedType4 (UnwrappedType4 f r w p1 p2 p3 p4 p5 p6 p7 p8 tc)
instance MultiPassAlgorithm
(WrappedType4 f r w p1 p2 p3 p4 p5 p6 p7 p8 tc)
(UnwrappedType4 f r w p1 p2 p3 p4 p5 p6 p7 p8 tc)
where
unwrapMultiPassAlgorithm (WrappedType4 f) = f
testBody4
:: Monad p8
=> UnwrappedType4 f r w p1 p2 p3 p4 p5 p6 p7 p8 tc
testBody4 _ _ _ _ =
mkMultiPassMain
(return ())
(\() -> return ())
(\() -> return (return ()))