Skip to content

Commit

Permalink
Merge pull request #205 from TeofilC/time
Browse files Browse the repository at this point in the history
classy-prelude: Support time >= 1.10
  • Loading branch information
snoyberg authored Nov 22, 2021
2 parents 224e4c0 + 86a31da commit 7382719
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 6 deletions.
4 changes: 2 additions & 2 deletions classy-prelude-conduit/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: classy-prelude-conduit
version: 1.5.0
version: 1.5.1
synopsis: classy-prelude together with conduit functions
description: See docs and README at <http://www.stackage.org/package/classy-prelude-conduit>
category: Control, Prelude
Expand All @@ -24,7 +24,7 @@ library:
- -fno-warn-orphans
dependencies:
- conduit >=1.3 && <1.4
- classy-prelude >=1.5.0 && <1.5.1
- classy-prelude >=1.5.0 && <1.5.2
- monad-control
- resourcet
- void
Expand Down
6 changes: 3 additions & 3 deletions classy-prelude-yesod/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: classy-prelude-yesod
version: 1.5.0
version: 1.5.1
synopsis: Provide a classy prelude including common Yesod functionality.
description: See docs and README at <http://www.stackage.org/package/classy-prelude-yesod>
category: Control, Yesod
Expand All @@ -14,8 +14,8 @@ extra-source-files:

dependencies:
- base >= 4.13 && <5
- classy-prelude >=1.5.0 && <1.5.1
- classy-prelude-conduit >=1.5.0 && <1.5.1
- classy-prelude >=1.5.0 && <1.5.2
- classy-prelude-conduit >=1.5.0 && <1.5.2
- yesod >=1.2
- yesod-newsfeed
- yesod-static
Expand Down
5 changes: 5 additions & 0 deletions classy-prelude/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 1.5.1

* Export a compatiblity shim for `parseTime` as it has been removed in `time-1.10`.
See <https://hackage.haskell.org/package/time-1.12/changelog>

## 1.5.0

* Removed `alwaysSTM` and `alwaysSucceedsSTM`. See
Expand Down
2 changes: 1 addition & 1 deletion classy-prelude/package.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: classy-prelude
version: 1.5.0
version: 1.5.1
synopsis: A typeclass-based Prelude.
description: See docs and README at <http://www.stackage.org/package/classy-prelude>
category: Control, Prelude
Expand Down
18 changes: 18 additions & 0 deletions classy-prelude/src/ClassyPrelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ module ClassyPrelude
, traceShowM
-- ** Time (since 0.6.1)
, module Data.Time
#if MIN_VERSION_time(1,10,0)
, parseTime
#endif
-- ** Generics (since 0.8.1)
, Generic
-- ** Transformers (since 0.9.4)
Expand Down Expand Up @@ -190,7 +193,9 @@ import Data.Time
, toGregorian
, fromGregorian
, formatTime
#if !MIN_VERSION_time(1,10,0)
, parseTime
#endif
, parseTimeM
, getCurrentTime
, defaultTimeLocale
Expand Down Expand Up @@ -620,3 +625,16 @@ getContents = liftIO LTextIO.getContents
-- @since 1.3.1
interact :: MonadIO m => (LText -> LText) -> m ()
interact = liftIO . LTextIO.interact


#if MIN_VERSION_time(1,10,0)
parseTime
:: ParseTime t
=> TimeLocale -- ^ Time locale.
-> String -- ^ Format string.
-> String -- ^ Input string.
-> Maybe t -- ^ The time value, or 'Nothing' if the input could not be parsed using the given format.
parseTime = parseTimeM True
#endif


0 comments on commit 7382719

Please sign in to comment.