
26 Nov
2017
26 Nov
'17
3:24 p.m.
On Sun, Nov 26, 2017 at 07:39:49PM +0100, Patrik Iselind wrote:
Does this mean that i can write `delta :: Point Double t -> Point Double t -> Direction d` as a type declaration. Then i would require `Coordinate Double Double` as in parameters. Correct?
Careful there! Let's take a simple data declaration data Point = Point Int Float On the right you have *the type*, on the left you have *the (data) constructor*. When you are writing signatures you are writing types, so f :: Point -> Point and not f :: Point Int Float -> Point Int Float Much like you write `addition :: Int -> Int -> Int` and not `addition :: 7 -> 2 -> 9`.