Permalink
Browse files

Placate some version of GHC.

Apparently some versions of GHC are getting antsy about type checking.
In one case, it can be excused as polymorphism. The other case was
trivial inference, so I'm rather confused. In any case, all versions of
GHC I've tried are happy now...
  • Loading branch information...
1 parent 10fc5b3 commit 3260827016423a13284c9c525342a8ce98def047 @colah committed Aug 14, 2012
Showing with 6 additions and 2 deletions.
  1. +2 −1 Graphics/Implicit/Export/MarchingSquares.hs
  2. +4 −1 Graphics/Implicit/ExtOpenScad/Statements.hs
@@ -169,8 +169,9 @@ reducePolyline l = l
orderLinesDC :: [[[Polyline]]] -> [Polyline]
orderLinesDC segs =
let
+ halve :: [a] -> ([a], [a])
halve l = splitAt (div (length l) 2) l
- splitOrder segs = case (\(x,y) -> (halve x, halve y)) $ unzip $ map (halve) segs of
+ splitOrder segs = case (\(x,y) -> (halve x, halve y)) . unzip . map (halve) $ segs of
((a,b),(c,d)) -> orderLinesDC a ++ orderLinesDC b ++ orderLinesDC c ++ orderLinesDC d
in
if (length segs < 5 || length (head segs) < 5 ) then concat $ concat segs else
@@ -110,6 +110,7 @@ comment =
manyTill anyChar (try $ string "*/")
)) >> return id) <?> "comment"
+throwAway :: GenParser Char st ComputationStateModifier
throwAway = do
many space
oneOf "%*"
@@ -261,6 +262,7 @@ echoStatement = do
return state
+ifStatement :: GenParser Char st ComputationStateModifier
ifStatement = (do
line <- fmap sourceLine getPosition
string "if"
@@ -289,6 +291,7 @@ ifStatement = (do
return state
) <?> "if statement"
+forStatement :: GenParser Char st ComputationStateModifier
forStatement = (do
line <- fmap sourceLine getPosition
-- a for loop is of the form:
@@ -424,7 +427,7 @@ userModule = do
return state
-
+userModuleDeclaration :: GenParser Char st ComputationStateModifier
userModuleDeclaration = do
string "module"
many space;

0 comments on commit 3260827

Please sign in to comment.