func (m Maybe) FromMaybe(defaultVal interface{}) interface{} {
	if m.IsJust() {
		return m.FromJust()
	}
	return defaultVal
}
FromMaybe gets the just value or returns the default
package maybe
import (
	"fmt"
	"github.com/asteris-llc/gofpher/monad"
)
type just struct {
	Val interface{}
}
type nothing struct{}
type Maybe struct {
	internal interface{}
}
func (m Maybe) AndThen(f func(interface{}) monad.Monad) monad.Monad {
	if asJust, ok := m.internal.(just); ok {
		return f(asJust.Val)
	}
	return m
}
func (m Maybe) LogAndThen(f func(interface{}) monad.Monad, logger func(interface{})) monad.Monad {
	logger(m)
	if asJust, ok := m.internal.(just); ok {
		return f(asJust.Val)
	}
	return m
}
func (m Maybe) Return(i interface{}) monad.Monad {
	return Maybe{internal: just{Val: i}}
}
func Nothing() monad.Monad {
	return Maybe{internal: nothing{}}
}
func Just(i interface{}) monad.Monad {
	return Maybe{internal: just{Val: i}}
}
func (m Maybe) IsJust() bool {
	_, ok := m.internal.(just)
	return ok
}
func (m Maybe) FromJust() interface{} {
	return m.internal.(just).Val
}