summaryrefslogtreecommitdiff
path: root/testsuite/tests/indexed-types/should_fail/T1897b.hs
blob: 17f53cd16b03dfb9d484e85589d48128aa1d2088 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{-# LANGUAGE TypeFamilies #-}

module T1897b where

import Control.Monad
import Data.Maybe

class Bug s where
  type Depend s 
 
  next  :: s -> Depend s -> Maybe s
  start :: s
  
-- isValid :: (Bug s) => [Depend s] -> Bool
-- Inferred type should be rejected as ambiguous
isValid ds = isJust $ foldM next start ds