Complete work on new OVERLAPPABLE/OVERLAPPING pragmas (Trac #9242)
[ghc.git] / testsuite / tests / typecheck / should_compile / Tc173a.hs
1 {-# LANGUAGE FlexibleInstances, TypeSynonymInstances, UndecidableInstances #-}
2 module Tc173a where
3
4 class FormValue value where
5 isFormValue :: value -> ()
6 isFormValue _ = ()
7
8 class FormTextField value
9
10 instance FormTextField String
11
12 instance {-# OVERLAPPABLE #-} FormTextField value => FormTextFieldIO value
13
14 class FormTextFieldIO value
15
16 instance FormTextFieldIO value => FormValue value
17
18 instance {-# OVERLAPPING #-} FormTextFieldIO value => FormTextFieldIO (Maybe value)