Skip to content

Commit

Permalink
do a minimal change to get this type error fixed
Browse files Browse the repository at this point in the history
TODO: this change probably needs to be more extensive in this area

Related to issue commercialhaskell#1337 . It is now possible to build 'stack' in
attempting to fix this issue.
  • Loading branch information
kadoban committed Nov 17, 2015
1 parent 48b0a63 commit 6d212a0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Stack/PackageIndex.hs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import qualified Data.Map.Strict as Map
import Data.Monoid
import Data.Text (Text)
import qualified Data.Text as T
import qualified Data.Text.Encoding as T

import Data.Traversable (forM)

Expand Down Expand Up @@ -144,13 +145,14 @@ populateCache menv index = do
where
(y, z) = S.break (== Word8._slash) x

-- TODO: handling of unicode in this seems iffy, need to look into it more
parseNameVersion t1 = do
(p', t3) <- breakSlash
$ S.map (\c -> if c == Word8._backslash then Word8._slash else c)
$ S8.pack t1
p <- parsePackageName p'
p <- parsePackageName $ T.decodeUtf8 p'
(v', t5) <- breakSlash t3
v <- parseVersion v'
v <- parseVersion $ T.decodeUtf8 v'
let (t6, suffix) = S.break (== Word8._period) t5
if t6 == p'
then return (PackageIdentifier p v, suffix)
Expand Down

0 comments on commit 6d212a0

Please sign in to comment.