   }
 }
 
-extension LazyList {
-  func map<T>(transform: (Element -> T)) -> LazyList<T> {
-    switch self {
-    case .Nil:
-      let ret: LazyList<T> = .Nil
-      return ret
-    case .Cons(let head, let tail):
-      let ret: LazyList<T> = .Cons(head: transform(head), tail: {tail().map(transform)})
-      return ret
-    }
-  }
-}
-
-
-
+public func |> <T>(lhs: T, rhs: LazyList<T>) -> LazyList<T> {
+  return LazyList.Cons(head: lhs, tail: {rhs})
+}
+
+public func |> <T>(lhs: T, rhs: () -> LazyList<T>) -> LazyList<T> {
+  return LazyList.Cons(head: lhs, tail: rhs)
+}
+
+extension LazyList : Indexable {
+  public var startIndex: Int { return 0 }
+  public var endIndex: Int {
+    switch self {
+    case .Nil: return 0
+    case .Cons(_, let tail): return tail().endIndex.successor()
+    }
+  }
+  public func with(val: Element, atIndex n: Int) -> LazyList<Element> {
+    switch (n, self) {
+    case (0, .Cons(_, let tail)): return val |> tail
+    case (_, .Cons(let head, let tail)): return head |> {tail().with(val, atIndex: n - 1)}
+    case (_, .Nil): fatalError("Index out of range")
+    }
+  }
+  public subscript(n: Int) -> Element {
+    get {
+      switch (n, self) {
+      case (0, .Cons(let head, _)): return head
+      case (_, .Cons(_, let tail)): return tail()[n - 1]
+      case (_, .Nil): fatalError("Index out of range")
+      }
+    } set {
+      self = with(newValue, atIndex: n)
+    }
+  }
+}

  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))
    }
  }
  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))
    }
  }
  public func extended<

}

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())
  }
}

