code: function safe(pred, x) {
    if(!isPredOrFunc(pred)) {
      throw new TypeError('safe: Pred or predicate function required for first argument')
    }
  
    return predOrFunc(pred, x)
      ? Just(x)
      : Nothing()
  }
docs: safe : ((a -> Boolean) | Pred) -> a -> Maybe a