on master help sign in
Use _ if all alternatives are unmatchable
commit8a2804d7bb45c8cbb07b2d8e4440d05f85e11f4e authorEdwin Brady <ecb10@st-andrews.ac.uk> dateFri 22 Nov 2013, 14:47 (13 years ago) parentd762b28
1 file changed+3−1
src/Idris/AbsSyntax.hs+3−1
src/Idris/AbsSyntax.hs+3−1
@@ -1295,7 +1295,9 @@ stripUnmatchable i (PApp fc fn args) = PApp fc fn (fmap (fmap su) args) where
12951295 su (PApp fc fn args)
12961296 = PApp fc fn (fmap (fmap su) args)
12971297 su (PAlternative b alts)
1298− = PAlternative b (filter (/= Placeholder) (map su alts))
1298+ = let alts' = filter (/= Placeholder) (map su alts) in
1299+ if null alts' then Placeholder
1300+ else PAlternative b alts'
12991301 su (PPair fc l r) = PPair fc (su l) (su r)
13001302 su (PDPair fc l t r) = PDPair fc (su l) (su t) (su r)
13011303 su t = t