purescript / documentation

Documentation for the PureScript language, compiler, and tools.
Other
1.03k stars 301 forks source link

Differences from Haskell: Records example - Could not match type Int with Number #444

Closed andrew-barnard closed 2 years ago

andrew-barnard commented 2 years ago

Whilst following the documentation at https://github.com/purescript/documentation/blob/master/language/Differences-from-Haskell.md#records, I receive the error Could not match type Int with type Number.

The type PointRec is defined as type PointRec = { x :: Number, y :: Number }.

Yet the example usage is

origin :: PointRec 
origin = { x: 0, y: 0 }

resulting in the type mismatch.

Suggest perhaps origin = { x: 0.0 , y: 0.0} ?

JordanMartinez commented 2 years ago

Yeah, that's need to be fixed and your suggestion is correct.

JordanMartinez commented 2 years ago

Closed by #445