summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/tc223.hs
blob: dfdc0363d179d1fded22a8afb0e509761af332fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{-# OPTIONS_GHC -fno-warn-deprecations #-}
{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
module Foo where

-- This example suggested by Yitzchak Gale

import Control.Monad.State
import Control.Monad.Error

class Error e => Game b mv e | b -> mv e where
    newBoard :: MonadState b m => m ()
        -- This method is unambiguous, because
        -- m determines b (via a fundep in MonadState)