on master help sign in
Process of determining the documentation in the REPL changed

from comparing on the "show" instance on the given name to pattern matching. Also renamed pprintType1Doc to more appropriate pprintTypeDoc.

commit17ad946ddfb7b2b17fd1d87e5badada179576e66 authorRossMeikleham <rossmeikleham@hotmail.co.uk> dateFri 29 May 2015, 14:51 (11 years ago) parent3643346
2 files changed+6−5
src/Idris/Docs.hs+3−3 src/Idris/REPL.hs+3−2
src/Idris/Docs.hs+3−3
@@ -1,6 +1,6 @@
11{-# LANGUAGE DeriveFunctor, PatternGuards, MultiWayIf #-}
22{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
3−module Idris.Docs (pprintDocs, getDocs, pprintConstDocs, pprintType1Doc, FunDoc, FunDoc'(..), Docs, Docs'(..)) where
3+module Idris.Docs (pprintDocs, getDocs, pprintConstDocs, pprintTypeDoc, FunDoc, FunDoc'(..), Docs, Docs'(..)) where
44
55import Idris.AbsSyntax
66import Idris.AbsSyntaxTree
@@ -319,6 +319,6 @@ pprintConstDocs ist c str = text "Primitive" <+> text (if constIsType c then "ty
319319 t _ = PType NoFC
320320
321321
322−pprintType1Doc :: IState -> Doc OutputAnnotation
323−pprintType1Doc ist = prettyIst ist (PType emptyFC) <+> colon <+> type1Doc <+>
322+pprintTypeDoc :: IState -> Doc OutputAnnotation
323+pprintTypeDoc ist = prettyIst ist (PType emptyFC) <+> colon <+> type1Doc <+>
324324 nest 4 (line <> text typeDescription)
src/Idris/REPL.hs+3−2
@@ -942,8 +942,9 @@ process fn (Core t)
942942
943943process fn (DocStr (Left n) w)
944944 = do ist <- getIState
945− case show n of
946− "Type" -> iRenderResult $ pprintType1Doc ist
945+ let txtType = txt "Type"
946+ case n of
947+ (UN txtType) -> iRenderResult $ pprintTypeDoc ist
947948 _ -> do let docs = lookupCtxtName n (idris_docstrings ist) ++
948949 map (\(n,d)-> (n, (d, [])))
949950 (lookupCtxtName (modDocN n) (idris_moduledocs ist))