on master help sign in
Fixed pattern matching on Text type in processing the DocStr in REPL.
9a44883RossMeikleham
src/Idris/REPL.hs+16−17
@@ -941,23 +941,22 @@ process fn (Core t)
941 iPrintTermWithType (pprintTT [] tm) (pprintTT [] ty)
941 iPrintTermWithType (pprintTT [] tm) (pprintTT [] ty)
942
942
943process fn (DocStr (Left n) w)
943process fn (DocStr (Left n) w)
944− = do ist <- getIState
945− let txtType = txt "Type"
946− case n of
947− (UN txtType) -> iRenderResult $ pprintTypeDoc ist
944+ | UN ty <- n, ty == T.pack "Type" = getIState >>= iRenderResult . pprintTypeDoc
945+ | otherwise = do
946+ ist <- getIState
948− _ -> do let docs = lookupCtxtName n (idris_docstrings ist) ++
947+ let docs = lookupCtxtName n (idris_docstrings ist) ++
949− map (\(n,d)-> (n, (d, [])))
948+ map (\(n,d)-> (n, (d, [])))
950− (lookupCtxtName (modDocN n) (idris_moduledocs ist))
949+ (lookupCtxtName (modDocN n) (idris_moduledocs ist))
951− case docs of
950+ case docs of
952− [] -> iPrintError $ "No documentation for " ++ show n
951+ [] -> iPrintError $ "No documentation for " ++ show n
953− ns -> do toShow <- mapM (showDoc ist) ns
952+ ns -> do toShow <- mapM (showDoc ist) ns
954− iRenderResult (vsep toShow)
953+ iRenderResult (vsep toShow)
955− where showDoc ist (n, d) = do doc <- getDocs n w
954+ where showDoc ist (n, d) = do doc <- getDocs n w
956− return $ pprintDocs ist doc
955+ return $ pprintDocs ist doc
957−
956+
958− modDocN (NS (UN n) ns) = NS modDocName (n:ns)
957+ modDocN (NS (UN n) ns) = NS modDocName (n:ns)
959− modDocN (UN n) = NS modDocName [n]
958+ modDocN (UN n) = NS modDocName [n]
960− modDocN _ = sMN 1 "NotFoundForSure"
959+ modDocN _ = sMN 1 "NotFoundForSure"
961
960
962process fn (DocStr (Right c) _) -- constants only have overviews
961process fn (DocStr (Right c) _) -- constants only have overviews
963 = do ist <- getIState
962 = do ist <- getIState