:: (a -> b) -> f a -> f b instance Functor ((->) r) where fmap = (.) class (Functor f) => Applicative f where pure :: a -> f a (<*>) :: f (a -> b) -> f a -> f b
mappend :: m -> m -> m mconcat :: [m] -> m mconcat = foldr mappend mempty protocol Monoid { static func empty() -> m static func append(m, m) -> m static func concat([m]) -> m }
fmap :: (a -> b) -> f a -> f b protocol Mappable { associatedtype Element static func map<InType, OutType>( transform: InType -> OutType, input: Self<InType>) -> Self<OutType> }
-> m a (>>=) :: m a -> (a -> m b) -> m b protocol Bindable: Mappable { init(element: Element) static func bind<Out>( input: Self<In>, transform: In -> Self<Out>) -> Self<Out> }
-> m a (>>=) :: m a -> (a -> m b) -> m b protocol Bindable: Mappable { init(element: Element) func bind<Out>(transform: Element -> Self<Out>) -> Self<Out> }
-> m a (>>=) :: m a -> (a -> m b) -> m b protocol FlatMappable: Mappable { init(element: Element) func flatMap<Out>(transform: Element -> Self<Out>) -> Self<Out> }