Skip to content

Commit

Permalink
Fix warnings revealed by PureScript v0.14.1 (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
purefunctor authored May 6, 2021
1 parent 6347c2c commit 3945c81
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 8 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ New features:
Bugfixes:

Other improvements:
- Removed unused names and declaration found by the v0.14.1 PureScript release (#68 by @PureFunctor)
- Installed dependencies directly imported into source code that were previously installed transitively and removed unused `fixed-point` dependency (#68 by @PureFunctor)

## [v5.0.0](https://github.com/purescript-contrib/purescript-formatters/releases/tag/v5.0.0) - 2021-02-26

Expand Down
15 changes: 14 additions & 1 deletion spago.dhall
Original file line number Diff line number Diff line change
@@ -1,17 +1,30 @@
{ name = "formatters"
, dependencies =
[ "aff"
, "arrays"
, "assert"
, "bifunctors"
, "console"
, "control"
, "datetime"
, "effect"
, "fixed-points"
, "either"
, "enums"
, "foldable-traversable"
, "integers"
, "lists"
, "math"
, "maybe"
, "newtype"
, "numbers"
, "ordered-collections"
, "parsing"
, "partial"
, "prelude"
, "psci-support"
, "strings"
, "transformers"
, "tuples"
]
, packages = ./packages.dhall
, sources = [ "src/**/*.purs", "test/**/*.purs" ]
Expand Down
2 changes: 1 addition & 1 deletion src/Data/Formatter/Internal.purs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ repeat ∷ ∀ a. Monoid a ⇒ a → Int → a
repeat = repeat' mempty
where
repeat' a a Int a
repeat' accum part count
repeat' accum _ count
| count < one = accum
repeat' accum part count =
repeat' (accum <> part) part (count - one)
5 changes: 1 addition & 4 deletions test/src/DateTime.purs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Test.DateTime (datetimeTest) where
import Prelude

import Control.Monad.Reader.Class (class MonadReader)
import Control.Alternative (class Alternative, empty, guard)
import Control.Alternative (guard)
import Data.DateTime (DateTime)
import Data.Either (Either(..))
import Data.Formatter.DateTime as FDT
Expand Down Expand Up @@ -196,6 +196,3 @@ dateformats =
]
}
]

filter m a. Alternative m Monad m (a Boolean) m a m a
filter f m = m >>= \x → if f x then pure x else empty
4 changes: 2 additions & 2 deletions test/src/Interval.purs
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ intervalTest = describe "Data.Formatter.Interval" do
prop "should unformat RecurringInterval" arbRecurringInterval \({ str, interval }) → do
(unformatRecurringInterval str) `shouldEqual` (Right interval)

prop "format (unformat s) = s" arbRecurringInterval \({ str, interval, formatedStr }) → do
prop "format (unformat s) = s" arbRecurringInterval \({ str, formatedStr }) → do
(formatRecurringInterval <$> (unformatRecurringInterval str)) `shouldEqual` (Right formatedStr)

prop "unformat (format s) = s" arbRecurringInterval \({ str, interval, formatedStr }) → do
prop "unformat (format s) = s" arbRecurringInterval \({ interval }) → do
(unformatRecurringInterval $ formatRecurringInterval interval) `shouldEqual` (Right interval)


Expand Down

0 comments on commit 3945c81

Please sign in to comment.