News for hackers. Stuff that matters.
Re:Lists and Lists (1996) by rntz on Sunday December 14, 2014 @07:23AM (#8748133)

    data Sexp = Int Int | Nil | Cons Sexp Sexp
    megasum Nil = 0
    megasum (Int i) = i
    megasum (Cons l r) = megasum l + megasum r
Re:Lists and Lists (1996) by harryjo on Sunday December 14, 2014 @11:05AM (#8748595)
Indeed. The first step to grokking Lisp, from Haskell (or any typed language), is to realize that Lisp's "list" is not equivalent to any single data type you've used before, but it's really a general weakly-structured representation of any and all structured types.

Even this solution is not completely equivalent to Lisp megasum -- it fails to compile on the list `('a)` ;-)