title: Incomplete structured construct at or before this point in pattern matching
body: <p>So, I'm doing an assignment where I'm supposed to write a function that prints an image based on some a type, figure, which I have defined.</p>
  <p>I'm to use this library and it's functions with my own .fsx file, which should then be compiled and able to create images, based on a descriptive &quot;figure&quot;-type ;
  <a href="https://github.com/diku-dk/img-util-fs" rel="nofollow noreferrer">https://github.com/diku-dk/img-util-fs</a></p>
  <p>My .fsx code looks like this;</p>
  <pre><code>type point = int * int
  
  type color = ImgUtil.color
  
  type figure =
      | Circle of point * int * color
      | Rectangle of point * point * color
      | Mix of figure * figure
  
  
  
  let rec colorAt (x,y) figure =
      match figure with
          | Circle ((cx,cy), r, col) -&gt;
              if (x-cx)*(x-cx)+(y-cy)*(y-cy) &lt;= r*r
              then Some col else None
          | Rectangle ((x0,y0), (x1,y1), col) -&gt;
              if x0 &lt;=x &amp;&amp; x &lt;= x1 &amp;&amp; y0 &lt;= y &amp;&amp; y &lt;= y1
              then Some col else None
          | Mix (f1, f2) -&gt;
              match (colorAt (x,y) f1, colorAt (x,y) f2) with
                  |(None , c) -&gt; c
                  |(c, None) -&gt; c
                  |(Some c1, Some c2) -&gt;
                      let (a1 ,r1 ,g1 ,b1) = ImgUtil.fromColor c1
                      let (a2 ,r2 ,g2 ,b2) = ImgUtil.fromColor c2
                      in Some(ImgUtil.fromArgb ((a1+a2)/2, (r1+r2)/2,
                                                (g1+g2)/2, (b1+b2)/2))
  
  
  
  let figTest : figure =
      Circle ((50,50), 45, ImgUtil.fromRgb(255,0,0))
      Rectangle ((40,40), (90,110) ImgUtil.fromRgb (0,0,255))
  
  
  
  let makePicture (name:string * x:figure * b:int * h:int) : unit =
      let C = ImgUtil.mk b h
      for i = 0 to h
          do ImgUtil.setLine (ImgUtil.fromRgb(128,128,128)) (0,i) (b,i) C
      for n = (0,0) to (b-1,h-1) do
          match ImgUtil.getPixel n C with colorAt n x
              | None -&gt; (128,128,128)
              | Some col -&gt; colorAt n x
  do imgUtil.toPngFile (&quot;%A&quot; name) C
  
  do makePicture (&quot;figTest&quot; figTest 101 151)
  
  </code></pre>
  <p>But when I try to compile the library and my .fsx file I get the error
  &quot;8io.fsx(44.13): error FS0010: Incomplete structured construct at or before this point in pattern matching. Expected '-&gt;' or other token&quot;</p>
  <p>I'm fairly new to coding, and my code might not be usable, but it's the only compiling error I get, so I hope it's salvageable</p>