 }
 
 
-// Like Haskell <*>
+// Like Haskell Applicative <*>
 infix operator <*> { associativity left precedence 120 }
 func <*><A,B>(lhs:Tokenizer<A -> B>, rhs:Tokenizer<A>) -> Tokenizer<B> {
     return apply(lhs, rhs)
 }
 
+// Haskell Applicative <*
 infix operator <* { associativity left precedence 120 }
 func <*<A,B>(lhs:Tokenizer<A>, rhs:Tokenizer<B>) -> Tokenizer<A> {
     return liftA2(const)(lhs)(rhs)
 }
 
+// Haskell Applictive *>
 infix operator *> { associativity left precedence 120 }
 func *><A,B>(lhs:Tokenizer<A>, rhs:Tokenizer<B>) -> Tokenizer<B> {
     return liftA2(const(id))(lhs)(rhs)

    }
}

class Box<T> {
    private(set) var value:T
    init(_ value:T) {
        self.value = value
    }
    class func B(value:T) -> Box<T> {
        return Box(value)
    }
}

enum List<T> {
    case Nil
    case Cons(h:T, t:Box<List<T>>)
}

class ListGenerator<T> : AnyGenerator<T> {

let space:Tokenizer<()> = many(sat(isSpace)) |>> success(())
let ident:Tokenizer<String> = letter |>>= { c in
    many(alphanum) |>>= { cs in
        var list = List<Character>.Cons(h: c, t: cs)
        return success(String(list))
    }
}

let nat:Tokenizer<Int> = digit |>>= { d in
    many(digit) |>>= { ds in
        var list = List<Character>.Cons(h: d, t: ds)
        return success(Int(String(list))!) // Oops, could have some overflow or exception
    }
}
