Skip to content

Commit c94bac7

Browse files
committed
Prepare for hackage release
1 parent 3d1696c commit c94bac7

File tree

4 files changed

+59
-22
lines changed

4 files changed

+59
-22
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Changelog
2+
3+
## [0.1.0.0] - 6/24/2023
4+
5+
- First release of optics-operators.
6+
- Provides only (+=), (-=), (*=), (//=) operators for now.

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ Necessary language extensions and imports for the example:
2121
```haskell
2222
{-# LANGUAGE DeriveGeneric, OverloadedLabels #-}
2323
import GHC.Generics (Generic)
24-
import Control.Monad.State (StateT, execStateT)
24+
import Control.Monad.State (State, execState)
2525
import Data.Optics.Operators ((+=), (-=), (*=))
26-
import Control.Monad ((<=<))
2726
```
2827

2928
Basic example using state operators:
@@ -32,10 +31,10 @@ newtype Person = Person
3231
{ age :: Int
3332
} deriving (Show, Generic)
3433

35-
addAge :: Int -> StateT Person IO ()
34+
addAge :: Int -> State Person ()
3635
addAge age = #age += age
3736

38-
subtractAge :: Int -> StateT Person IO ()
37+
subtractAge :: Int -> State Person ()
3938
subtractAge age = #age -= age
4039
```
4140

@@ -45,7 +44,7 @@ person :: Person
4544
person = Person 50
4645

4746
main :: IO ()
48-
main = print <=< flip execStateT person $ do
47+
main = print . flip execState person $ do
4948
addAge 10
5049
subtractAge 20
5150
#age *= 2

optics-operators.cabal

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
cabal-version: 1.12
1+
cabal-version: 1.18
22

33
-- This file has been generated from package.yaml by hpack version 0.34.7.
44
--
@@ -8,13 +8,26 @@ name: optics-operators
88
version: 0.1.0.0
99
synopsis: A tiny package containing operators missing from the official package.
1010
description: A tiny package containing operators missing from the official package.
11+
Basic example using state operators:
12+
.
13+
> newtype Person = Person { age :: Int } deriving (Show, Generic)
14+
>
15+
> main :: IO ()
16+
> main = print <=< flip execStateT (Person 0) $ do
17+
> #age += 50
18+
> #age -= 20
19+
>
20+
> -- Output: Person {age = 30}
1121
category: Data, Optics, Lenses
1222
homepage: https://github.com/qwbarch/optics-operators
1323
bug-reports: https://github.com/qwbarch/optics-operators/issues
24+
author: qwbarch
1425
maintainer: qwbarch <qwbarch@gmail.com>
1526
license: MIT
1627
license-file: LICENSE
1728
build-type: Simple
29+
extra-doc-files:
30+
CHANGELOG.md
1831

1932
library
2033
exposed-modules:
@@ -23,7 +36,6 @@ library
2336
Paths_optics_operators
2437
hs-source-dirs:
2538
src
26-
ghc-options: -threaded -rtsopts -with-rtsopts=-N -O2 -flate-specialise -fspecialise-aggressively -Wall -Wno-name-shadowing
2739
build-depends:
2840
base >=4.10 && <5
2941
, mtl ==2.*
@@ -38,7 +50,7 @@ executable readme
3850
hs-source-dirs:
3951
./
4052
src
41-
ghc-options: -threaded -rtsopts -with-rtsopts=-N -O2 -flate-specialise -fspecialise-aggressively -Wall -Wno-name-shadowing -pgmL markdown-unlit
53+
ghc-options: -threaded -rtsopts -with-rtsopts=-N -flate-specialise -fspecialise-aggressively -Wall -Wno-name-shadowing -pgmL markdown-unlit
4254
build-depends:
4355
base >=4.10 && <5
4456
, mtl ==2.*
@@ -54,7 +66,7 @@ test-suite unit-test
5466
hs-source-dirs:
5567
src
5668
test
57-
ghc-options: -threaded -rtsopts -with-rtsopts=-N -O2 -flate-specialise -fspecialise-aggressively -Wall -Wno-name-shadowing
69+
ghc-options: -threaded -rtsopts -with-rtsopts=-N -flate-specialise -fspecialise-aggressively -Wall -Wno-name-shadowing
5870
build-depends:
5971
base >=4.10 && <5
6072
, mtl ==2.*

package.yaml

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,26 @@ name: optics-operators
22
version: 0.1.0.0
33
license: MIT
44
license-file: LICENSE
5+
author: qwbarch
56
maintainer: qwbarch <qwbarch@gmail.com>
67
category: Data, Optics, Lenses
7-
synopsis: A tiny package containing operators missing from the official package.
8-
description: A tiny package containing operators missing from the official package.
98
homepage: https://github.com/qwbarch/optics-operators
109
bug-reports: https://github.com/qwbarch/optics-operators/issues
10+
extra-doc-files: CHANGELOG.md
11+
12+
synopsis: A tiny package containing operators missing from the official package.
13+
description: |
14+
A tiny package containing operators missing from the official package.
15+
Basic example using state operators:
16+
17+
> newtype Person = Person { age :: Int } deriving (Show, Generic)
18+
>
19+
> main :: IO ()
20+
> main = print <=< flip execStateT (Person 0) $ do
21+
> #age += 50
22+
> #age -= 20
23+
>
24+
> -- Output: Person {age = 30}
1125
1226
library:
1327
source-dirs:
@@ -19,7 +33,15 @@ executables:
1933
source-dirs:
2034
- .
2135
- src
22-
ghc-options: -pgmL markdown-unlit
36+
ghc-options:
37+
- -threaded
38+
- -rtsopts
39+
- -with-rtsopts=-N
40+
- -flate-specialise
41+
- -fspecialise-aggressively
42+
- -Wall
43+
- -Wno-name-shadowing
44+
- -pgmL markdown-unlit
2345

2446
tests:
2547
unit-test:
@@ -30,16 +52,14 @@ tests:
3052
dependencies:
3153
- tasty >= 1.4.3 && < 1.5
3254
- tasty-quickcheck >= 0.10.2 && < 0.11
33-
34-
ghc-options:
35-
- -threaded
36-
- -rtsopts
37-
- -with-rtsopts=-N
38-
- -O2
39-
- -flate-specialise
40-
- -fspecialise-aggressively
41-
- -Wall
42-
- -Wno-name-shadowing
55+
ghc-options:
56+
- -threaded
57+
- -rtsopts
58+
- -with-rtsopts=-N
59+
- -flate-specialise
60+
- -fspecialise-aggressively
61+
- -Wall
62+
- -Wno-name-shadowing
4363

4464
dependencies:
4565
- base >= 4.10 && < 5

0 commit comments

Comments
 (0)