on master help sign in
Stylish fixes
ed80b7dEdwin Brady
src/Idris/IBC.hs+5−5
@@ -12,7 +12,7 @@ Maintainer : The Idris Community.
12
12
13module Idris.IBC (loadIBC, loadPkgIndex,
13module Idris.IBC (loadIBC, loadPkgIndex,
14 writeIBC, writePkgIndex,
14 writeIBC, writePkgIndex,
15− hasValidIBCVersion, IBCPhase(..),
15+ hasValidIBCVersion, IBCPhase(..),
16 getIBCHash, getImportHashes) where
16 getIBCHash, getImportHashes) where
17
17
18import Idris.AbsSyntax
18import Idris.AbsSyntax
@@ -152,7 +152,7 @@ getIBCHash fp
152 case toArchiveOrFail archiveFile of
152 case toArchiveOrFail archiveFile of
153 Left _ -> return 0
153 Left _ -> return 0
154 Right archive -> getEntry 0 "iface_hash" archive
154 Right archive -> getEntry 0 "iface_hash" archive
155−
155+
156
156
157getImportHashes :: FilePath -> Idris [(FilePath, Int)]
157getImportHashes :: FilePath -> Idris [(FilePath, Int)]
158getImportHashes fp
158getImportHashes fp
@@ -259,12 +259,12 @@ qhash hash (x:xs) = qhash (hash * 33 + fromIntegral (fromEnum x)) xs
259
259
260hashTerm :: Term -> Int
260hashTerm :: Term -> Int
261hashTerm t = qhash 5381 (show t)
261hashTerm t = qhash 5381 (show t)
262−
262+
263hashName :: Name -> Int
263hashName :: Name -> Int
264hashName n = qhash 5381 (show n)
264hashName n = qhash 5381 (show n)
265
265
266calculateHash :: IState -> IBCFile -> Int
266calculateHash :: IState -> IBCFile -> Int
267−calculateHash ist f
267+calculateHash ist f
268 = let acc = L.filter exported (ibc_access f) in
268 = let acc = L.filter exported (ibc_access f) in
269 mkHashFrom (map fst acc) (getDefs acc)
269 mkHashFrom (map fst acc) (getDefs acc)
270 where
270 where
@@ -276,7 +276,7 @@ calculateHash ist f
276 exported _ = False
276 exported _ = False
277
277
278 findTms :: [(a, Term, Term)] -> [Term]
278 findTms :: [(a, Term, Term)] -> [Term]
279− findTms = L.concatMap (\ (_, x, y) -> [x, y])
279+ findTms = L.concatMap (\ (_, x, y) -> [x, y])
280
280
281 patDef :: Name -> [Term]
281 patDef :: Name -> [Term]
282 patDef n
282 patDef n
src/Idris/Parser.hs+4−3
@@ -55,7 +55,8 @@ import Data.Maybe
55import Data.Ord
55import Data.Ord
56import qualified Data.Set as S
56import qualified Data.Set as S
57import qualified Data.Text as T
57import qualified Data.Text as T
58−import qualified System.Directory as Dir (makeAbsolute, getModificationTime, doesFileExist)
58+import qualified System.Directory as Dir (doesFileExist, getModificationTime,
59+ makeAbsolute)
59import System.FilePath
60import System.FilePath
60import Text.Megaparsec ((<?>))
61import Text.Megaparsec ((<?>))
61import qualified Text.Megaparsec as P
62import qualified Text.Megaparsec as P
@@ -1678,7 +1679,7 @@ loadSource lidr f toline
1678 -- hashes are the same as the ones we've just read,
1679 -- hashes are the same as the ones we've just read,
1679 -- quit and just load the IBC
1680 -- quit and just load the IBC
1680
1681
1681− let needLoad = (ibcmod <= fmod) ||
1682+ let needLoad = (ibcmod <= fmod) ||
1682 (sort impHashes /= sort (mapMaybe id newHashes))
1683 (sort impHashes /= sort (mapMaybe id newHashes))
1683
1684
1684 if not needLoad
1685 if not needLoad
@@ -1724,7 +1725,7 @@ loadSource lidr f toline
1724 i <- getIState
1725 i <- getIState
1725 putIState (i { default_access = Private, module_aliases = modAliases })
1726 putIState (i { default_access = Private, module_aliases = modAliases })
1726 clearIBC -- start a new .ibc file
1727 clearIBC -- start a new .ibc file
1727− mapM_ addIBC (map (\ (f, h) -> IBCImportHash f h)
1728+ mapM_ addIBC (map (\ (f, h) -> IBCImportHash f h)
1728 (mapMaybe id newHashes))
1729 (mapMaybe id newHashes))
1729 -- record package info in .ibc
1730 -- record package info in .ibc
1730 imps <- allImportDirs
1731 imps <- allImportDirs