Documentation ¶
Index ¶
- func Just(i interface{}) monad.Monad
- func Nothing() monad.Monad
- type Maybe
- func (m Maybe) AndThen(f func(interface{}) monad.Monad) monad.Monad
- func (m Maybe) FromJust() interface{}
- func (m Maybe) FromMaybe(defaultVal interface{}) interface{}
- func (m Maybe) IsJust() bool
- func (m Maybe) LogAndThen(f func(interface{}) monad.Monad, logger func(interface{})) monad.Monad
- func (m Maybe) Return(i interface{}) monad.Monad
- func (m Maybe) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Maybe ¶
type Maybe struct {
// contains filtered or unexported fields
}
Maybe provides an implementation of monad.Monad
func (Maybe) FromJust ¶
func (m Maybe) FromJust() interface{}
FromJust gets the just value and panics if it's nothing
func (Maybe) FromMaybe ¶
func (m Maybe) FromMaybe(defaultVal interface{}) interface{}
FromMaybe gets the just value or returns the default
func (Maybe) LogAndThen ¶
LogAndThen provides the monadic implementation of LogAndThen
Click to show internal directories.
Click to hide internal directories.