fe89f0f13a248371a92d6b48abbff136a7569fe6
[ghc-hetmet.git] / ghc / tests / specialise / code002 / Use.hs
1 module Use (
2
3         UseTree,
4
5         lookup1, lookup2, lookup3, tree1,
6
7         Tree, lookup
8
9     ) where
10
11 import Spec     ( Tree(..), lookup)
12
13 data UseTree a = UseTree (Tree Char# a)
14
15         -- this data declaration does not in itself require specialisations of Tree
16         -- these will only be required by code which constructs the values placed
17         -- inside a use of this data declaration
18
19 {- These should be ok -}
20
21 lookup1 = case (lookup eqInt# ltInt# 1# 1# (Leaf 1# 1#)) of i# -> I# i#
22
23 tree1   = UseTree (Leaf (case 'k' of C# k# -> k#) 1#)
24
25 lookup2 = case (lookup eqInt# ltInt# 1# 1.0# (Leaf 1# 1.0#)) of f# -> F# f#
26
27 lookup3 = case (lookup (==) (<) 1 1.0# (Leaf 1 1.0#)) of f# -> F# f#
28