chainl = (obj) => {
 return (f, arg) => {
  if (!f) return obj
  return chainl(f(arg, obj))
 }
}

cons = (x, xs) => [x, xs]

foreach = (lst, f) => {
 if(!lst) return
 [x, xs] = lst
 f(x)
 foreach(f, xs)
}

linkedList =
 chainl(null)(
  cons, 1)(
  cons, 2)(
  cons, 3)()

chainl(linkedList)(foreach, console.log)()
// 3
// 2
// 1

いろいろ書けるんだな