attoparsec-path 0.0.0 → 0.0.0.1
raw patch · 2 files changed
+4/−4 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- attoparsec-path.cabal +1/−1
- src/Data/Attoparsec/Path.hs +3/−3
attoparsec-path.cabal view
@@ -1,5 +1,5 @@ name: attoparsec-path-version: 0.0.0+version: 0.0.0.1 synopsis: Convenience bindings between path and attoparsec -- description: homepage: https://github.com/athanclark/attoparsec-path#readme
src/Data/Attoparsec/Path.hs view
@@ -1,7 +1,7 @@ module Data.Attoparsec.Path (rootPath, relFilePath, absFilePath, relDirPath, absDirPath) where +import Data.Char (isControl, isSpace) import Data.Attoparsec.Text (Parser, char, takeWhile1)-import Data.Functor.Identity (Identity (..)) import qualified Data.Text as T import Control.Applicative (Alternative (..)) import Path (Path, File, Dir, Abs, Rel, (</>))@@ -15,12 +15,12 @@ chunkPath :: Parser (Path Rel File) chunkPath =- (unsafeCoerce . T.unpack) <$> takeWhile1 (/= '/')+ (unsafeCoerce . T.unpack) <$> takeWhile1 (\c -> not (isControl c || isSpace c) && c /= '/') relFilePath :: Parser (Path Rel File) relFilePath = let parseComplex =- (\head tail -> unsafeCoerce (unsafeCoerce head ++ unsafeCoerce tail))+ (\h t -> unsafeCoerce (unsafeCoerce h ++ unsafeCoerce t)) <$> chunkPath <*> absFilePath parseSimple = chunkPath in parseComplex <|> parseSimple