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.
Functions are public by default. You could leave that out.
The main function has to be static and will serve as the entrance point of the program, not the class.
So this might just look like too much when in fact this is just a very small code sample.
Did I address some of your concerns, or did I miss the point entirely? Just curious.
Yeah, and those shoes totally don't match that purse! What an outrage!
Seriously, if you're prepared to throw out the whole language based on what its syntax resembles, your decision-making process might need a bit of work.