summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/Tc173a.hs
blob: 99e8471ae0009a73fa26c81c63c383d20151b618 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{-# OPTIONS_GHC -fno-warn-redundant-constraints #-}
{-# LANGUAGE FlexibleInstances, TypeSynonymInstances, UndecidableInstances #-}

module Tc173a where

class FormValue value where
   isFormValue :: value -> ()
   isFormValue _ = () 

class FormTextField value

instance FormTextField String

instance {-# OVERLAPPABLE #-} FormTextField value => FormTextFieldIO value

class FormTextFieldIO value

instance FormTextFieldIO value => FormValue value

instance {-# OVERLAPPING #-} FormTextFieldIO value => FormTextFieldIO (Maybe value)