Documentation for (&&) and (&&) states that they are lazy in their second argument...
[ghc.git] / testsuite / tests / typecheck / should_compile / T2683.hs
1 {-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
2 {-# LANGUAGE ExistentialQuantification, MultiParamTypeClasses,
3 FunctionalDependencies, RankNTypes #-}
4
5 module Q where
6
7 class Transformer t a | t -> a where
8 transform :: t -> l a -> (forall l'. l' a -> b) -> b
9
10 data EL a = forall l. EL (l a)
11
12 unEL :: EL a -> (forall l. l a -> b) -> b
13 unEL _ _ = error "unEL"
14
15 transform' :: (Transformer t a) => t -> EL a -> EL a
16 transform' = error "transform'"
17
18 data MultiToggleS ts a = MultiToggleS ts
19
20 data MultiToggle = MultiToggle
21
22 expand :: HList ts a => MultiToggleS ts a -> MultiToggle
23 expand (MultiToggleS ts) =
24 resolve ts
25 (\x mt ->
26 let g = transform' x in
27 mt
28 )
29 MultiToggle
30
31 class HList c a | c -> a where
32 resolve :: c -> (forall t. (Transformer t a) => t -> b) -> b