Documentation for (&&) and (&&) states that they are lazy in their second argument...
[ghc.git] / testsuite / tests / typecheck / should_compile / T8392.hs
1 {-# LANGUAGE FlexibleInstances, MultiParamTypeClasses, ScopedTypeVariables, TypeFamilies, UndecidableInstances, AllowAmbiguousTypes #-}
2
3 module T8392 where
4
5 class Fun f a b where
6 fun :: f -> a -> b
7
8 instance (b ~ Int, a ~ Int) => Fun F a b
9 where fun _ = (+1)
10
11 data F = F
12
13 data Compose a b = Compose a b
14
15 -- ghc-7.6 version
16 instance (Fun f b c, Fun g a b) => Fun (Compose f g) a c where
17 fun (Compose f g) a = fun f (fun g a :: b)