summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_run/tcrun020.hs
blob: 98cbc71e3c215902e781e1bb0050351820638d8b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}

-- Hugs (2001) diverges when evaluating main, unless (Monad m) is
-- added as an extra superclass to C2, which should not be necessary.

module Main where

class Monad m => C1 m x

class (C1 m x) => C2 m x where
    c2 :: x -> m x

instance Monad m => C1 m Bool

instance C2 Maybe Bool where
    c2 = return

test :: Maybe Bool
test = c2 True

main = print test