Haskell-Things / ImplicitCAD

A math-inspired CAD program in haskell. CSG, bevels, and shells; 2D & 3D geometry; 2D gcode generation...
https://implicitcad.org/
GNU Affero General Public License v3.0
1.39k stars 142 forks source link

Non-exhaustive patterns in case #109

Closed canadaduane closed 7 years ago

canadaduane commented 10 years ago

I feel like I must be doing something silly, but when I compile and run extopenscad, I get the following errors:

Macintosh:ImplicitCAD duane$ extopenscad -o test.svg <(cat <<-SCAD
union() {
    square([80,80]);
    translate ([80,80]) circle(30);
}
SCAD)
extopenscad: extopenscad.hs:(122,25)-(136,48): Non-exhaustive patterns in case

Macintosh:ImplicitCAD duane$ subl .
Macintosh:ImplicitCAD duane$ extopenscad <(cat <<-SCAD
union() {
    square([80,80]);
    translate ([80,80]) circle(30);
}
SCAD)
Rendering 2D object to /dev/fd/63.svg
UnionR2 0.0 [RectR 0.0 (0.0,0.0) (80.0,80.0),Translate2 (80.0,80.0) (Circle 30.0)]
extopenscad: /dev/fd/63.svg: openFile: does not exist (No such file or directory)

In the first case, I'm not sure why it is unable to detect the "svg" type ("Non-exhaustive patterns in case").

In the second case, I don't understand why it is trying to save to /dev/fd/*.svg by default.

I'm running on Mac OS X 10.9. I was originally using clang, but switched to gcc4.2.

canadaduane commented 10 years ago

Ok, so apparently the second error was my use of bash temp files that caused the issue. Using a real file works. I wonder why <(...) doesn't work for Haskell?

julialongtin commented 7 years ago

strange. have you tried the newest version?

canadaduane commented 7 years ago

Works now