mirror of
https://github.com/IBM/fp-go.git
synced 2025-08-10 22:31:32 +02:00
fix: some docs
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
12
README.md
12
README.md
@@ -1,9 +1,19 @@
|
|||||||
# Functional programming library for golang
|
# Functional programming library for golang
|
||||||
|
|
||||||
**🚧 Work in progress! 🚧**
|
**🚧 Work in progress! 🚧** Despite major version 1 because of https://github.com/semantic-release/semantic-release/issues/1507. Trying to not make breaking changes, but devil is in the details.
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
This library is strongly influenced by the awesome [fp-ts](https://github.com/gcanti/fp-ts).
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
```bash
|
||||||
|
go get github.com/IBM/fp-go
|
||||||
|
```
|
||||||
|
|
||||||
|
Refer to the [samples](./samples/).
|
||||||
|
|
||||||
## Design Goal
|
## Design Goal
|
||||||
|
|
||||||
This library aims to provide a set of data types and functions that make it easy and fun to write maintainable and testable code in golang. It encourages the following patterns:
|
This library aims to provide a set of data types and functions that make it easy and fun to write maintainable and testable code in golang. It encourages the following patterns:
|
||||||
|
10
samples/README.md
Normal file
10
samples/README.md
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
# Samples
|
||||||
|
|
||||||
|
This folder is meant to contain examples that illustrate how to use the library. I recommend the following reading to get an idea of the underlying concepts. These articles talk about [fp-ts](https://github.com/gcanti/fp-ts) but the concepts are very similar, only syntax differs.
|
||||||
|
|
||||||
|
### References
|
||||||
|
|
||||||
|
- [Ryan's Blog](https://rlee.dev/practical-guide-to-fp-ts-part-1) - practical introduction into FP concepts
|
||||||
|
- [Investigate Functional Programming Concepts in Go](https://betterprogramming.pub/investigate-functional-programming-concepts-in-go-1dada09bc913) - discussion around FP concepts in golang
|
||||||
|
- [Investigating the I/O Monad in Go](https://medium.com/better-programming/investigating-the-i-o-monad-in-go-3c0fabbb4b3d) - a closer look at I/O monads in golang
|
||||||
|
-
|
2
samples/doc.go
Normal file
2
samples/doc.go
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
// Package sample contains examples that illustrate how to use fp-go
|
||||||
|
package samples
|
@@ -17,6 +17,8 @@ type RecordType struct {
|
|||||||
Data string `json:"data"`
|
Data string `json:"data"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TestReadSingleFile reads the content of a file from disk and parses it into
|
||||||
|
// a struct
|
||||||
func TestReadSingleFile(t *testing.T) {
|
func TestReadSingleFile(t *testing.T) {
|
||||||
|
|
||||||
data := F.Pipe2(
|
data := F.Pipe2(
|
||||||
|
Reference in New Issue
Block a user