1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-08-10 22:31:32 +02:00

Merge pull request #4 from IBM/cleue-getting-started-docs

doc: some docs
This commit is contained in:
Carsten Leue
2023-07-18 16:52:49 +02:00
committed by GitHub
4 changed files with 25 additions and 1 deletions

View File

@@ -1,9 +1,19 @@
# 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.
![logo](resources/images/logo.png)
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
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
View 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
View File

@@ -0,0 +1,2 @@
// Package sample contains examples that illustrate how to use fp-go
package samples

View File

@@ -17,6 +17,8 @@ type RecordType struct {
Data string `json:"data"`
}
// TestReadSingleFile reads the content of a file from disk and parses it into
// a struct
func TestReadSingleFile(t *testing.T) {
data := F.Pipe2(