Closed dubiousjim closed 8 years ago
These further changes will get the package to typecheck and compile. I'm not sure if the behavior is correct, but on casual inspection the built app seems to work ok. Also, cabal test
reports:
1 of 1 test suites (1 of 1 test cases) passed.
Here are the patches:
diff -ru src/Haskell/Docs/Cabal.hs src2/Haskell/Docs/Cabal.hs
--- src/Haskell/Docs/Cabal.hs 2016-06-27 01:22:28.000000000 +0200
+++ src2/Haskell/Docs/Cabal.hs 2016-06-27 07:41:08.000000000 +0200
@@ -35,7 +35,7 @@
getAllPackages :: [String] -> Ghc [PackageConfig.PackageConfig]
getAllPackages _gs =
do flags <- getSessionDynFlags
- return (snd =<< fromMaybe [] (pkgDatabase flags))
+ return (fromMaybe [] (pkgDatabase flags))
-- | Version-portable version of allPackagesByName.
#if MIN_VERSION_Cabal (1,22,0)
diff -ru src/Haskell/Docs/Index.hs src2/Haskell/Docs/Index.hs
--- src/Haskell/Docs/Index.hs 2016-06-27 07:35:37.000000000 +0200
+++ src2/Haskell/Docs/Index.hs 2016-06-27 07:41:01.000000000 +0200
@@ -87,23 +87,22 @@
return (fromMaybe [] (pkgDatabase df)))
fmap (concat . map explode . concat)
(forM packages
- (\packages' ->
- join <$> sequence [do files <- getHaddockInterfacesByPackage package
- return
- (concat
- (map (map (\iface ->
- (getIdentifier package
- ,instMod iface
- ,instVisibleExports iface)) .
- ifInstalledIfaces)
- (rights files))) | package <- snd packages']))
+ (\package ->
+ do files <- getHaddockInterfacesByPackage package
+ return
+ (concat
+ (map (map (\iface ->
+ (getIdentifier package
+ ,instMod iface
+ ,instVisibleExports iface)) .
+ ifInstalledIfaces)
+ (rights files)))))
where explode (pkg,modu,names) =
map (showPackageName pkg
,moduleNameString (moduleName modu)
,)
(map getOccString names)
-
-- | Save the index to file.
saveIndex :: Index -> IO ()
saveIndex i =
So I'm not working on haskell-docs anymore in favor of stack hoogle
; are you interested in taking over maintainership?
Thanks. I'm afraid I don't have the understanding of the code base nor the time.
@chrisdone I could take it over if you'd like.
Cool! I'll hand over the keys.
@ivan-m If you remove your clone of mine then I'll transfer ownership to you. 👍
Done.
/me lets the power get to his head
ahem
Anyway, I'll try and get this resolved in the next few days.
@chrisdone can you please transfer/add me to the maintainers list on Hackage as well please? (And I'm assuming this is on Stackage, so I'll need to transfer that as well.)
Added you to maintainership of Hackage.
I don't think the patches I supplied above are quite right/adequate. The allow haskell-docs to build, but now it doesn't seem to locate module information. Witness:
$ haskell-docs Down
Package: base-4.9.0.0
Module: Data.Ord
Down
The Down type allows you to reverse sort order conveniently. A value of type
`Down a` contains a value of type `a` (represented as `Down a`).
If `a` has an `Ord` instance associated with it then comparing two
values thus wrapped will give you the opposite of their normal sort order.
This is particularly useful when sorting in generalised list comprehensions,
as in: `then sortWith by Down x`
Provides Show and Read instances (*since: 4.7.0.0*).
but:
$ haskell-docs Data.Ord
Couldn't find any packages with that module.
Also the parsing of package names probably isn't right:
$ haskell-docs mkRegex
Package: regex-compat-0.95.1-4nLo9klb6Pk7Tun1BAC3he
Module: Text.Regex
mkRegex :: String -> Regex
Makes a regular expression with the default options (multi-line,
case-sensitive). The syntax of regular expressions is
otherwise that of `egrep` (i.e. POSIX "extended" regular
expressions).
OK, I've now made haskell-docs buildable with GHC 8.0.1 and released on Hackage as 4.2.7. If parsing issues still occur, please open a new issue.
I started playing around to see what changes are needed to build with GHC 8.0.1. I haven't tried to understand the source base, but perhaps this work will help someone who does more quickly update this package.
I made these changes to haskell-docs.cabal:
Here are changes I made to the src directory:
That's not quite enough to get the package to build though. There are still issues in src/Haskell/Docs/Cabal.hs and in src/Haskell/Docs/Index.hs. The former gives the error:
And the latter: