Advertisement
blippy2

IHaskell ghci 7.10.1 patch

Apr 7th, 2015
296
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.33 KB | None | 0 0
  1. diff --git a/src/IHaskell/Eval/Evaluate.hs b/src/IHaskell/Eval/Evaluate.hs
  2. index 524f87c..5fdd0fb 100644
  3. --- a/src/IHaskell/Eval/Evaluate.hs
  4. +++ b/src/IHaskell/Eval/Evaluate.hs
  5. @@ -183,8 +183,8 @@ initializeImports = do
  6.                               pkg <- db
  7.                               depId <- depends pkg
  8.                               dep <- filter ((== depId) . installedPackageId) db
  9. -                             guard
  10. -                               (iHaskellPkgName `isPrefixOf` packageIdString (packageConfigId dep))
  11. +                             let idString = packageIdString' dflags (packageConfigId dep)
  12. +                             guard (iHaskellPkgName `isPrefixOf` idString)
  13.  
  14.                             -- ideally the Paths_ihaskell module could provide a way to get the hash too
  15.                             -- (ihaskell-0.2.0.5-f2bce922fa881611f72dfc4a854353b9), for now. Things will end badly if you also
  16. diff --git a/src/IHaskell/Eval/Hoogle.hs b/src/IHaskell/Eval/Hoogle.hs
  17. index 2726273..91bdffc 100644
  18. --- a/src/IHaskell/Eval/Hoogle.hs
  19. +++ b/src/IHaskell/Eval/Hoogle.hs
  20. @@ -8,7 +8,7 @@ module IHaskell.Eval.Hoogle (
  21.      HoogleResult,
  22.      ) where
  23.  
  24. -import           ClassyPrelude hiding (last, span, div)
  25. +import           ClassyPrelude hiding (last, span, div)
  26.  import           Text.Printf
  27.  import           Network.HTTP.Client
  28.  import           Network.HTTP.Client.TLS
  29. @@ -17,7 +17,7 @@ import           Data.String.Utils
  30.  import           Data.List (elemIndex, (!!), last)
  31.  import           Data.Char (isAscii, isAlphaNum)
  32.  import qualified Data.ByteString.Lazy.Char8 as Char
  33. -import qualified Prelude as P
  34. +import qualified Prelude as P (div, foldr, fromEnum)
  35.  
  36.  
  37.  import           IHaskell.IPython
  38. @@ -66,10 +66,12 @@ query str = do
  39.  urlEncode :: String -> String
  40.  urlEncode [] = []
  41.  urlEncode (ch:t)
  42. -  | (isAscii ch && isAlphaNum ch) || ch `P.elem` "-_.~" = ch : urlEncode t
  43. +  | (isAscii ch && isAlphaNum ch) || ch `isIn` "-_.~" = ch : urlEncode t
  44.    | not (isAscii ch) = P.foldr escape (urlEncode t) (eightBs [] (P.fromEnum ch))
  45.    | otherwise = escape (P.fromEnum ch) (urlEncode t)
  46.    where
  47. +    isIn ch ([]) = False
  48. +    isIn ch (s:ss) = if (ch== s) then True else isIn ch ss
  49.      escape :: Int -> String -> String
  50.      escape b rs = '%' : showH (b `P.div` 16) (showH (b `mod` 16) rs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement