Skip to content

Instantly share code, notes, and snippets.

@jrsonline
Last active January 28, 2018 03:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrsonline/2bdba3f615c790c201330ac1ec40d914 to your computer and use it in GitHub Desktop.
Save jrsonline/2bdba3f615c790c201330ac1ec40d914 to your computer and use it in GitHub Desktop.
Functor In Swift
protocol FunctorTag : HKTTag {
typealias F = Self
static func fmap<A,B>(_ transform: (A) -> B ) -> (Construct<F,A>) -> Construct<F,B>
// fmap will take a "transform A's to B's" -> and an "F<A>" -> and return an "F<B>"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment