aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuchen Pei <hi@ypei.me>2022-05-16 16:30:04 +1000
committerYuchen Pei <hi@ypei.me>2022-05-16 16:30:04 +1000
commit7dbf9cac51d47571666e74cec90680db99a5fe6c (patch)
tree92c1f30345cea33a5a8b76fefe8a0b70d7fef5b1
parent2f1c2a4c87ebd55b8a335bc4670eec875af8b4c4 (diff)
porting to ghc9.2.2: fixing types.hs
-rw-r--r--src/HaskellCodeExplorer/Types.hs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/HaskellCodeExplorer/Types.hs b/src/HaskellCodeExplorer/Types.hs
index b42db87..1bd9b25 100644
--- a/src/HaskellCodeExplorer/Types.hs
+++ b/src/HaskellCodeExplorer/Types.hs
@@ -25,7 +25,7 @@ import Data.Generics
, DataType
, Fixity(..)
, constrIndex
- , gcast2
+-- , gcast2
, mkConstr
, mkDataType
)
@@ -46,6 +46,7 @@ import Documentation.Haddock.Types
( DocH(..)
, Example(..)
, Header(..)
+ , ModLink(..)
, Hyperlink(..)
, Picture(..)
#if MIN_VERSION_GLASGOW_HASKELL(8,4,3,0)
@@ -481,7 +482,7 @@ instance (Data k, Data v, Eq k, Ord k, Data (IVM.Interval k)) =>
1 -> k (z IVM.fromList)
_ -> error "gunfold"
dataTypeOf _ = intervalMapDataType
- dataCast2 = gcast2
+ -- dataCast2 = gcast2
fromListConstr :: Constr
fromListConstr = mkConstr intervalMapDataType "fromList" [] Prefix
@@ -763,10 +764,13 @@ docToHtml modToHtml idToHtml = toStrict . renderHtml . toH
mapM_ (\(doc1, doc2) -> Html.dt (toH doc1) >> Html.dd (toH doc2)) docs
toH (DocCodeBlock doc) = Html.div Html.! Attr.class_ "source-code" $ toH doc
toH (DocIdentifierUnchecked modName) = modToHtml modName
- toH (DocModule str) = Html.span . Html.toHtml . T.pack $ str
- toH (DocHyperlink (Hyperlink url mbTitle)) =
+ toH (DocModule (ModLink url label)) =
+ -- Html.span . Html.toHtml . T.pack $ str
Html.a Html.! (Attr.href . Html.textValue . T.pack $ url) $
- Html.toHtml $ fromMaybe url mbTitle
+ fromMaybe (Html.toHtml url) $ toH <$> label
+ toH (DocHyperlink (Hyperlink url label)) =
+ Html.a Html.! (Attr.href . Html.textValue . T.pack $ url) $
+ fromMaybe (Html.toHtml url) $ toH <$> label
toH (DocPic (Picture uri mbTitle)) =
Html.img Html.! (Attr.src . Html.textValue . T.pack $ uri) Html.!
(Attr.title . Html.textValue . T.pack $ fromMaybe "" mbTitle)