data List a = Nil | Cons a (List a)

main = (print . sum_ . map_ double . upto) (1,100)

sum_ (Cons x xs) = x + sum_ xs
sum_ Nil = 0

map_ f (Cons x xs) = Cons (f x) (map_ f xs)
map_ f Nil = Nil

upto (m,n) = upto' m
  where
    upto' m = if m>n then Nil else Cons m (upto' (m+1))

double x = x + x

