blob: f87b5a5ea3445f8a9d6d0aba69950c2c0acfccc2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE RankNTypes, LiberalTypeSynonyms #-}
-- This test checks that deep skolemisation and deep
-- instanatiation work right. A buggy prototype
-- of GHC 7.0, where the type checker generated wrong
-- code, sent applyTypeToArgs into a loop.
module Twins where
import Data.Data
type GenericQ r = forall a. Data a => a -> r
type GenericM m = forall a. Data a => a -> m a
gzip :: GenericQ (GenericM Maybe) -> GenericQ (GenericM Maybe)
gzip f x y
= f x y
`orElse`
if toConstr x == toConstr y
then gzipWithM (gzip f) x y
else Nothing
gzipWithM :: Monad m => GenericQ (GenericM m) -> GenericQ (GenericM m)
gzipWithM = error "urk"
orElse :: Maybe a -> Maybe a -> Maybe a
orElse = error "urk"
|