|
|
|
|
|
by crimsonalucard
2436 days ago
|
|
Haskell provides it as an "interface" in the "standard library" http://hackage.haskell.org/package/base-4.12.0.0/docs/Prelud... You have to implement the methods but things like associativity and the existence of identity are not enforced. Additionally all IO functions in haskell are monads with a return type that is a functor called IO that can contain another type or nothing. You cannot print something to console without invoking a monad in haskell. The clever thing about the IO functor type is that it can only be instantiated by a true IO function that touches some external thing, there is no other way to instantiate this type. So for example the Instantiated type IO(int) cannot exist unless someone called a function that receives integers from a socket. And to extract the int from the functor you have to use the monadic bind operator. |
|