on master help sign in
Remove partiality from IdrisDoc
commit8b3b6e843913bfdc6bac977c9f598d65b38bffd0 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateThu 2 Apr 2015, 12:27 (12 years ago) parent220011e
1 file changed+7−2
src/Idris/IdrisDoc.hs+7−2
src/Idris/IdrisDoc.hs+7−2
@@ -1,5 +1,6 @@
11{-# LANGUAGE PatternGuards #-}
22{-# LANGUAGE OverloadedStrings #-}
3+{-# OPTIONS_GHC -fwarn-incomplete-patterns #-}
34
45-- | Generation of HTML documentation for Idris code
56module Idris.IdrisDoc (generateDocs) where
@@ -217,9 +218,11 @@ referredNss (n, Just d, _) =
217218 names = concatMap (extractPTermNames) ts
218219 in S.map getNs $ S.fromList names
219220
220− where getFunDocs (FunDoc f) = [f]
221− getFunDocs (DataDoc f fs) = f:fs
221+ where getFunDocs (FunDoc f) = [f]
222+ getFunDocs (DataDoc f fs) = f:fs
222223 getFunDocs (ClassDoc _ _ fs _ _ _ _) = fs
224+ getFunDocs (NamedInstanceDoc _ fd) = [fd]
225+ getFunDocs (ModDoc _ _) = []
223226 types (FD _ _ args t _) = t:(map second args)
224227 second (_, x, _, _) = x
225228
@@ -609,6 +612,8 @@ createOtherDoc ist (DataDoc fd@(FD n docstring args _ _) fds) = do
609612 H.dt $ toHtml $ show name
610613 H.dd $ Docstrings.renderHtml docstring
611614
615+createOtherDoc ist (NamedInstanceDoc _ fd) = createFunDoc ist fd
616+
612617createOtherDoc ist (ModDoc _ docstring) = do
613618 Docstrings.renderHtml docstring
614619