]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.compiler/tests/org/simantics/scl/compiler/tests/scl/RecordShorthand.scl
migrated to svn revision 33108
[simantics/platform.git] / bundles / org.simantics.scl.compiler / tests / 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)