@@ -189,9 +189,9 @@ elabClauses info' fc opts n_in cs =
190 ist <- getIState
190 ist <- getIState
191 -- let wf = wellFounded ist n sc
191 -- let wf = wellFounded ist n sc
192− let tot = if pcover || AssertTotal `elem` opts
192+ let tot | pcover || AssertTotal `elem` opts = Unchecked -- finish later
193− then Unchecked -- finish checking later
193+ | PEGenerated `elem` opts = Generated
194− else Partial NotCovering -- already know it's not total
194+ | otherwise = Partial NotCovering -- already know it's not total
196 -- case lookupCtxt (namespace info) n (idris_flags ist) of
196 -- case lookupCtxt (namespace info) n (idris_flags ist) of
197 -- [fs] -> if TotalFn `elem` fs
197 -- [fs] -> if TotalFn `elem` fs
@@ -241,7 +241,8 @@ elabClauses info' fc opts n_in cs =
241 setContext ctxt'
241 setContext ctxt'
242 addIBC (IBCDef n)
242 addIBC (IBCDef n)
243 setTotality n tot
243 setTotality n tot
244+ when (not reflect && PEGenerated `notElem` opts) $
244− when (not reflect) $ do totcheck (fc, n)
245+ do totcheck (fc, n)
245 defer_totcheck (fc, n)
246 defer_totcheck (fc, n)
246 when (tot /= Unchecked) $ addIBC (IBCTotal n tot)
247 when (tot /= Unchecked) $ addIBC (IBCTotal n tot)
247 i <- getIState
248 i <- getIState
@@ -372,18 +373,19 @@ elabPE info fc caller r =
372 logLvl 3 $ "PE definition " ++ show newnm ++ ":\n" ++
373 logLvl 3 $ "PE definition " ++ show newnm ++ ":\n" ++
373 showSep "\n"
374 showSep "\n"
374 (map (\ (lhs, rhs) ->
375 (map (\ (lhs, rhs) ->
375− (show lhs ++ " = " ++
376+ (showTmImpls lhs ++ " = " ++
376 showTmImpls rhs)) (pe_clauses specdecl))
377 showTmImpls rhs)) (pe_clauses specdecl))
378 logLvl 2 $ show n ++ " transformation rule: " ++
379 logLvl 2 $ show n ++ " transformation rule: " ++
379− show rhs ++ " ==> " ++ show lhs
380+ showTmImpls rhs ++ " ==> " ++ showTmImpls lhs
381 elabType info defaultSyntax emptyDocstring [] fc opts newnm NoFC specTy
382 elabType info defaultSyntax emptyDocstring [] fc opts newnm NoFC specTy
382 let def = map (\(lhs, rhs) ->
383 let def = map (\(lhs, rhs) ->
384+ let lhs' = mapPT hiddenToPH $ stripUnmatchable ist lhs in
383− PClause fc newnm lhs [] rhs [])
385+ PClause fc newnm lhs' [] rhs [])
384 (pe_clauses specdecl)
386 (pe_clauses specdecl)
385 trans <- elabTransform info fc False rhs lhs
387 trans <- elabTransform info fc False rhs lhs
386− elabClauses info fc opts newnm def
388+ elabClauses info fc (PEGenerated:opts) newnm def
387 return [trans]
389 return [trans]
388 else return [])
390 else return [])
389 -- if it doesn't work, just don't specialise. Could happen for lots
391 -- if it doesn't work, just don't specialise. Could happen for lots
@@ -392,6 +394,9 @@ elabPE info fc caller r =
392 (\e -> do logLvl 3 $ "Couldn't specialise: " ++ (pshow ist e)
394 (\e -> do logLvl 3 $ "Couldn't specialise: " ++ (pshow ist e)
393 return [])
395 return [])
397+ hiddenToPH (PHidden _) = Placeholder
395 specName simpl (ImplicitS, tm)
400 specName simpl (ImplicitS, tm)
396 | (P Ref n _, _) <- unApply tm = Just (n, Just (if simpl then 1 else 0))
401 | (P Ref n _, _) <- unApply tm = Just (n, Just (if simpl then 1 else 0))
397 specName simpl (ExplicitS, tm)
402 specName simpl (ExplicitS, tm)