on master help sign in
Simplify argsToAlt.
commit61f34560f5c4a2e1927430d041b51f10a12971f9 authorMatus Tejiscak <ziman@functor.sk> dateSun 6 Jul 2014, 01:47 (12 years ago) parent98352ee
1 file changed+2−5
src/Idris/Core/CaseTree.hs+2−5
src/Idris/Core/CaseTree.hs+2−5
@@ -549,11 +549,8 @@ argsToAlt :: [Int] -> [([Pat], Clause)] -> CaseBuilder ([Name], [Name], [Name],
549549argsToAlt _ [] = return ([], [], [], [])
550550argsToAlt inacc rs@((r, m) : rest) = do
551551 newVars <- getNewVars r
552− return $ case inacc of
553− [] -> (newVars, newVars, [], addRs rs) -- no inaccessible arguments, simple.
554−
555− _ | (accVars, inaccVars) <- partitionAcc newVars
556− -> (newVars, accVars, inaccVars, addRs rs)
552+ let (accVars, inaccVars) = partitionAcc newVars
553+ return (newVars, accVars, inaccVars, addRs rs)
557554 where
558555 -- Create names for new variables arising from the given patterns.
559556 getNewVars :: [Pat] -> CaseBuilder [Name]