MonadState Declaration Syntax

Possible duplicate:
What is "|" to define a Haskell class?

I am new to Haskell. In the MonadState documentation, I see the following:

class Monad m => MonadState sm | m -> s where get :: ms put :: s -> m () 

What is the syntax | m -> s | m -> s here?

+4
source share
1 answer

He called functional dependence or falsification short. Syntax

 class Monad m => MonadState sm | m -> s where 

means that for each m there is only one instance or, in other words, if m known, the compiler can infer the type of form s , which. Using fundeps makes coding much easier, because the compiler can do much more.

+6
source

All Articles