1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-24 19:29:11 +02:00

Compare commits

...

15 Commits

Author SHA1 Message Date
renovate[bot]
1cdca552b2 chore(deps): update actions/checkout action to v4.3.0 (#137)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-08-11 18:38:27 +00:00
renovate[bot]
73480ca030 fix(deps): update module github.com/urfave/cli/v2 to v2.27.7 (#136)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-06-14 10:26:20 +00:00
renovate[bot]
734e2b0055 chore(deps): update actions/setup-node action to v4.4.0 (#134)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-04-14 10:54:36 +00:00
renovate[bot]
4c28859e89 chore(deps): update actions/setup-node action to v4.3.0 (#131)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-17 06:44:51 +00:00
renovate[bot]
a516849c07 fix(deps): update module github.com/urfave/cli/v2 to v2.27.6 (#130)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-03-05 22:50:57 +00:00
sarabande
29200d34dc docs(iterator): update Cycle function documentation (#128) 2025-03-02 00:21:41 +01:00
renovate[bot]
7a3989989b chore(deps): update actions/setup-node action to v4.2.0 (#127)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-27 22:04:25 +00:00
renovate[bot]
6a6d53f025 fix(deps): update module github.com/stretchr/testify to v1.10.0 (#126)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2024-11-23 15:33:28 +00:00
renovate[bot]
078da752cd chore(deps): update actions/setup-node action to v4.1.0 2024-10-24 20:12:43 +00:00
renovate[bot]
1a489fde27 chore(deps): update actions/checkout action to v4.2.2 2024-10-23 19:31:36 +00:00
renovate[bot]
a135b2acae fix(deps): update module github.com/urfave/cli/v2 to v2.27.5 2024-10-13 20:09:16 +00:00
renovate[bot]
9e9dfa1f5f chore(deps): update actions/checkout action to v4.2.1 2024-10-07 22:39:01 +00:00
renovate[bot]
dd87ea12b3 chore(deps): update actions/checkout action to v4.2.0 2024-09-25 21:29:08 +00:00
renovate[bot]
5fc0d18c97 chore(deps): update actions/setup-node action to v4.0.4 2024-09-19 20:14:45 +00:00
CRaLFa
76c1297576 fix typos in README and comment (#119)
Signed-off-by: CRaLFa <minami.smd@gmail.com>
2024-09-12 09:40:19 +02:00
6 changed files with 22 additions and 11 deletions

View File

@@ -29,7 +29,7 @@ jobs:
go-version: [ '1.20.x', '1.21.x', '1.22.x', '1.23.x']
steps:
# full checkout for semantic-release
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0
- name: Set up go ${{ matrix.go-version }}
@@ -55,12 +55,12 @@ jobs:
steps:
# full checkout for semantic-release
- name: Full checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
with:
fetch-depth: 0
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: ${{ env.NODE_VERSION }}

View File

@@ -29,9 +29,9 @@ This library aims to provide a set of data types and functions that make it easy
### How does this play with the [🧘🏽 Zen Of Go](https://the-zen-of-go.netlify.app/)?
#### 🧘🏽 Each package fulfils a single purpose
#### 🧘🏽 Each package fulfills a single purpose
✔️ Each of the top level packages (e.g. Option, Either, ReaderIOEither, ...) fulfils the purpose of defining the respective data type and implementing the set of common operations for this data type.
✔️ Each of the top level packages (e.g. Option, Either, ReaderIOEither, ...) fulfills the purpose of defining the respective data type and implementing the set of common operations for this data type.
#### 🧘🏽 Handle errors explicitly

6
go.mod
View File

@@ -3,12 +3,12 @@ module github.com/IBM/fp-go
go 1.20
require (
github.com/stretchr/testify v1.9.0
github.com/urfave/cli/v2 v2.27.4
github.com/stretchr/testify v1.10.0
github.com/urfave/cli/v2 v2.27.7
)
require (
github.com/cpuguy83/go-md2man/v2 v2.0.4 // indirect
github.com/cpuguy83/go-md2man/v2 v2.0.7 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/russross/blackfriday/v2 v2.1.0 // indirect

12
go.sum
View File

@@ -1,5 +1,9 @@
github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4=
github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.7 h1:zbFlGlXEAKlwXpmvle3d8Oe3YnkKIK4xSRTd3sHPnBo=
github.com/cpuguy83/go-md2man/v2 v2.0.7/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
@@ -8,8 +12,16 @@ github.com/russross/blackfriday/v2 v2.1.0 h1:JIOH55/0cWyOuilr9/qlrm0BSXldqnqwMsf
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
github.com/urfave/cli/v2 v2.27.4 h1:o1owoI+02Eb+K107p27wEX9Bb8eqIoZCfLXloLUSWJ8=
github.com/urfave/cli/v2 v2.27.4/go.mod h1:m4QzxcD2qpra4z7WhzEGn74WZLViBnMpb1ToCAKdGRQ=
github.com/urfave/cli/v2 v2.27.5 h1:WoHEJLdsXr6dDWoJgMq/CboDmyY/8HMMH1fTECbih+w=
github.com/urfave/cli/v2 v2.27.5/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/urfave/cli/v2 v2.27.6 h1:VdRdS98FNhKZ8/Az8B7MTyGQmpIr36O1EHybx/LaZ4g=
github.com/urfave/cli/v2 v2.27.6/go.mod h1:3Sevf16NykTbInEnD0yKkjDAeZDS0A6bzhBH5hrMvTQ=
github.com/urfave/cli/v2 v2.27.7 h1:bH59vdhbjLv3LAvIu6gd0usJHgoTTPhCFib8qqOwXYU=
github.com/urfave/cli/v2 v2.27.7/go.mod h1:CyNAG/xg+iAOg0N4MPGZqVmv2rCoP267496AOXUZjA4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1 h1:gEOO8jv9F4OT7lGCjxCBTO/36wtF6j2nSip77qHd4x4=
github.com/xrash/smetrics v0.0.0-20240521201337-686a1a2994c1/go.mod h1:Ohn+xnUBiLI6FVj/9LpzZWtj1/D6lUovWYBkxHVV3aM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=

View File

@@ -19,8 +19,7 @@ import (
G "github.com/IBM/fp-go/iterator/stateless/generic"
)
// DropWhile creates an [Iterator] that drops elements from the [Iterator] as long as the predicate is true; afterwards, returns every element.
// Note, the [Iterator] does not produce any output until the predicate first becomes false
// Cycle creates an [Iterator] containing an [Iterator] repeated an infinite number of times.
func Cycle[U any](ma Iterator[U]) Iterator[U] {
return G.Cycle[Iterator[U]](ma)
}

View File

@@ -64,7 +64,7 @@ func Reverse[T any](o Ord[T]) Ord[T] {
}, o.Equals)
}
// Contramap creates an odering under a transformation function
// Contramap creates an ordering under a transformation function
func Contramap[A, B any](f func(B) A) func(Ord[A]) Ord[B] {
return func(o Ord[A]) Ord[B] {
return MakeOrd(func(x, y B) int {