Skip to content

Instantly share code, notes, and snippets.

@jrsonline
Last active January 27, 2018 15:27
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/07af5f9db0e591a546743566eb813c9b to your computer and use it in GitHub Desktop.
Save jrsonline/07af5f9db0e591a546743566eb813c9b to your computer and use it in GitHub Desktop.
extension Array : Constructible {
typealias TypeParameter = Element
}
extension ArrayTag : FunctorTag {
static func fmap<A, B>(_ transform: @escaping (A) -> B) -> (Construct<ArrayTag, A>) -> Construct<ArrayTag, B> {
return { applyA in
return [A].lower(applyA).map( transform )^
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment