]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/RecordShorthand.scl
Merge commit 'a2a4242'
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / RecordShorthand.scl
1 import "Prelude"
2
3 data Vec = Vec { x :: Double, y :: Double }
4 deriving instance Show Vec
5
6 createVec x y = Vec {x, y}
7 sumVec Vec { x1, y1 } Vec { x2, y2 } = Vec { x = x1+x2, y = y1 + y2 }
8
9 main = sumVec (createVec 1 2) (createVec 3 4)
10 -- 
11 (Vec 4.0 6.0)