From cea78fba1580a6c16362f4dc4e2747414f0163f9 Mon Sep 17 00:00:00 2001 From: Liam Goodacre Date: Fri, 27 Apr 2018 15:02:50 +0100 Subject: [PATCH 1/5] Bump deps for compiler/0.12 --- bower.json | 21 +++++++++++---------- package.json | 10 +++++----- src/Data/Date.purs | 4 ++-- src/Data/Date/Component.purs | 10 +++++----- src/Data/DateTime.purs | 4 ++-- src/Data/DateTime/Instant.purs | 4 ++-- src/Data/DateTime/Locale.purs | 10 +++++----- src/Data/Interval.purs | 2 +- src/Data/Interval/Duration.purs | 1 - src/Data/Time.purs | 4 ++-- src/Data/Time/Component.purs | 10 +++++----- src/Data/Time/Duration.purs | 16 ++++++++-------- test/Test/Main.purs | 15 ++++++--------- 13 files changed, 54 insertions(+), 57 deletions(-) diff --git a/bower.json b/bower.json index 1776f48..2a546bd 100644 --- a/bower.json +++ b/bower.json @@ -16,17 +16,18 @@ "package.json" ], "dependencies": { - "purescript-enums": "^3.1.0", - "purescript-functions": "^3.0.0", - "purescript-generics": "^4.0.0", - "purescript-integers": "^3.0.0", - "purescript-foldable-traversable": "^3.0.0", - "purescript-maps": "^3.0.0", - "purescript-math": "^2.0.0" + "purescript-enums": "#compiler/0.12", + "purescript-functions": "#compiler/0.12", + "purescript-generics-rep": "#compiler/0.12", + "purescript-integers": "#compiler/0.12", + "purescript-foldable-traversable": "#compiler/0.12", + "purescript-maps": "#compiler/0.12", + "purescript-math": "#compiler/0.12", + "purescript-proxy": "#compiler/0.12" }, "devDependencies": { - "purescript-assert": "^3.0.0", - "purescript-console": "^3.0.0", - "purescript-strings": "^3.0.0" + "purescript-assert": "#compiler/0.12", + "purescript-console": "#compiler/0.12", + "purescript-strings": "#compiler/0.12" } } diff --git a/package.json b/package.json index 017bc40..c9e5a5b 100644 --- a/package.json +++ b/package.json @@ -3,12 +3,12 @@ "scripts": { "clean": "rimraf output && rimraf .pulp-cache", "build": "eslint src && pulp build -- --censor-lib --strict", - "test": "pulp test" + "test": "pulp test --check-main-type Effect.Effect" }, "devDependencies": { - "eslint": "^3.17.1", - "pulp": "^11.0.x", - "purescript-psa": "^0.5.x", - "rimraf": "^2.6.1" + "eslint": "^4.19.1", + "pulp": "^12.0.x", + "purescript-psa": "^0.6.x", + "rimraf": "^2.6.2" } } diff --git a/src/Data/Date.purs b/src/Data/Date.purs index c2a500e..7756121 100644 --- a/src/Data/Date.purs +++ b/src/Data/Date.purs @@ -17,7 +17,7 @@ import Prelude import Data.Date.Component (Day, Month(..), Weekday(..), Year) import Data.Enum (toEnum, fromEnum) import Data.Function.Uncurried (Fn3, runFn3, Fn4, runFn4, Fn6, runFn6) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..), fromJust) import Data.Time.Duration (class Duration, toDuration, Milliseconds) @@ -45,7 +45,7 @@ exactDate y m d = derive instance eqDate :: Eq Date derive instance ordDate :: Ord Date -derive instance genericDate :: Generic Date +derive instance genericDate :: Generic Date _ instance boundedDate :: Bounded Date where bottom = Date bottom bottom bottom diff --git a/src/Data/Date/Component.purs b/src/Data/Date/Component.purs index 2051d6a..b604caf 100644 --- a/src/Data/Date/Component.purs +++ b/src/Data/Date/Component.purs @@ -8,7 +8,7 @@ module Data.Date.Component import Prelude import Data.Enum (class Enum, class BoundedEnum, toEnum, fromEnum, Cardinality(..)) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) -- | A year component for a date. @@ -20,7 +20,7 @@ newtype Year = Year Int derive newtype instance eqYear :: Eq Year derive newtype instance ordYear :: Ord Year -derive instance genericYear :: Generic Year +derive instance genericYear :: Generic Year _ -- Note: these seemingly arbitrary bounds come from relying on JS for date -- manipulations, as it only supports date ±100,000,000 days of the Unix epoch. @@ -61,7 +61,7 @@ data Month derive instance eqMonth :: Eq Month derive instance ordMonth :: Ord Month -derive instance genericMonth :: Generic Month +derive instance genericMonth :: Generic Month _ instance boundedMonth :: Bounded Month where bottom = January @@ -124,7 +124,7 @@ newtype Day = Day Int derive newtype instance eqDay :: Eq Day derive newtype instance ordDay :: Ord Day -derive instance genericDay :: Generic Day +derive instance genericDay :: Generic Day _ instance boundedDay :: Bounded Day where bottom = Day 1 @@ -156,7 +156,7 @@ data Weekday derive instance eqWeekday :: Eq Weekday derive instance ordWeekday :: Ord Weekday -derive instance genericWeekday :: Generic Weekday +derive instance genericWeekday :: Generic Weekday _ instance boundedWeekday :: Bounded Weekday where bottom = Monday diff --git a/src/Data/DateTime.purs b/src/Data/DateTime.purs index dbca662..5eaff5f 100644 --- a/src/Data/DateTime.purs +++ b/src/Data/DateTime.purs @@ -17,7 +17,7 @@ import Prelude import Data.Date (Date, Day, Month(..), Weekday(..), Year, canonicalDate, day, exactDate, month, weekday, year) import Data.Enum (toEnum, fromEnum) import Data.Function.Uncurried (Fn2, runFn2) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Time (Hour, Millisecond, Minute, Second, Time(..), hour, setHour, millisecond, setMillisecond, minute, setMinute, second, setSecond) import Data.Time.Duration (class Duration, fromDuration, toDuration, Milliseconds) import Data.Maybe (Maybe(..)) @@ -27,7 +27,7 @@ data DateTime = DateTime Date Time derive instance eqDateTime :: Eq DateTime derive instance ordDateTime :: Ord DateTime -derive instance genericDateTime :: Generic DateTime +derive instance genericDateTime :: Generic DateTime _ instance boundedDateTime :: Bounded DateTime where bottom = DateTime bottom bottom diff --git a/src/Data/DateTime/Instant.purs b/src/Data/DateTime/Instant.purs index fd54932..707acd4 100644 --- a/src/Data/DateTime/Instant.purs +++ b/src/Data/DateTime/Instant.purs @@ -12,7 +12,7 @@ import Prelude import Data.DateTime (Millisecond, Second, Minute, Hour, Day, Year, DateTime(..), Date, Time(..), canonicalDate, millisecond, second, minute, hour, day, month, year) import Data.Enum (fromEnum, toEnum) import Data.Function.Uncurried (Fn7, runFn7) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..), fromJust) import Data.Time.Duration (Milliseconds(..)) @@ -27,7 +27,7 @@ newtype Instant = Instant Milliseconds derive newtype instance eqDateTime :: Eq Instant derive newtype instance ordDateTime :: Ord Instant -derive instance genericDateTime :: Generic Instant +derive instance genericDateTime :: Generic Instant _ instance boundedInstant :: Bounded Instant where bottom = Instant (Milliseconds (-8639977881600000.0)) diff --git a/src/Data/DateTime/Locale.purs b/src/Data/DateTime/Locale.purs index 64b1b58..a449f17 100644 --- a/src/Data/DateTime/Locale.purs +++ b/src/Data/DateTime/Locale.purs @@ -4,7 +4,7 @@ import Prelude import Control.Comonad (class Comonad, class Extend) import Data.DateTime (Date, Time, DateTime) import Data.Foldable (class Foldable) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe) import Data.Newtype (class Newtype) import Data.Time.Duration (Minutes) @@ -16,7 +16,7 @@ data Locale = Locale (Maybe LocaleName) Minutes derive instance eqLocale :: Eq Locale derive instance ordLocale :: Ord Locale -derive instance genericLocale :: Generic Locale +derive instance genericLocale :: Generic Locale _ instance showLocale :: Show Locale where show (Locale name offset) = "(Locale " <> show name <> " " <> show offset <> ")" @@ -27,7 +27,7 @@ newtype LocaleName = LocaleName String derive instance newtypeLocaleName :: Newtype LocaleName _ derive newtype instance eqLocaleName :: Eq LocaleName derive newtype instance ordLocaleName :: Ord LocaleName -derive instance genericLocaleName :: Generic LocaleName +derive instance genericLocaleName :: Generic LocaleName _ instance showLocaleName :: Show LocaleName where show (LocaleName name) = "(LocaleName " <> show name <> ")" @@ -41,7 +41,7 @@ data LocalValue a = LocalValue Locale a derive instance eqLocalValue :: Eq a => Eq (LocalValue a) derive instance ordLocalValue :: Ord a => Ord (LocalValue a) -derive instance genericLocalValue :: Generic a => Generic (LocalValue a) +derive instance genericLocalValue :: Generic (LocalValue a) _ instance showLocalValue :: Show a => Show (LocalValue a) where show (LocalValue n a) = "(LocalValue " <> show n <> " " <> show a <> ")" @@ -62,7 +62,7 @@ instance foldableLocalValue :: Foldable LocalValue where instance traversableLocalValue :: Traversable LocalValue where traverse f (LocalValue n a) = LocalValue <$> pure n <*> f a - sequence = traverse id + sequence = traverse identity -- | A date value with a locale. type LocalDate = LocalValue Date diff --git a/src/Data/Interval.purs b/src/Data/Interval.purs index d3c75ad..ac4fda0 100644 --- a/src/Data/Interval.purs +++ b/src/Data/Interval.purs @@ -70,7 +70,7 @@ instance showInterval :: (Show d, Show a) => Show (Interval d a) where show (DurationOnly d) = "(DurationOnly " <> show d <> ")" instance functorInterval :: Functor (Interval d) where - map = bimap id + map = bimap identity instance bifunctorInterval :: Bifunctor Interval where bimap _ f (StartEnd x y) = StartEnd (f x) (f y) diff --git a/src/Data/Interval/Duration.purs b/src/Data/Interval/Duration.purs index 9af57e4..252f77c 100644 --- a/src/Data/Interval/Duration.purs +++ b/src/Data/Interval/Duration.purs @@ -14,7 +14,6 @@ module Data.Interval.Duration import Prelude import Data.Map as Map -import Data.Monoid (class Monoid, mempty) import Data.Newtype (class Newtype) newtype Duration = Duration (Map.Map DurationComponent Number) diff --git a/src/Data/Time.purs b/src/Data/Time.purs index 190c4d6..64c2ec2 100644 --- a/src/Data/Time.purs +++ b/src/Data/Time.purs @@ -12,7 +12,7 @@ module Data.Time import Prelude import Data.Enum (fromEnum, toEnum) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Int as Int import Data.Maybe (fromJust) import Data.Newtype (unwrap) @@ -28,7 +28,7 @@ data Time = Time Hour Minute Second Millisecond derive instance eqTime :: Eq Time derive instance ordTime :: Ord Time -derive instance genericTime :: Generic Time +derive instance genericTime :: Generic Time _ instance boundedTime :: Bounded Time where bottom = Time bottom bottom bottom bottom diff --git a/src/Data/Time/Component.purs b/src/Data/Time/Component.purs index 345a592..47ac537 100644 --- a/src/Data/Time/Component.purs +++ b/src/Data/Time/Component.purs @@ -8,7 +8,7 @@ module Data.Time.Component import Prelude import Data.Enum (class Enum, class BoundedEnum, toEnum, fromEnum, Cardinality(..)) -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) -- | An hour component for a time value. @@ -21,7 +21,7 @@ newtype Hour = Hour Int derive newtype instance eqHour :: Eq Hour derive newtype instance ordHour :: Ord Hour -derive instance genericHour :: Generic Hour +derive instance genericHour :: Generic Hour _ instance boundedHour :: Bounded Hour where bottom = Hour 0 @@ -51,7 +51,7 @@ newtype Minute = Minute Int derive newtype instance eqMinute :: Eq Minute derive newtype instance ordMinute :: Ord Minute -derive instance genericMinute :: Generic Minute +derive instance genericMinute :: Generic Minute _ instance boundedMinute :: Bounded Minute where bottom = Minute 0 @@ -81,7 +81,7 @@ newtype Second = Second Int derive newtype instance eqSecond :: Eq Second derive newtype instance ordSecond :: Ord Second -derive instance genericSecond :: Generic Second +derive instance genericSecond :: Generic Second _ instance boundedSecond :: Bounded Second where bottom = Second 0 @@ -112,7 +112,7 @@ newtype Millisecond = Millisecond Int derive newtype instance eqMillisecond :: Eq Millisecond derive newtype instance ordMillisecond :: Ord Millisecond -derive instance genericMillisecond :: Generic Millisecond +derive instance genericMillisecond :: Generic Millisecond _ instance boundedMillisecond :: Bounded Millisecond where bottom = Millisecond 0 diff --git a/src/Data/Time/Duration.purs b/src/Data/Time/Duration.purs index 4b9e21b..fc14610 100644 --- a/src/Data/Time/Duration.purs +++ b/src/Data/Time/Duration.purs @@ -2,14 +2,14 @@ module Data.Time.Duration where import Prelude -import Data.Generic (class Generic) +import Data.Generic.Rep (class Generic) import Data.Newtype (class Newtype, over) -- | A duration measured in milliseconds. newtype Milliseconds = Milliseconds Number derive instance newtypeMilliseconds :: Newtype Milliseconds _ -derive instance genericMilliseconds :: Generic Milliseconds +derive instance genericMilliseconds :: Generic Milliseconds _ derive newtype instance eqMilliseconds :: Eq Milliseconds derive newtype instance ordMilliseconds :: Ord Milliseconds derive newtype instance semiringMilliseconds :: Semiring Milliseconds @@ -22,7 +22,7 @@ instance showMilliseconds :: Show Milliseconds where newtype Seconds = Seconds Number derive instance newtypeSeconds :: Newtype Seconds _ -derive instance genericSeconds :: Generic Seconds +derive instance genericSeconds :: Generic Seconds _ derive newtype instance eqSeconds :: Eq Seconds derive newtype instance ordSeconds :: Ord Seconds derive newtype instance semiringSeconds :: Semiring Seconds @@ -35,7 +35,7 @@ instance showSeconds :: Show Seconds where newtype Minutes = Minutes Number derive instance newtypeMinutes :: Newtype Minutes _ -derive instance genericMinutes :: Generic Minutes +derive instance genericMinutes :: Generic Minutes _ derive newtype instance eqMinutes :: Eq Minutes derive newtype instance ordMinutes :: Ord Minutes derive newtype instance semiringMinutes :: Semiring Minutes @@ -48,7 +48,7 @@ instance showMinutes :: Show Minutes where newtype Hours = Hours Number derive instance newtypeHours :: Newtype Hours _ -derive instance genericHours :: Generic Hours +derive instance genericHours :: Generic Hours _ derive newtype instance eqHours :: Eq Hours derive newtype instance ordHours :: Ord Hours derive newtype instance semiringHours :: Semiring Hours @@ -61,7 +61,7 @@ instance showHours :: Show Hours where newtype Days = Days Number derive instance newtypeDays :: Newtype Days _ -derive instance genericDays :: Generic Days +derive instance genericDays :: Generic Days _ derive newtype instance eqDays :: Eq Days derive newtype instance ordDays :: Ord Days derive newtype instance semiringDays :: Semiring Days @@ -80,8 +80,8 @@ convertDuration :: forall a b. Duration a => Duration b => a -> b convertDuration = toDuration <<< fromDuration instance durationMilliseconds :: Duration Milliseconds where - fromDuration = id - toDuration = id + fromDuration = identity + toDuration = identity instance durationSeconds :: Duration Seconds where fromDuration = over Seconds (_ * 1000.0) diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 35fbfb8..062ceaa 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -2,8 +2,8 @@ module Test.Main where import Prelude -import Control.Monad.Eff (Eff) -import Control.Monad.Eff.Console (CONSOLE, log) +import Effect (Effect) +import Effect.Console (log) import Data.Array as Array import Data.Date as Date import Data.DateTime as DateTime @@ -15,7 +15,6 @@ import Data.Foldable (foldl, foldr, foldMap) import Data.Interval as Interval import Data.Interval.Duration.Iso as IsoDuration import Data.Maybe (Maybe(..), fromJust) -import Data.Monoid (mempty) import Data.Newtype (over, unwrap) import Data.String (length) import Data.Time as Time @@ -24,12 +23,10 @@ import Data.Traversable (sequence, traverse) import Data.Tuple (Tuple(..), snd) import Math (floor) import Partial.Unsafe (unsafePartial) -import Test.Assert (ASSERT, assert) +import Test.Assert (assert) import Type.Proxy (Proxy(..)) -type Tests = Eff (console :: CONSOLE, assert :: ASSERT) Unit - -main :: Tests +main :: Effect Unit main = do log "check Duration monoid" assert $ Interval.year 1.0 == mempty <> Interval.year 2.0 <> Interval.year 1.0 <> Interval.year (-2.0) @@ -211,14 +208,14 @@ main = do log "All tests done" -checkBounded :: forall e. Bounded e => Proxy e -> Tests +checkBounded :: forall e. Bounded e => Proxy e -> Effect Unit checkBounded _ = do assert $ Just (bottom :: Time.Hour) == toEnum (fromEnum (bottom :: Time.Hour)) assert $ pred (bottom :: Time.Hour) == Nothing assert $ Just (top :: Time.Hour) == toEnum (fromEnum (top :: Time.Hour)) assert $ succ (top :: Time.Hour) == Nothing -checkBoundedEnum :: forall e. BoundedEnum e => Proxy e -> Tests +checkBoundedEnum :: forall e. BoundedEnum e => Proxy e -> Effect Unit checkBoundedEnum p = do checkBounded p let card = unwrap (cardinality :: Cardinality e) From abd139d529a1b0866e22003a7fc3f2faa877afca Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Thu, 3 May 2018 12:42:00 +0100 Subject: [PATCH 2/5] Remove useless Locale, use ord-collections --- bower.json | 2 +- src/Data/DateTime/Locale.purs | 74 ----------------------------------- src/Data/Interval.purs | 4 +- 3 files changed, 3 insertions(+), 77 deletions(-) delete mode 100644 src/Data/DateTime/Locale.purs diff --git a/bower.json b/bower.json index 2a546bd..b8e14ce 100644 --- a/bower.json +++ b/bower.json @@ -21,7 +21,7 @@ "purescript-generics-rep": "#compiler/0.12", "purescript-integers": "#compiler/0.12", "purescript-foldable-traversable": "#compiler/0.12", - "purescript-maps": "#compiler/0.12", + "purescript-ordered-collections": "#compiler/0.12", "purescript-math": "#compiler/0.12", "purescript-proxy": "#compiler/0.12" }, diff --git a/src/Data/DateTime/Locale.purs b/src/Data/DateTime/Locale.purs deleted file mode 100644 index a449f17..0000000 --- a/src/Data/DateTime/Locale.purs +++ /dev/null @@ -1,74 +0,0 @@ -module Data.DateTime.Locale where - -import Prelude -import Control.Comonad (class Comonad, class Extend) -import Data.DateTime (Date, Time, DateTime) -import Data.Foldable (class Foldable) -import Data.Generic.Rep (class Generic) -import Data.Maybe (Maybe) -import Data.Newtype (class Newtype) -import Data.Time.Duration (Minutes) -import Data.Traversable (class Traversable, traverse) - --- | A date/time locale specifying an offset in minutes and an optional name for --- | the locale. -data Locale = Locale (Maybe LocaleName) Minutes - -derive instance eqLocale :: Eq Locale -derive instance ordLocale :: Ord Locale -derive instance genericLocale :: Generic Locale _ - -instance showLocale :: Show Locale where - show (Locale name offset) = "(Locale " <> show name <> " " <> show offset <> ")" - --- | The name of a date/time locale. For example: "GMT", "MDT", "CET", etc. -newtype LocaleName = LocaleName String - -derive instance newtypeLocaleName :: Newtype LocaleName _ -derive newtype instance eqLocaleName :: Eq LocaleName -derive newtype instance ordLocaleName :: Ord LocaleName -derive instance genericLocaleName :: Generic LocaleName _ - -instance showLocaleName :: Show LocaleName where - show (LocaleName name) = "(LocaleName " <> show name <> ")" - --- | A value that is subject to a `Locale`. --- | --- | There are `Functor`, `Extend`, and `Comonad` instances for `LocalValue` to --- | enable the inner non-localised value to be manipulated while maintaining --- | the locale. -data LocalValue a = LocalValue Locale a - -derive instance eqLocalValue :: Eq a => Eq (LocalValue a) -derive instance ordLocalValue :: Ord a => Ord (LocalValue a) -derive instance genericLocalValue :: Generic (LocalValue a) _ - -instance showLocalValue :: Show a => Show (LocalValue a) where - show (LocalValue n a) = "(LocalValue " <> show n <> " " <> show a <> ")" - -instance functorLocalValue :: Functor LocalValue where - map f (LocalValue n a) = LocalValue n (f a) - -instance extendLocalValue :: Extend LocalValue where - extend f lv@(LocalValue n _) = LocalValue n (f lv) - -instance comonadLocalValue :: Comonad LocalValue where - extract (LocalValue _ a) = a - -instance foldableLocalValue :: Foldable LocalValue where - foldl f b (LocalValue _ a) = f b a - foldr f b (LocalValue _ a) = f a b - foldMap f (LocalValue _ a) = f a - -instance traversableLocalValue :: Traversable LocalValue where - traverse f (LocalValue n a) = LocalValue <$> pure n <*> f a - sequence = traverse identity - --- | A date value with a locale. -type LocalDate = LocalValue Date - --- | A time value with a locale. -type LocalTime = LocalValue Time - --- | A date/time value with a locale. -type LocalDateTime = LocalValue DateTime diff --git a/src/Data/Interval.purs b/src/Data/Interval.purs index ac4fda0..8d90412 100644 --- a/src/Data/Interval.purs +++ b/src/Data/Interval.purs @@ -1,7 +1,7 @@ module Data.Interval ( Interval(..) , RecurringInterval(..) - , module DurationExports + , module Exports ) where import Prelude @@ -11,7 +11,7 @@ import Data.Bifoldable (class Bifoldable, bifoldl, bifoldr, bifoldrDefault, bifo import Data.Bifunctor (class Bifunctor, bimap) import Data.Bitraversable (class Bitraversable, bitraverse, bisequenceDefault) import Data.Foldable (class Foldable, foldl, foldr, foldrDefault, foldMapDefaultL) -import Data.Interval.Duration as DurationExports +import Data.Interval.Duration (Duration(..), DurationComponent(..), day, hour, millisecond, minute, month, second, week, year) as Exports import Data.Maybe (Maybe) import Data.Traversable (class Traversable, traverse, sequenceDefault) From 3273b3a10cd9415f201bf4b5e6726ea3414206d3 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Sat, 19 May 2018 11:45:50 +0100 Subject: [PATCH 3/5] Update for Map.toAscUnfoldable becoming default --- src/Data/Interval/Duration/Iso.purs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Data/Interval/Duration/Iso.purs b/src/Data/Interval/Duration/Iso.purs index 10fe187..4b79068 100644 --- a/src/Data/Interval/Duration/Iso.purs +++ b/src/Data/Interval/Duration/Iso.purs @@ -64,7 +64,7 @@ mkIsoDuration d = case fromList (checkValidIsoDuration d) of checkValidIsoDuration :: Duration -> List Error checkValidIsoDuration (Duration asMap) = check {asList, asMap} where - asList = reverse (Map.toAscUnfoldable asMap) + asList = reverse (Map.toUnfoldable asMap) check = fold [ checkWeekUsage , checkEmptiness From f7eb801d86a0b1f360bb534311db8cea71eaee48 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Tue, 22 May 2018 14:49:39 +0100 Subject: [PATCH 4/5] Remove unused generic instances, strange ring instances for durations --- bower.json | 1 - src/Data/Date.purs | 32 ++++++++++----------- src/Data/Date/Component.purs | 5 ---- src/Data/DateTime.purs | 2 -- src/Data/DateTime/Instant.purs | 2 -- src/Data/Time.purs | 21 +++++++------- src/Data/Time/Component.purs | 5 ---- src/Data/Time/Duration.purs | 51 +++++++++++++++++++++++----------- test/Test/Main.purs | 39 ++++---------------------- 9 files changed, 65 insertions(+), 93 deletions(-) diff --git a/bower.json b/bower.json index b8e14ce..b5079b1 100644 --- a/bower.json +++ b/bower.json @@ -18,7 +18,6 @@ "dependencies": { "purescript-enums": "#compiler/0.12", "purescript-functions": "#compiler/0.12", - "purescript-generics-rep": "#compiler/0.12", "purescript-integers": "#compiler/0.12", "purescript-foldable-traversable": "#compiler/0.12", "purescript-ordered-collections": "#compiler/0.12", diff --git a/src/Data/Date.purs b/src/Data/Date.purs index 7756121..1ac11bd 100644 --- a/src/Data/Date.purs +++ b/src/Data/Date.purs @@ -17,10 +17,8 @@ import Prelude import Data.Date.Component (Day, Month(..), Weekday(..), Year) import Data.Enum (toEnum, fromEnum) import Data.Function.Uncurried (Fn3, runFn3, Fn4, runFn4, Fn6, runFn6) -import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..), fromJust) -import Data.Time.Duration (class Duration, toDuration, Milliseconds) - +import Data.Time.Duration (class Duration, Milliseconds, toDuration) import Partial.Unsafe (unsafePartial) -- | A date value in the Gregorian calendar. @@ -45,7 +43,6 @@ exactDate y m d = derive instance eqDate :: Eq Date derive instance ordDate :: Ord Date -derive instance genericDate :: Generic Date _ instance boundedDate :: Bounded Date where bottom = Date bottom bottom bottom @@ -78,29 +75,30 @@ diff :: forall d. Duration d => Date -> Date -> d diff (Date y1 m1 d1) (Date y2 m2 d2) = toDuration $ runFn6 calcDiff y1 (fromEnum m1) d1 y2 (fromEnum m2) d2 --- | Is this year a leap year according to the proleptic Gregorian calendar? +-- | Checks whether a year is a leap year according to the proleptic Gregorian +-- | calendar. isLeapYear :: Year -> Boolean isLeapYear y = (mod y' 4 == 0) && ((mod y' 400 == 0) || not (mod y' 100 == 0)) where y' = fromEnum y --- | Get the final day of a month and year, accounting for leap years +-- | Get the final day of a month and year, accounting for leap years. lastDayOfMonth :: Year -> Month -> Day lastDayOfMonth y m = case m of - January -> unsafeDay 31 + January -> unsafeDay 31 February | isLeapYear y -> unsafeDay 29 - | otherwise -> unsafeDay 28 - March -> unsafeDay 31 - April -> unsafeDay 30 - May -> unsafeDay 31 - June -> unsafeDay 30 - July -> unsafeDay 31 - August -> unsafeDay 31 + | otherwise -> unsafeDay 28 + March -> unsafeDay 31 + April -> unsafeDay 30 + May -> unsafeDay 31 + June -> unsafeDay 30 + July -> unsafeDay 31 + August -> unsafeDay 31 September -> unsafeDay 30 - October -> unsafeDay 31 - November -> unsafeDay 30 - December -> unsafeDay 31 + October -> unsafeDay 31 + November -> unsafeDay 30 + December -> unsafeDay 31 where unsafeDay = unsafePartial fromJust <<< toEnum diff --git a/src/Data/Date/Component.purs b/src/Data/Date/Component.purs index b604caf..8c13315 100644 --- a/src/Data/Date/Component.purs +++ b/src/Data/Date/Component.purs @@ -8,7 +8,6 @@ module Data.Date.Component import Prelude import Data.Enum (class Enum, class BoundedEnum, toEnum, fromEnum, Cardinality(..)) -import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) -- | A year component for a date. @@ -20,7 +19,6 @@ newtype Year = Year Int derive newtype instance eqYear :: Eq Year derive newtype instance ordYear :: Ord Year -derive instance genericYear :: Generic Year _ -- Note: these seemingly arbitrary bounds come from relying on JS for date -- manipulations, as it only supports date ±100,000,000 days of the Unix epoch. @@ -61,7 +59,6 @@ data Month derive instance eqMonth :: Eq Month derive instance ordMonth :: Ord Month -derive instance genericMonth :: Generic Month _ instance boundedMonth :: Bounded Month where bottom = January @@ -124,7 +121,6 @@ newtype Day = Day Int derive newtype instance eqDay :: Eq Day derive newtype instance ordDay :: Ord Day -derive instance genericDay :: Generic Day _ instance boundedDay :: Bounded Day where bottom = Day 1 @@ -156,7 +152,6 @@ data Weekday derive instance eqWeekday :: Eq Weekday derive instance ordWeekday :: Ord Weekday -derive instance genericWeekday :: Generic Weekday _ instance boundedWeekday :: Bounded Weekday where bottom = Monday diff --git a/src/Data/DateTime.purs b/src/Data/DateTime.purs index 5eaff5f..2119ded 100644 --- a/src/Data/DateTime.purs +++ b/src/Data/DateTime.purs @@ -17,7 +17,6 @@ import Prelude import Data.Date (Date, Day, Month(..), Weekday(..), Year, canonicalDate, day, exactDate, month, weekday, year) import Data.Enum (toEnum, fromEnum) import Data.Function.Uncurried (Fn2, runFn2) -import Data.Generic.Rep (class Generic) import Data.Time (Hour, Millisecond, Minute, Second, Time(..), hour, setHour, millisecond, setMillisecond, minute, setMinute, second, setSecond) import Data.Time.Duration (class Duration, fromDuration, toDuration, Milliseconds) import Data.Maybe (Maybe(..)) @@ -27,7 +26,6 @@ data DateTime = DateTime Date Time derive instance eqDateTime :: Eq DateTime derive instance ordDateTime :: Ord DateTime -derive instance genericDateTime :: Generic DateTime _ instance boundedDateTime :: Bounded DateTime where bottom = DateTime bottom bottom diff --git a/src/Data/DateTime/Instant.purs b/src/Data/DateTime/Instant.purs index 707acd4..d196249 100644 --- a/src/Data/DateTime/Instant.purs +++ b/src/Data/DateTime/Instant.purs @@ -12,7 +12,6 @@ import Prelude import Data.DateTime (Millisecond, Second, Minute, Hour, Day, Year, DateTime(..), Date, Time(..), canonicalDate, millisecond, second, minute, hour, day, month, year) import Data.Enum (fromEnum, toEnum) import Data.Function.Uncurried (Fn7, runFn7) -import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..), fromJust) import Data.Time.Duration (Milliseconds(..)) @@ -27,7 +26,6 @@ newtype Instant = Instant Milliseconds derive newtype instance eqDateTime :: Eq Instant derive newtype instance ordDateTime :: Ord Instant -derive instance genericDateTime :: Generic Instant _ instance boundedInstant :: Bounded Instant where bottom = Instant (Milliseconds (-8639977881600000.0)) diff --git a/src/Data/Time.purs b/src/Data/Time.purs index 64c2ec2..4adde81 100644 --- a/src/Data/Time.purs +++ b/src/Data/Time.purs @@ -12,23 +12,19 @@ module Data.Time import Prelude import Data.Enum (fromEnum, toEnum) -import Data.Generic.Rep (class Generic) import Data.Int as Int import Data.Maybe (fromJust) import Data.Newtype (unwrap) import Data.Time.Component (Hour, Millisecond, Minute, Second) -import Data.Time.Duration (class Duration, Days(..), Milliseconds(..), fromDuration, toDuration) +import Data.Time.Duration (class Duration, Days(..), Milliseconds(..), fromDuration, negateDuration, toDuration) import Data.Tuple (Tuple(..)) - import Math as Math - import Partial.Unsafe (unsafePartial) data Time = Time Hour Minute Second Millisecond derive instance eqTime :: Eq Time derive instance ordTime :: Ord Time -derive instance genericTime :: Generic Time _ instance boundedTime :: Bounded Time where bottom = Time bottom bottom bottom bottom @@ -82,17 +78,20 @@ adjust d t = tLength = timeToMillis t dayLength = 86400000.0 wholeDays = Days $ Math.floor (unwrap d' / dayLength) - msAdjust = d' - fromDuration wholeDays - msAdjusted = tLength + msAdjust - wrap = if msAdjusted > maxTime then 1.0 else if msAdjusted < -maxTime then -1.0 else 0.0 + msAdjust = d' <> negateDuration (fromDuration wholeDays) + msAdjusted = tLength <> msAdjust + wrap = if msAdjusted > maxTime then 1.0 else if msAdjusted < minTime then -1.0 else 0.0 in Tuple - (wholeDays + Days wrap) - (millisToTime (msAdjusted - Milliseconds (dayLength * wrap))) + (wholeDays <> Days wrap) + (millisToTime (msAdjusted <> Milliseconds (dayLength * -wrap))) maxTime :: Milliseconds maxTime = timeToMillis top +minTime :: Milliseconds +minTime = timeToMillis bottom + timeToMillis :: Time -> Milliseconds timeToMillis t = Milliseconds $ 3600000.0 * Int.toNumber (fromEnum (hour t)) @@ -121,4 +120,4 @@ millisToTime ms@(Milliseconds ms') = -- | Calculates the difference between two times, returning the result as a -- | duration. diff :: forall d. Duration d => Time -> Time -> d -diff t1 t2 = toDuration (timeToMillis t1 - timeToMillis t2) +diff t1 t2 = toDuration (timeToMillis t1 <> negateDuration (timeToMillis t2)) diff --git a/src/Data/Time/Component.purs b/src/Data/Time/Component.purs index 47ac537..bbc6977 100644 --- a/src/Data/Time/Component.purs +++ b/src/Data/Time/Component.purs @@ -8,7 +8,6 @@ module Data.Time.Component import Prelude import Data.Enum (class Enum, class BoundedEnum, toEnum, fromEnum, Cardinality(..)) -import Data.Generic.Rep (class Generic) import Data.Maybe (Maybe(..)) -- | An hour component for a time value. @@ -21,7 +20,6 @@ newtype Hour = Hour Int derive newtype instance eqHour :: Eq Hour derive newtype instance ordHour :: Ord Hour -derive instance genericHour :: Generic Hour _ instance boundedHour :: Bounded Hour where bottom = Hour 0 @@ -51,7 +49,6 @@ newtype Minute = Minute Int derive newtype instance eqMinute :: Eq Minute derive newtype instance ordMinute :: Ord Minute -derive instance genericMinute :: Generic Minute _ instance boundedMinute :: Bounded Minute where bottom = Minute 0 @@ -81,7 +78,6 @@ newtype Second = Second Int derive newtype instance eqSecond :: Eq Second derive newtype instance ordSecond :: Ord Second -derive instance genericSecond :: Generic Second _ instance boundedSecond :: Bounded Second where bottom = Second 0 @@ -112,7 +108,6 @@ newtype Millisecond = Millisecond Int derive newtype instance eqMillisecond :: Eq Millisecond derive newtype instance ordMillisecond :: Ord Millisecond -derive instance genericMillisecond :: Generic Millisecond _ instance boundedMillisecond :: Bounded Millisecond where bottom = Millisecond 0 diff --git a/src/Data/Time/Duration.purs b/src/Data/Time/Duration.purs index fc14610..a8b0503 100644 --- a/src/Data/Time/Duration.purs +++ b/src/Data/Time/Duration.purs @@ -2,18 +2,20 @@ module Data.Time.Duration where import Prelude -import Data.Generic.Rep (class Generic) import Data.Newtype (class Newtype, over) -- | A duration measured in milliseconds. newtype Milliseconds = Milliseconds Number derive instance newtypeMilliseconds :: Newtype Milliseconds _ -derive instance genericMilliseconds :: Generic Milliseconds _ derive newtype instance eqMilliseconds :: Eq Milliseconds derive newtype instance ordMilliseconds :: Ord Milliseconds -derive newtype instance semiringMilliseconds :: Semiring Milliseconds -derive newtype instance ringMilliseconds :: Ring Milliseconds + +instance semigroupMilliseconds :: Semigroup Milliseconds where + append (Milliseconds x) (Milliseconds y) = Milliseconds (x + y) + +instance monoidMilliseconds :: Monoid Milliseconds where + mempty = Milliseconds 0.0 instance showMilliseconds :: Show Milliseconds where show (Milliseconds n) = "(Milliseconds " <> show n <> ")" @@ -22,11 +24,14 @@ instance showMilliseconds :: Show Milliseconds where newtype Seconds = Seconds Number derive instance newtypeSeconds :: Newtype Seconds _ -derive instance genericSeconds :: Generic Seconds _ derive newtype instance eqSeconds :: Eq Seconds derive newtype instance ordSeconds :: Ord Seconds -derive newtype instance semiringSeconds :: Semiring Seconds -derive newtype instance ringSeconds :: Ring Seconds + +instance semigroupSeconds :: Semigroup Seconds where + append (Seconds x) (Seconds y) = Seconds (x + y) + +instance monoidSeconds :: Monoid Seconds where + mempty = Seconds 0.0 instance showSeconds :: Show Seconds where show (Seconds n) = "(Seconds " <> show n <> ")" @@ -35,11 +40,14 @@ instance showSeconds :: Show Seconds where newtype Minutes = Minutes Number derive instance newtypeMinutes :: Newtype Minutes _ -derive instance genericMinutes :: Generic Minutes _ derive newtype instance eqMinutes :: Eq Minutes derive newtype instance ordMinutes :: Ord Minutes -derive newtype instance semiringMinutes :: Semiring Minutes -derive newtype instance ringMinutes :: Ring Minutes + +instance semigroupMinutes :: Semigroup Minutes where + append (Minutes x) (Minutes y) = Minutes (x + y) + +instance monoidMinutes :: Monoid Minutes where + mempty = Minutes 0.0 instance showMinutes :: Show Minutes where show (Minutes n) = "(Minutes " <> show n <> ")" @@ -48,11 +56,14 @@ instance showMinutes :: Show Minutes where newtype Hours = Hours Number derive instance newtypeHours :: Newtype Hours _ -derive instance genericHours :: Generic Hours _ derive newtype instance eqHours :: Eq Hours derive newtype instance ordHours :: Ord Hours -derive newtype instance semiringHours :: Semiring Hours -derive newtype instance ringHours :: Ring Hours + +instance semigroupHours :: Semigroup Hours where + append (Hours x) (Hours y) = Hours (x + y) + +instance monoidHours :: Monoid Hours where + mempty = Hours 0.0 instance showHours :: Show Hours where show (Hours n) = "(Hours " <> show n <> ")" @@ -61,11 +72,14 @@ instance showHours :: Show Hours where newtype Days = Days Number derive instance newtypeDays :: Newtype Days _ -derive instance genericDays :: Generic Days _ derive newtype instance eqDays :: Eq Days derive newtype instance ordDays :: Ord Days -derive newtype instance semiringDays :: Semiring Days -derive newtype instance ringDays :: Ring Days + +instance semigroupDays :: Semigroup Days where + append (Days x) (Days y) = Days (x + y) + +instance monoidDays :: Monoid Days where + mempty = Days 0.0 instance showDays :: Show Days where show (Days n) = "(Days " <> show n <> ")" @@ -79,6 +93,11 @@ class Duration a where convertDuration :: forall a b. Duration a => Duration b => a -> b convertDuration = toDuration <<< fromDuration +-- | Negates a duration, turning a positive duration negative or a negative +-- | duration positive. +negateDuration :: forall a. Duration a => a -> a +negateDuration = toDuration <<< over Milliseconds negate <<< fromDuration + instance durationMilliseconds :: Duration Milliseconds where fromDuration = identity toDuration = identity diff --git a/test/Test/Main.purs b/test/Test/Main.purs index 062ceaa..4de3b6f 100644 --- a/test/Test/Main.purs +++ b/test/Test/Main.purs @@ -8,18 +8,14 @@ import Data.Array as Array import Data.Date as Date import Data.DateTime as DateTime import Data.DateTime.Instant as Instant -import Data.DateTime.Locale as Locale import Data.Either (Either(..), isRight) import Data.Enum (class BoundedEnum, Cardinality, toEnum, enumFromTo, cardinality, succ, fromEnum, pred) -import Data.Foldable (foldl, foldr, foldMap) import Data.Interval as Interval import Data.Interval.Duration.Iso as IsoDuration import Data.Maybe (Maybe(..), fromJust) import Data.Newtype (over, unwrap) -import Data.String (length) import Data.Time as Time import Data.Time.Duration as Duration -import Data.Traversable (sequence, traverse) import Data.Tuple (Tuple(..), snd) import Math (floor) import Partial.Unsafe (unsafePartial) @@ -77,10 +73,10 @@ main = do log "Check that adjust behaves as expected" assert $ Time.adjust (Duration.Milliseconds 1.0) top == Tuple (Duration.Days 1.0) bottom assert $ Time.adjust (Duration.Milliseconds (-1.0)) bottom == Tuple (Duration.Days (-1.0)) top - assert $ Time.adjust (Duration.Minutes 40.0) t1 == Tuple zero t2 + assert $ Time.adjust (Duration.Minutes 40.0) t1 == Tuple (Duration.Days 0.0) t2 assert $ Time.adjust (Duration.Days 40.0) t1 == Tuple (Duration.Days 40.0) t1 - assert $ Time.adjust (Duration.fromDuration (Duration.Days 2.0) + Duration.fromDuration (Duration.Minutes 40.0)) t1 == Tuple (Duration.Days 2.0) t2 - assert $ Time.adjust (Duration.fromDuration (Duration.Days 2.0) - Duration.fromDuration (Duration.Minutes 40.0)) t1 == Tuple (Duration.Days 2.0) t3 + assert $ Time.adjust (Duration.fromDuration (Duration.Days 2.0) <> Duration.fromDuration (Duration.Minutes 40.0)) t1 == Tuple (Duration.Days 2.0) t2 + assert $ Time.adjust (Duration.fromDuration (Duration.Days 2.0) <> Duration.fromDuration (Duration.Minutes (-40.0))) t1 == Tuple (Duration.Days 2.0) t3 assert $ snd (Time.adjust (Duration.fromDuration (Duration.Days 3.872)) t1) == snd (Time.adjust (Duration.fromDuration (Duration.Days 0.872)) t1) assert $ Time.adjust (Duration.Hours 2.0) t4 == Tuple (Duration.Days 1.0) t5 @@ -145,7 +141,7 @@ main = do let dt5 = DateTime.DateTime d3 t1 log "Check that adjust behaves as expected" - assert $ DateTime.adjust (Duration.fromDuration (Duration.Days 31.0) + Duration.fromDuration (Duration.Minutes 40.0)) dt1 == Just dt4 + assert $ DateTime.adjust (Duration.fromDuration (Duration.Days 31.0) <> Duration.fromDuration (Duration.Minutes 40.0)) dt1 == Just dt4 assert $ (Date.year <<< DateTime.date <$> (DateTime.adjust (Duration.Days 735963.0) epochDateTime)) == toEnum 2016 @@ -156,7 +152,7 @@ main = do assert $ DateTime.diff dt3 dt1 == Duration.Days 31.0 assert $ DateTime.diff dt5 dt3 == Duration.Days 29.0 assert $ DateTime.diff dt1 dt3 == Duration.Days (-31.0) - assert $ DateTime.diff dt4 dt1 == Duration.fromDuration (Duration.Days 31.0) + Duration.fromDuration (Duration.Minutes 40.0) + assert $ DateTime.diff dt4 dt1 == Duration.fromDuration (Duration.Days 31.0) <> Duration.fromDuration (Duration.Minutes 40.0) assert $ over Duration.Days floor (DateTime.diff dt1 epochDateTime) == Duration.Days 735963.0 @@ -181,31 +177,6 @@ main = do assert $ Instant.toDateTime (Instant.fromDateTime dt3) == dt3 assert $ Instant.toDateTime (Instant.fromDateTime dt4) == dt4 - -- locale ------------------------------------------------------------------ - - let locale = Locale.Locale (Just $ Locale.LocaleName "UTC") - $ Duration.Minutes 0.0 - let crLocalVal = Locale.LocalValue locale - - log "Check that LocalValue folds left" - assert $ foldl (<>) "prepend " (crLocalVal "foo") == "prepend foo" - - log "Check that LocalValue folds right" - assert $ foldr (<>) " append" (crLocalVal "foo") == "foo append" - - log "Check that LocalValue fold-maps" - assert $ foldMap ((<>) "prepend ") (crLocalVal "foo") == "prepend foo" - - log "Check that LocalValue sequences" - assert $ sequence (Locale.LocalValue locale $ Just "foo") - == (Just $ Locale.LocalValue locale "foo") - assert $ sequence (Locale.LocalValue locale (Nothing :: Maybe Int)) - == Nothing - - log "Check that LocalValue traverses" - assert $ traverse (Just <<< length) (crLocalVal "foo") - == (Just $ Locale.LocalValue locale 3) - log "All tests done" checkBounded :: forall e. Bounded e => Proxy e -> Effect Unit From e125b49e8433001294155edffca7de0c350b3b86 Mon Sep 17 00:00:00 2001 From: Gary Burgess Date: Thu, 24 May 2018 02:33:21 +0100 Subject: [PATCH 5/5] Update dependencies, license --- LICENSE | 38 ++++++++++++++++++++++---------------- bower.json | 33 +++++++++++++++++++++------------ package.json | 4 ++-- 3 files changed, 45 insertions(+), 30 deletions(-) diff --git a/LICENSE b/LICENSE index 58b0299..311379c 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,26 @@ -The MIT License (MIT) +Copyright 2018 PureScript -Copyright (c) 2014 PureScript +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +3. Neither the name of the copyright holder nor the names of its contributors +may be used to endorse or promote products derived from this software without +specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/bower.json b/bower.json index b5079b1..764bbf0 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,7 @@ { "name": "purescript-datetime", "homepage": "https://github.com/purescript/purescript-datetime", - "description": "PureScript library for date and time values", - "license": "MIT", + "license": "BSD-3-Clause", "repository": { "type": "git", "url": "git://github.com/purescript/purescript-datetime.git" @@ -16,17 +15,27 @@ "package.json" ], "dependencies": { - "purescript-enums": "#compiler/0.12", - "purescript-functions": "#compiler/0.12", - "purescript-integers": "#compiler/0.12", - "purescript-foldable-traversable": "#compiler/0.12", - "purescript-ordered-collections": "#compiler/0.12", - "purescript-math": "#compiler/0.12", - "purescript-proxy": "#compiler/0.12" + "purescript-bifunctors": "^4.0.0", + "purescript-control": "^4.0.0", + "purescript-either": "^4.0.0", + "purescript-enums": "^4.0.0", + "purescript-foldable-traversable": "^4.0.0", + "purescript-functions": "^4.0.0", + "purescript-gen": "^2.0.0", + "purescript-integers": "^4.0.0", + "purescript-lists": "^5.0.0", + "purescript-math": "^2.1.1", + "purescript-maybe": "^4.0.0", + "purescript-newtype": "^3.0.0", + "purescript-ordered-collections": "^1.0.0", + "purescript-partial": "^2.0.0", + "purescript-prelude": "^4.0.0", + "purescript-tuples": "^5.0.0" }, "devDependencies": { - "purescript-assert": "#compiler/0.12", - "purescript-console": "#compiler/0.12", - "purescript-strings": "#compiler/0.12" + "purescript-assert": "^4.0.0", + "purescript-console": "^4.0.0", + "purescript-strings": "^4.0.0", + "purescript-proxy": "^3.0.0" } } diff --git a/package.json b/package.json index c9e5a5b..657080a 100644 --- a/package.json +++ b/package.json @@ -7,8 +7,8 @@ }, "devDependencies": { "eslint": "^4.19.1", - "pulp": "^12.0.x", - "purescript-psa": "^0.6.x", + "pulp": "^12.2.0", + "purescript-psa": "^0.6.0", "rimraf": "^2.6.2" } }