[commit: haddock] alexbiehl-patch-1, ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr-filter-maps, pr/cabal-desc, v2.18, wip/T14529, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Haddock: Fix broken lazy IO in prologue reading (#615) (b35eed2)
git at git.haskell.org
git at git.haskell.org
Tue Nov 28 11:52:04 UTC 2017
- Previous message: [commit: haddock] ghc-head, ghc-head1, ie_avails, wip/T14529, wip/new-tree-one-param, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Haddock: Fix broken lazy IO in prologue reading (#615) (b7d7b7a)
- Next message: [commit: haddock] alexbiehl-patch-1, ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr-filter-maps, pr/cabal-desc, v2.18, wip/T14529, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Consequently use inClass and notInClass in haddock-library (#617) (c836dd4)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Repository : ssh://git@git.haskell.org/haddock
On branches: alexbiehl-patch-1,ghc-head,ghc-head1,headdock-library-1.4.5,ie_avails,master,pr-filter-maps,pr/cabal-desc,v2.18,wip/T14529,wip/revert-ttg-2017-11-20,wip/ttg-2017-10-13,wip/ttg-2017-10-31,wip/ttg-2017-11-06,wip/ttg2-2017-11-10,wip/ttg3-2017-11-12,wip/ttg4-constraints-2017-11-13,wip/ttg6-unrevert-2017-11-22
Link : http://git.haskell.org/haddock.git/commitdiff/b35eed2a9f1c82131f51f55c771ac2372127520d
>---------------------------------------------------------------
commit b35eed2a9f1c82131f51f55c771ac2372127520d
Author: Alex Biehl <alexbiehl at gmail.com>
Date: Fri May 12 21:02:33 2017 +0200
Haddock: Fix broken lazy IO in prologue reading (#615)
We previously used withFile in conjunction with hGetContents. The list returned
by the latter wasn't completely forced by the time we left the withFile block,
meaning that we would try to read from a closed handle.
>---------------------------------------------------------------
b35eed2a9f1c82131f51f55c771ac2372127520d
haddock-api/src/Haddock.hs | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/haddock-api/src/Haddock.hs b/haddock-api/src/Haddock.hs
index 3971a5b..f0e7e6c 100644
--- a/haddock-api/src/Haddock.hs
+++ b/haddock-api/src/Haddock.hs
@@ -547,9 +547,10 @@ getPrologue :: DynFlags -> [Flag] -> IO (Maybe (MDoc RdrName))
getPrologue dflags flags =
case [filename | Flag_Prologue filename <- flags ] of
[] -> return Nothing
- [filename] -> withFile filename ReadMode $ \h -> do
+ [filename] -> do
+ h <- openFile filename ReadMode
hSetEncoding h utf8
- str <- hGetContents h
+ str <- hGetContents h -- semi-closes the handle
return . Just $! parseParas dflags str
_ -> throwE "multiple -p/--prologue options"
- Previous message: [commit: haddock] ghc-head, ghc-head1, ie_avails, wip/T14529, wip/new-tree-one-param, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Haddock: Fix broken lazy IO in prologue reading (#615) (b7d7b7a)
- Next message: [commit: haddock] alexbiehl-patch-1, ghc-head, ghc-head1, headdock-library-1.4.5, ie_avails, master, pr-filter-maps, pr/cabal-desc, v2.18, wip/T14529, wip/revert-ttg-2017-11-20, wip/ttg-2017-10-13, wip/ttg-2017-10-31, wip/ttg-2017-11-06, wip/ttg2-2017-11-10, wip/ttg3-2017-11-12, wip/ttg4-constraints-2017-11-13, wip/ttg6-unrevert-2017-11-22: Consequently use inClass and notInClass in haddock-library (#617) (c836dd4)
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the ghc-commits
mailing list