Skip to content

Commit

Permalink
Merge pull request #135 from logic-building/methodchain
Browse files Browse the repository at this point in the history
Methodchain
  • Loading branch information
logic-building authored Mar 24, 2021
2 parents e8a355c + 11fc130 commit ddc2c53
Show file tree
Hide file tree
Showing 375 changed files with 13,829 additions and 858 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs: # basic units of work in a run
build: # runs not using Workflows must have a `build` job as entry point
docker: # run the steps with Docker
# CircleCI Go images available at: https://hub.docker.com/r/circleci/golang/
- image: circleci/golang:1.11 #
- image: circleci/golang:1.15 #

# directory where steps are run. Path must conform to the Go Workspace requirements
working_directory: /go/src/github.com/logic-building/functional-go/
Expand Down
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified AUTHORS
100644 → 100755
Empty file.
Empty file modified LICENSE
100644 → 100755
Empty file.
25 changes: 23 additions & 2 deletions README.md
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ go install github.com/logic-building/functional-go/gofp
```toml
[[constraint]]
name = "github.com/logic-building/functional-go"
version = "8.13.1"
version = "8.14.0"
```

### Quick Start
Expand All @@ -36,7 +36,7 @@ func square(num int) int {
}

```
#### Four variants of function. 1 is given above and 3 are given below
#### Four variants of the function. 1 is given above and 3 are given below
##### MapInt, MapIntPtr, MapIntErr, MapIntPtrErr
### MapIntPtr
```go
Expand Down Expand Up @@ -341,6 +341,27 @@ Note:
26. Union : Return a set that is the union of the input sets. Repeated value within list(argument) will be ignored
27. Union<struct>By<Field>
```

### Method chain functionality for Basic type as well as struct -
#### Map, Filter, Sort, Distinct, Reverse, DropWhile, TakeWhile, Remove
#### Examples
```go
// Use MakeIntSlicePtr for pointer version
r := fp.MakeIntSlice([]int{3, 2, 1}...).
Filter(odd).
Map(square).
Sort()
fmt.Println(r) // [1 9]

func odd (num int) bool {
return num % 2 != 0
}
func square(num int) int {
return num * num
}

```

### Contains functions
```
Takes list as argument and returns Distinct list. Returns empty list if 2nd parameter is empty or nil
Expand Down
Empty file modified fp/benchmark_test.go
100644 → 100755
Empty file.
Empty file modified fp/bool.go
100644 → 100755
Empty file.
Empty file modified fp/bool_test.go
100644 → 100755
Empty file.
Empty file modified fp/dedupe.go
100644 → 100755
Empty file.
Empty file modified fp/dedupe_test.go
100644 → 100755
Empty file.
Loading

0 comments on commit ddc2c53

Please sign in to comment.