Skip to content

Commit

Permalink
Prepare the 1.0.0.0 release (#365)
Browse files Browse the repository at this point in the history
* Prepare the 1.0.0.0 release

* Various fixes
  • Loading branch information
chshersh authored Mar 12, 2021
1 parent f9ff639 commit 42e70ad
Show file tree
Hide file tree
Showing 14 changed files with 126 additions and 50 deletions.
36 changes: 26 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
name: CI

# Trigger the workflow on push or pull request, but only for the main branch
on:
pull_request:
types: [synchronize, opened, reopened]
push:
branches: [main]
schedule:
# additionally run once per week (At 00:00 on Sunday) to maintain cache
- cron: '0 0 * * 0'

jobs:
cabal:
Expand Down Expand Up @@ -46,7 +49,6 @@ jobs:

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v1
id: setup-haskell-cabal
Expand All @@ -55,24 +57,35 @@ jobs:
ghc-version: ${{ matrix.ghc }}
cabal-version: ${{ matrix.cabal }}

- uses: actions/cache@v1
name: Cache cabal-store
- name: Configure
run: |
cabal configure --enable-tests --enable-benchmarks --enable-documentation --test-show-details=direct --write-ghc-environment-files=always
- name: Freeze
run: |
cabal freeze
- uses: actions/cache@v2.1.3
name: Cache ~/.cabal/store
with:
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }}
key: ${{ runner.os }}-${{ matrix.ghc }}-cabal
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }}

- name: Install dependencies
run: |
cabal build all --only-dependencies
- name: Build
run: |
cabal update
cabal build --enable-tests --enable-benchmarks --write-ghc-environment-files=always
cabal build all
- name: Test
run: |
cabal test --enable-tests --test-show-details=direct
cabal test all
- name: Documentation
run: |
cabal haddock --enable-documentation
cabal haddock
stack:
name: stack / ghc ${{ matrix.ghc }}
Expand All @@ -84,7 +97,6 @@ jobs:

steps:
- uses: actions/checkout@v2
if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/main'

- uses: haskell/actions/setup@v1
name: Setup Haskell Stack
Expand All @@ -98,6 +110,10 @@ jobs:
path: ~/.stack
key: ${{ runner.os }}-${{ matrix.ghc }}-stack

- name: Install dependencies
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks --only-dependencies
- name: Build
run: |
stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks
Expand Down
79 changes: 65 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
`relude` uses [PVP Versioning][1].
The changelog is available [on GitHub][2].

## Unreleased: 0.8.0.0
## 1.0.0.0 — Mar 12, 2021

