]> gerrit.simantics Code Review - simantics/platform.git/blob - tests/org.simantics.scl.compiler.tests/src/org/simantics/scl/compiler/tests/scl/ListSyntax10.scl
Supply SVG text editor with element measurement context
[simantics/platform.git] / tests / org.simantics.scl.compiler.tests / src / org / simantics / scl / compiler / tests / scl / ListSyntax10.scl
1 import "Prelude"
2
3 dists l = sum [sqrt (dx*dx + dy*dy) 
4               | i <- [0..length l-2]
5               , (x1,y1) = l!i
6               , (x2,y2) = l!(i+1)
7               , dx = x1-x2
8               , dy = y1-y2 ]
9               
10 main = dists [(0,0),(1,1),(2,0)]
11 --            
12 2.8284271247461903