RosettaCodeData/Task/Named-parameters/Haskell/named-parameters-2.hs

7 lines
196 B
Haskell
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
data Point = Point {x, y :: Int} deriving Show
defaultPoint = Point {x = 0, y = 0}
createPointAt :: Point -> Point
createPointAt = id
main = print $ createPointAt (defaultPoint { y = 3, x = 5 })