* [#353](https://github.com/kowainik/relude/issues/353):
Reexport most common modules from the following libraries:
Expand All @@ -29,14 +29,9 @@ The changelog is available [on GitHub][2].

* [#345](https://github.com/kowainik/relude/issues/345):
Support GHC-9.0.
* Upgrade to GHC-8.10.4, GHC-8.8.4.
* Add `infinitely` as more strictly typed `forever`.
* Remove `Eq` constraint on `universeNonEmpty`
* Add `maybeAt`, `!!?` with its arguments flipped.
* [#346](https://github.com/kowainik/relude/issues/346):
Reimplement `ordNub` through `nubOrd` from `containers`.

Add `intNub` and `intNubOn` functions.
* Upgrade minor GHC versions to GHC-8.10.4 and GHC-8.8.4.
* [#268](https://github.com/kowainik/relude/issues/268):
Drop support of GHC-8.0.2.
* [#270](https://github.com/kowainik/relude/issues/270):
Standardise `universe`, `universeNonEmpty` and `inverseMap` functions that
previously were introduced in the `Relude.Extra.Enum` module. `Relude.Enum`
Expand All @@ -45,11 +40,67 @@ The changelog is available [on GitHub][2].
__Migration guide:__ If you were using any of these functions you can now
remove `Relude.Extra.Enum` from your imports and explicit `mixins` section
as they are available for you with the `Relude` module.
* [#347](https://github.com/kowainik/relude/issues/347):
Add `ordNubOn` function.
* [#268](https://github.com/kowainik/relude/issues/268):
Drop support of GHC-8.0.2.
* Add lifted `readFile'` function.
* Remove the `Eq` constraint on `universeNonEmpty`
* [#269](https://github.com/kowainik/relude/issues/269):
Remove the `Relude.Extra.Validation` module.

__Migration guide:__
If you use `Relude.Extra.Validation` in you project you need to:

1. Add `validation-selective` into the `build-depends` section of your
`.cabal` file.
2. Change imports of `Relude.Extra.Validation` to `Validation`:

```haskell
-- Was:
import Relude.Extra.Validation (Validation (..), ..)
-- Became:
import Validation (Validation (..), ..)
```

* [#346](https://github.com/kowainik/relude/issues/346),
[#347](https://github.com/kowainik/relude/issues/347):
Reimplement `ordNub` through `nubOrd` from `containers`.
Add `ordNubOn`, `intNub` and `intNubOn` functions.
* [#327](https://github.com/kowainik/relude/issues/327):
Add `infinitely` as more strictly typed `forever`.
* [#311](https://github.com/kowainik/relude/issues/311):
Add `maybeAt` function the non-operator version of `!!?` with its
arguments flipped.
* [#314](https://github.com/kowainik/relude/issues/314):
Add lifted versions of functions to work with `Handle`:

+ `hFlush`
+ `hIsEOF`
+ `hSetBuffering`
+ `hGetBuffering`
* [#305](https://github.com/kowainik/relude/issues/305):
Add lifted versions of functions to work with environment:

+ `getArgs`
+ `lookupEnv`
* Add lifted version of the `readFile'` function.
* Reexport the `BufferMode` type from `base`.
* [#309](https://github.com/kowainik/relude/issues/309):
Reexport `span` from `Data.List`.
* [#319](https://github.com/kowainik/relude/issues/319):
Implement `partitionWith`.
* [#307](https://github.com/kowainik/relude/issues/307):
Add `foldr1` to `Foldable1`.
* [#316](https://github.com/kowainik/relude/issues/316):
Add `average` and `average1` efficient functions for finding
average on foldable structures.
* [#306](https://github.com/kowainik/relude/issues/306):
Add `maximumOn1` and `minimumOn1` to `Foldable1`.
* [#301](https://github.com/kowainik/relude/issues/301):
Add `traceShowWith` to `Relude.Debug`.
* [#304](https://github.com/kowainik/relude/issues/304),
[#317](https://github.com/kowainik/relude/issues/317):
Various documentation improvements.
* Updates to `relude`-specific `.hlint` rules.

Thanks @googleson78, @sushi-shi, @rektrex, @aleator, @mjgpy3, @dalpd,
@Bodigrim for helping with this release!

## 0.7.0.0 — May 14, 2020

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ version: 0.0.0.0
library
exposed-modules: Example
build-depends: base >= 4.10 && < 4.13
, relude ^>= x.x.x.x
, relude ^>= 1.0.0.0
mixins: base hiding (Prelude)
, relude (Relude as Prelude)
Expand Down Expand Up @@ -681,7 +681,7 @@ For the latest `relude` version, this can be achieved by executing the following
two commands on your CI:

```yaml
curl https://raw.githubusercontent.com/kowainik/relude/v0.7.0.0/.hlint.yaml -o .hlint-relude.yaml
curl https://raw.githubusercontent.com/kowainik/relude/v1.0.0.0/.hlint.yaml -o .hlint-relude.yaml
curl -sSL https://raw.github.com/ndmitchell/neil/master/misc/travis.sh | sh -s -- hlint -h .hlint-relude.yaml .
```

Expand Down
2 changes: 1 addition & 1 deletion relude.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 3.0
name: relude
version: 0.7.0.0
version: 1.0.0.0
synopsis: Safe, performant, user-friendly and lightweight Haskell Standard Library
description:
@__relude__@ is an alternative prelude library. If you find the default
Expand Down
6 changes: 4 additions & 2 deletions src/Relude/Debug.hs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ instance:
1
* If you don't need such flexibility, use simpler 'trace', 'traceShow' or 'traceShowId'
@since 1.0.0.0
-}
traceShowWith :: Show b => (a -> b) -> a -> a
traceShowWith f v = Debug.traceShow (f v) v
Expand Down Expand Up @@ -252,13 +254,13 @@ error handling mechanism.
>>> error "oops"
*** Exception: oops
CallStack (from HasCallStack):
error, called at src\\Relude\\Debug.hs:286:11 in ...
error, called at src\\Relude\\Debug.hs:288:11 in ...
...
#else
>>> error "oops"
*** Exception: oops
CallStack (from HasCallStack):
error, called at src/Relude/Debug.hs:286:11 in ...
error, called at src/Relude/Debug.hs:288:11 in ...
...
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/Relude/Enum.hs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ extra modules, but due to their benefit in different use cases. If you imported
@Relude.Extra.Enum@ module, you can remove it now, as these functions are
reexported in the main "Relude" module.
@since x.x.x.x
@since 1.0.0.0
-}

module Relude.Enum
Expand Down
2 changes: 1 addition & 1 deletion src/Relude/Extra/Foldable.hs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Just 2.75
>>> average []
Nothing
@since 0.8.0.0
@since 1.0.0.0
-}
average :: forall a f . (Foldable f, Fractional a) => f a -> Maybe a
average xs
Expand Down
16 changes: 11 additions & 5 deletions src/Relude/Extra/Foldable1.hs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{-# OPTIONS_GHC -Wno-redundant-constraints #-}

{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE Safe #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE UndecidableInstances #-}
{-# LANGUAGE BangPatterns #-}

{- |
Copyright: (c) 2011-2015 Edward Kmett
Expand All @@ -31,7 +31,7 @@ module Relude.Extra.Foldable1
) where

import Relude hiding (Product (..), Sum (..))
import Relude.Extra.Newtype (( #. ))
import Relude.Extra.Newtype ((#.))

import Data.Functor.Product (Product (..))
import Data.Functor.Sum (Sum (..))
Expand Down Expand Up @@ -75,6 +75,8 @@ class Foldable f => Foldable1 f where
6
>>> foldr1 (+) 1 $ Identity 3
4
@since 1.0.0.0
-}
foldr1 :: (a -> b -> b) -> b -> f a -> b
foldr1 f accum as = appEndo (foldMap1 (Endo #. f) as) accum
Expand Down Expand Up @@ -125,6 +127,8 @@ class Foldable f => Foldable1 f where
>>> maximumOn1 abs (0 :| [2, 1, -3, -2])
-3
@since 1.0.0.0
-}
maximumOn1 :: Ord b => (a -> b) -> f a -> a
maximumOn1 f = maximumOn1 f . toNonEmpty
Expand All @@ -135,6 +139,8 @@ class Foldable f => Foldable1 f where
>>> minimumOn1 abs (0 :| [2, 1, -3, -2])
0
@since 1.0.0.0
-}
minimumOn1 :: Ord b => (a -> b) -> f a -> a
minimumOn1 f = minimumOn1 f . toNonEmpty
Expand Down Expand Up @@ -178,7 +184,7 @@ instance Foldable1 NonEmpty where
cmpOn :: a -> a -> a
cmpOn a b = case func a `compare` func b of
GT -> a
_ -> b
_ -> b
{-# INLINE maximumOn1 #-}

minimumOn1 :: forall a b. Ord b => (a -> b) -> NonEmpty a -> a
Expand All @@ -187,7 +193,7 @@ instance Foldable1 NonEmpty where
cmpOn :: a -> a -> a
cmpOn a b = case func a `compare` func b of
LT -> a
_ -> b
_ -> b
{-# INLINE minimumOn1 #-}

{- |
Expand Down Expand Up @@ -396,7 +402,7 @@ possible and returns the resulting element.
>>> average1 (1 :| [2,3,4])
2.5
@since 0.8.0.0
@since 1.0.0.0
-}
average1 :: forall a f . (Foldable1 f, Fractional a) => f a -> a
average1 = uncurry (/) . foldl' (\(!total, !count) x -> (total + x, count + 1)) (0,0)
Expand Down
6 changes: 3 additions & 3 deletions src/Relude/Lifted/Env.hs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Portability: Portable
Lifted functions to work with system environment.
@since 0.8.0.0
@since 1.0.0.0
-}

module Relude.Lifted.Env
Expand All @@ -24,7 +24,7 @@ import qualified System.Environment as ENV (getArgs, lookupEnv)

{- | Lifted version of 'System.Environment.getArgs'.
@since 0.8.0.0
@since 1.0.0.0
-}
getArgs :: MonadIO m => m [String]
getArgs = liftIO ENV.getArgs
Expand All @@ -33,7 +33,7 @@ getArgs = liftIO ENV.getArgs

{- | Lifted version of 'System.Environment.lookupEnv'.
@since 0.8.0.0
@since 1.0.0.0
-}
lookupEnv :: MonadIO m => String -> m (Maybe String)
lookupEnv = liftIO . ENV.lookupEnv
Expand Down
2 changes: 1 addition & 1 deletion src/Relude/Lifted/File.hs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ readFile = liftIO . IO.readFile
#if ( __GLASGOW_HASKELL__ >= 900 )
{- | Lifted version of 'IO.readFile''. Strict version of 'readFile'.
@since x.x.x.x
@since 1.0.0.0
-}
readFile' :: MonadIO m => FilePath -> m String
readFile' = liftIO . IO.readFile'
Expand Down
Loading

0 comments on commit 42e70ad

Please sign in to comment.