summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/T6015.hs
blob: 8f91025f6d5ed983f0203ba6e7658b123fde63f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# LANGUAGE DataKinds, MultiParamTypeClasses, FunctionalDependencies,
             PolyKinds, UndecidableInstances, ScopedTypeVariables #-}

module T6015 where

data Proxy a = Proxy

class Value a t | a -> t where value :: Proxy a -> t

instance Value True Bool where value _ = True

instance Value a t => Value (Just a) (Maybe t)
    where value _ = Just (value (Proxy :: Proxy a))

test = value (Proxy :: Proxy (Just True))