blob: a2e9ceb6a4faa0c9bd9ddaa05f4183da1393c028 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
module Spec where
class C a where { foo,bar :: [a] -> [a] }
instance C Int where
foo x = r_bar x
bar xs = reverse xs
r_bar :: C a => [a] -> [a]
r_bar (x:xs) = bar (xs ++ r_bar xs)
r_bar [] = []
-- We should specialise `r_bar` at Int
-- C.f. Note Note [Avoiding loops (non-DFuns)] in GHC.Core.Opt.Specialise
|