458170a6122466622ea94d0942f3bb47f2246541
[ghc-hetmet.git] / ghc / compiler / tests / printing / Print002.hs
1 --!!! Print002.hs: printing various entities in prefix/infix forms
2 --!!!   (both in various syntaxes & in interfaces)
3
4 module Print002 where
5
6 -- type & data constructors
7
8 data Foo a b c
9   = MkFoo1 a a
10   | (:##) b c
11   | b `MkFoo3` b
12   | c :*** c
13   deriving (Eq, Ord)
14
15 -- classes and methods
16
17 class Bar a where
18     meth1, (/////) :: a -> a -> Bool
19     meth2 :: a -> b -> Bool
20
21 class (Bar a) => Bar2 a     -- no methods
22
23 -- regular values (and uses of the above)
24
25 f1  x y     = x `MkFoo1` y
26 x `f1a` y    = MkFoo1 x y
27
28 x `f2` y    = (:##) x y
29 f2a x  y    = x :## y
30
31 (....) x y  = MkFoo3 x y
32 x .....  y  = x `MkFoo3` y
33
34 x <<<< y    = x :*** y
35 (<<<<) x y  = (:***) x y
36
37 f3a x y = meth1 x y
38 f3b x y = x `meth1` y
39 f3c x y = (/////) x y
40 f3d x y = x ///// y