blob: bf04ba3910956e82fecc95826ac3549900503cdd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
{-# 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)
|