Depending on the return type, Signal (Int, Int) is not recognised as a tuple of (Int, Int).
Consider the following code:
import Graphics.Element exposing (..)
import Mouse
relativeMouseElement : (Int, Int) -> Element
relativeMouseElement mp = show (fst mp - 1000, snd mp - 1000)
relativeMouseTuple : (Int, Int) -> (Int, Int)
relativeMouseTuple mp = (fst mp - 1000, snd mp - 1000)
main =
-- Signal.map relativeMouse Mouse.position
relativeMouseTuple Mouse.position
Signal.map relativeMouse Mouse.position
works just fine, displays (-1000, -1000) to the browser and the values are adjusted according to the mouse movement.
relativeMouseTuple Mouse.position
This though does not work. The complication error I get is the following:
Function `relativeMouseTuple` is expecting the argument to be:
( Int, Int )
But it is:
Signal ( Int, Int )
I find this very weird. In both case the first argument is Signal (Int, Int) and in the second case it results to a type error.
Any ideas?