Skip to content

Commit

Permalink
Merge pull request #24 from natefaubion/0.11-updates
Browse files Browse the repository at this point in the history
Updates for 0.11
  • Loading branch information
natefaubion authored Apr 4, 2017
2 parents b6d2628 + 9bb13c9 commit 8712dde
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 27 deletions.
20 changes: 10 additions & 10 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@
"package.json"
],
"dependencies": {
"purescript-console": "^2.0.0",
"purescript-exceptions": "^2.0.0",
"purescript-lists": "^3.0.0",
"purescript-partial": "^1.1.2",
"purescript-profunctor": "^2.0.0",
"purescript-strings": "^2.0.2",
"purescript-transformers": "^2.0.1",
"purescript-unsafe-coerce": "^2.0.0"
"purescript-console": "^3.0.0",
"purescript-exceptions": "^3.0.0",
"purescript-lists": "^4.0.0",
"purescript-partial": "^1.2.0",
"purescript-profunctor": "^3.0.0",
"purescript-strings": "^3.0.0",
"purescript-transformers": "^3.0.0",
"purescript-unsafe-coerce": "^3.0.0"
},
"devDependencies": {
"purescript-quickcheck": "^3.1.0",
"purescript-quickcheck-laws": "^2.0.0"
"purescript-quickcheck": "^4.0.0",
"purescript-quickcheck-laws": "^3.0.0"
}
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"private": true,
"scripts": {
"clean": "rimraf output && rimraf .pulp-cache",
"build": "pulp build --censor-lib --strict",
"build": "pulp build -- --censor-lib --strict",
"test": "pulp test"
},
"devDependencies": {
"pulp": "^9.0.1",
"purescript-psa": "^0.3.9",
"purescript": "^0.10.1",
"pulp": "^11.0.0",
"purescript-psa": "^0.5.0",
"purescript": "^0.11.1",
"rimraf": "^2.5.4"
}
}
17 changes: 6 additions & 11 deletions src/Data/Path/Pathy.purs
Original file line number Diff line number Diff line change
Expand Up @@ -74,30 +74,29 @@ import Data.Array ((!!), filter, length, zipWith, range)
import Data.Bifunctor (bimap)
import Data.Either (Either(..), either)
import Data.Foldable (foldl)
import Data.Generic (class Generic)
import Data.Maybe (Maybe(..), maybe)
import Data.String as S
import Data.Tuple (Tuple(..), fst, snd)

import Unsafe.Coerce (unsafeCoerce)

-- | The (phantom) type of relative paths.
foreign import data Rel :: *
foreign import data Rel :: Type

-- | The (phantom) type of absolute paths.
foreign import data Abs :: *
foreign import data Abs :: Type

-- | The (phantom) type of files.
foreign import data File :: *
foreign import data File :: Type

-- | The (phantom) type of directories.
foreign import data Dir :: *
foreign import data Dir :: Type

-- | The (phantom) type of unsandboxed paths.
foreign import data Unsandboxed :: *
foreign import data Unsandboxed :: Type

-- | The (phantom) type of sandboxed paths.
foreign import data Sandboxed :: *
foreign import data Sandboxed :: Type

-- | A newtype around a file name.
newtype FileName = FileName String
Expand Down Expand Up @@ -548,18 +547,14 @@ instance ordPath :: Ord (Path a b s) where
go _ (DirIn _ _) = GT
go (FileIn p1' f1) (FileIn p2' f2) = compare p1' p2' <> compare f1 f2

derive instance genericPath :: Generic (Path a b s)

instance showFileName :: Show FileName where
show (FileName name) = "(FileName " <> show name <> ")"

derive instance eqFileName :: Eq FileName
derive instance ordFileName :: Ord FileName
derive instance genericFileName :: Generic FileName

instance showDirName :: Show DirName where
show (DirName name) = "(DirName " <> show name <> ")"

derive instance eqDirName :: Eq DirName
derive instance ordDirName :: Ord DirName
derive instance genericDirName :: Generic DirName
3 changes: 1 addition & 2 deletions test/Main.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ module Test.Main where
import Prelude
import Control.Monad.Eff (Eff)
import Control.Monad.Eff.Console (CONSOLE, info, infoShow)
import Control.Monad.Rec.Class (Step(..), tailRecM)
import Data.Foldable (foldl)
import Data.Maybe (Maybe(..), fromJust)
import Data.Path.Pathy (Path, Abs, Rel, Dir, File, Sandboxed, dir, rootDir, parseAbsDir, parseRelDir, currentDir, file, parseAbsFile, parseRelFile, parentDir', depth, sandbox, dropExtension, renameFile, canonicalize, unsandbox, unsafePrintPath, (</>), (<..>), (<.>))
Expand All @@ -14,7 +13,7 @@ import Test.QuickCheck.Gen as Gen
import Test.QuickCheck.Laws.Data as Laws.Data
import Type.Proxy (Proxy(..))

test :: forall a eff. (Show a, Eq a) => String -> a -> a -> Eff (console :: CONSOLE | eff) Unit
test :: forall a eff. Show a => Eq a => String -> a -> a -> Eff (console :: CONSOLE | eff) Unit
test name actual expected= do
infoShow $ "Test: " <> name
if expected == actual then infoShow $ "Passed: " <> (show expected) else infoShow $ "Failed: Expected " <> (show expected) <> " but found " <> (show actual)
Expand Down

0 comments on commit 8712dde

Please sign in to comment.