RosettaCodeData/Task/Named-parameters/Haskell/named-parameters-2.hs
Ingy döt Net b83f433714 tasks a-s
2013-04-10 23:57:08 -07:00

6 lines
196 B
Haskell

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 })