View Playground.swift
import Cocoa
enum Failable<T> {
case fail
case success(T)
func map<U>(fn: (T) -> U) -> Failable<U> {
switch self {
case .fail: return .fail
case let .success(t): return .success(fn(t))