   fileprivate let parse: (Route) -> (rest: Route, match: A)?
 }
 
-extension Parser { // : Functor
+// MARK: - Functor
+
+extension Parser {
   public func map<B>(_ a2b: @escaping (A) -> B) -> Parser<B> {
     return Parser<B> { route in
       guard let (rest, a) = self.parse(route) else { return nil }

  }
}

extension Parser { // : Plus
  public static var empty: Parser {
    return Parser { _ in nil }
  }
}

public func pure<A>(_ a: A) -> Parser<A> { // : Applicative
  return Parser<A> { route in
    (route, a)
  }
}

public let end = Parser<()> { route in
  guard route.path.isEmpty else { return nil }

    return pa.map(a2b)
  }

  public static func <¢ <B>(a: A, p: Parser<B>) -> Parser {
    return const(a) <¢> p
  }

  public static func ¢> <B>(p: Parser<B>, a: A) -> Parser {
    return const(a) <¢> p
  }
}

// MARK: - Apply

extension Parser {
  public static func <*> <B>(pa2b: Parser<(A) -> B>, pa: Parser) -> Parser<B> {
    return Parser<B> { route in
      guard let (more, a2b) = pa2b.parse(route) else { return nil }
      guard let (rest, a) = pa.parse(more) else { return nil }
