3

I'm trying to understand Elm. I have a bit of experience with Bacon.js, and it seems to me that lift is, basically, Bacon.js's internal map() function renamed.

Is there more to it than that?

Elf Sternberg
  • 16,129
  • 6
  • 60
  • 68

1 Answers1

4

Sure, that's the same thing. With the lift2..8 functions you can do the same thing that you'd do with Bacon.combineWith.

Signals in Elm (just like Properties in Bacon) are Functors and Applicative Functors, where the former allows you to lift an unary function to the realm of Signals (Elm: lift, Bacon: map, Rx: select), while the latter allows you to lift n-ary functions (Elm: lift2..8, Bacon: combineWith, Rx: combineLatest).

raimohanska
  • 3,265
  • 17
  • 28
  • Can you give some background of the "lift" term? – Nek Sep 14 '13 at 01:30
  • 2
    "Lifting is a concept which allows you to transform a function into a corresponding function within another (usually more general) setting." http://www.haskell.org/haskellwiki/Lifting – raimohanska Sep 15 '13 at 15:44