   public func appended(with: Element) -> List<Element> {
     switch self {
     case .Nil: return [with]
-    case .Cons(let head, let tail): return List.Cons(head: head, tail: tail.appended(with))
+    case .Cons(let head, let tail): return head |> tail.appended(with)
     }
   }
   public func extended(with: List<Element>) -> List<Element> {
     switch self {
     case .Nil: return with
-    case .Cons(let head, let tail): return List.Cons(head: head, tail: tail.extended(with))
+    case .Cons(let head, let tail): return head |> tail.extended(with)
     }
   }
   public func extended<

  case Cons(head: Element, tail: () -> LazyList<Element>)
}

public extension LazyList {
  init<G : GeneratorType where G.Element == Element>(var gen: G) {
    self = gen.next().map {Cons(head: $0, tail: {LazyList(gen: gen)})} ?? Nil
  }
}

public extension LazyList {
  init<S : SequenceType where S.Generator.Element == Element>(seq: S) {
    self = LazyList(gen: seq.generate())
  }
}

public func lazy<T>(list: List<T>) -> LazyList<T> {
  return LazyList(seq: list)
}

public struct LazyListGenerator<Element> : GeneratorType {

}

extension List : ArrayLiteralConvertible {
  public init<G : GeneratorType where G.Element == Element>(var _ gen: G) {
    self = gen.next().map {.Cons(head: $0, tail: List(gen))} ?? .Nil
  }
  public init<S : SequenceType where S.Generator.Element == Element>(seq: S) {
    self = List(seq.generate())
  }
  public init(arrayLiteral: Element...) {
    self = List(arrayLiteral.generate())
  }
}

