X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Fcompiler%2Ftests%2Fprinting%2FPrint002.hs;fp=ghc%2Fcompiler%2Ftests%2Fprinting%2FPrint002.hs;h=458170a6122466622ea94d0942f3bb47f2246541;hb=e7d21ee4f8ac907665a7e170c71d59e13a01da09;hp=0000000000000000000000000000000000000000;hpb=e48474bff05e6cfb506660420f025f694c870d38;p=ghc-hetmet.git diff --git a/ghc/compiler/tests/printing/Print002.hs b/ghc/compiler/tests/printing/Print002.hs new file mode 100644 index 0000000..458170a --- /dev/null +++ b/ghc/compiler/tests/printing/Print002.hs @@ -0,0 +1,40 @@ +--!!! Print002.hs: printing various entities in prefix/infix forms +--!!! (both in various syntaxes & in interfaces) + +module Print002 where + +-- type & data constructors + +data Foo a b c + = MkFoo1 a a + | (:##) b c + | b `MkFoo3` b + | c :*** c + deriving (Eq, Ord) + +-- classes and methods + +class Bar a where + meth1, (/////) :: a -> a -> Bool + meth2 :: a -> b -> Bool + +class (Bar a) => Bar2 a -- no methods + +-- regular values (and uses of the above) + +f1 x y = x `MkFoo1` y +x `f1a` y = MkFoo1 x y + +x `f2` y = (:##) x y +f2a x y = x :## y + +(....) x y = MkFoo3 x y +x ..... y = x `MkFoo3` y + +x <<<< y = x :*** y +(<<<<) x y = (:***) x y + +f3a x y = meth1 x y +f3b x y = x `meth1` y +f3c x y = (/////) x y +f3d x y = x ///// y