@@ -7,7 +7,7 @@ import Either
7import Native.Matrix2D as Matrix
7import Native.Matrix2D as Matrix
8import Native.Graphics.Collage as N
8import Native.Graphics.Collage as N
9import Graphics.Element
9import Graphics.Element
10−import Color as Color
10+import Color
12type Form = {
12type Form = {
13 theta : Float,
13 theta : Float,
@@ -53,7 +53,7 @@ defaultLine = {
53 cap = Flat,
53 cap = Flat,
54 join = Sharp 10,
54 join = Sharp 10,
55 dashing = [],
55 dashing = [],
56− dashOffset = 0,
56+ dashOffset = 0
59-- Create a solid line style with a given color.
59-- Create a solid line style with a given color.
@@ -73,11 +73,11 @@ data BasicForm
73 | FShape (Either LineStyle FillStyle) Shape
73 | FShape (Either LineStyle FillStyle) Shape
74 | FImage Int Int (Int,Int) String
74 | FImage Int Int (Int,Int) String
75 | FElement Element
75 | FElement Element
76− | FGroup Matrix [Form]
76+ | FGroup Matrix2D [Form]
78form f = { theta = 0, scale = 1, x = 0, y = 0, form = f }
78form f = { theta = 0, scale = 1, x = 0, y = 0, form = f }
80−fill style shape = form (FShape (Right style) shape)
80+fill style shape = form (FShape (Either.Right style) shape)
82-- Create a filled in shape.
82-- Create a filled in shape.
83filled : Color -> Shape -> Form
83filled : Color -> Shape -> Form
@@ -94,7 +94,7 @@ gradient grad shape = fill (Gradient grad) shape
95-- Outline a shape with a given line style.
95-- Outline a shape with a given line style.
96outlined : LineStyle -> Shape -> Form
96outlined : LineStyle -> Shape -> Form
97−outlined style shape = form (FShape (Left style) shape)
97+outlined style shape = form (FShape (Either.Left style) shape)
99-- Trace a path with a given line style.
99-- Trace a path with a given line style.
100traced : LineStyle -> Path -> Form
100traced : LineStyle -> Path -> Form
@@ -186,7 +186,7 @@ oval w h =
188 f i = (hw * Math.cos (t*i), hh * Math.sin (t*i))
188 f i = (hw * Math.cos (t*i), hh * Math.sin (t*i))
189− in map f [0..n-1]
189+ in List.map f [0..n-1]
191-- A circle with a given radius.
191-- A circle with a given radius.
192circle : Number a -> Shape
192circle : Number a -> Shape
@@ -202,4 +202,4 @@ ngon n r =
202 let m = toFloat n
202 let m = toFloat n
203 t = 2 * Math.PI / m
203 t = 2 * Math.PI / m
204 f i = ( r * Math.cos (t*i), r * Math.sin (t*i) )
204 f i = ( r * Math.cos (t*i), r * Math.sin (t*i) )
205− in map f [0..n-1]
205+ in List.map f [0..n-1]