Interface for Monad utility.
The interface idea is from the https://github.com/JuliaSymbolics/TermInterface.jl
To be short, it could be viewed as typeclass
in Haskell
.
For a monad, we need the following function to be implemented:
- Functor
- fmap :: (a -> b) -> f a -> f b
- Monad
- mbind(>>= in
Haskell
) :: (Monad m) => m a -> (a -> m b) -> m b - mthen(>> in
Haskell
) :: m a -> m b -> m b
- mbind(>>= in