     self = l
   }
 }
-
 
 public class ListGenerator<A> : GeneratorType {
   var l : Box<List<A>?>

  }
}

public func ==<A : Equatable>(lhs : List<A>, rhs : List<A>) -> Bool {
  switch (lhs, rhs) {
  case (.Nil, .Nil):
    return true
  case let (.Cons(lHead, lTail), .Cons(rHead, rTail)):
    return lHead == rHead && lTail.value == rTail.value
  default:
    return false
  }
}

extension List : ArrayLiteralConvertible {
  typealias Element = A

  public init(arrayLiteral s: Element...) {
    var xs : [A] = []
    var g = s.generate()

/// This is not currently possible with a bit of misdirection, hence the Box class.
public enum List<A> {
  case Nil
  case Cons(@autoclosure() -> A, Box<List<A>>)

  public init() {
    self = .Nil
