func (b Bool) If(fn func(bool)) {
	if b.Present() {
		fn(*b.value)
	}
}
If calls the function f with the value if the value is present.
package optional
import (
	"encoding/json"
	"errors"
)
type Bool struct {
	value *bool
}
func NewBool(v bool) Bool {
	return Bool{&v}
}
func (b *Bool) Set(v bool) {
	b.value = &v
}
func (b Bool) Get() (bool, error) {
	if !b.Present() {
		var zero bool
		return zero, errors.New("value not present")
	}
	return *b.value, nil
}
func (b Bool) MustGet() bool {
	if !b.Present() {
		panic("value not present")
	}
	return *b.value
}
func (b Bool) Present() bool {
	return b.value != nil
}
func (b Bool) OrElse(v bool) bool {
	if b.Present() {
		return *b.value
	}
	return v
}