2

I am a newbie to the elm.

According to the document,

lift2 : (a -> b -> c) -> Signal a -> Signal b -> Signal c

Combine two signals with a given function.

Can I have a way to do something like this?

(a->b->c) -> Signal a -> b -> Signal c

Is it true that the only way to do is first use constant : a -> Signal a and then use lift2

Just curious, is there a way to quickly let Signal a -> a, if possible?

4

1 回答 1

4

您将无法使用签名编写函数Signal a -> a

但是,应该可以写(a -> b -> c) -> Signal a -> b -> Signal c

这是你想要的吗?

foo : (a->b->c) -> Signal a -> b -> Signal c
foo f sa b = (flip f) b <~ sa
于 2014-11-14T17:11:41.697 回答