summaryrefslogtreecommitdiff
path: root/testsuite/tests/deriving/should_compile/T14933.hs
blob: de8562d189a42d207dcd2e41b2f9498b23f3cbf7 (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
{-# LANGUAGE DefaultSignatures #-}
{-# LANGUAGE DeriveAnyClass    #-}
{-# LANGUAGE TypeFamilies      #-}
module T14933 where

import Data.Kind (Type)

class Wrapped s where
  type Unwrapped s :: Type

class Fork m where
    fork :: (x, m)

    default fork :: ( Wrapped m
                    , Unwrapped m ~ t
                    , Fork t
                    ) => (x, m)
    fork = undefined

newtype MyThing m = MyThing m
    deriving Fork

instance Wrapped (MyThing m) where
    type Unwrapped (MyThing m) = m