News for hackers. Stuff that matters.
Re:Try Haxe by andolanra on Sunday June 10, 2012 @05:55PM (#4092354)
They found me again at

  enum Cell<T> { nil; cons(car : T, cdr : Cell<T>); }
 
  class List {
    public static function mymap<A, B>(f : A -> B, l : Cell<A>) : Cell<B> {
      return switch(l) {
        case nil: nil;
        case cons(x, xs): cons(f(x), mymap(f, xs));
      }
    }
  }
Some of the Java heritage does seem slightly unpleasant, but interesting features like ML-style tagged enums and structural subtyping for record types mean I'm not going to discount the whole thing just yet.

There are no comments on this comment yet.