1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-23 22:14:53 +02:00
Files
fp-go/v2
Dr. Carsten Leue 8e7fc699a1 fix: some performance optimizations
Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
2025-11-05 16:55:19 +01:00
..
2025-11-05 16:55:19 +01:00
2025-03-01 23:07:56 +01:00
2025-03-05 17:30:23 +01:00
2025-03-06 18:17:29 +01:00
2025-03-01 23:07:56 +01:00
2025-03-08 00:00:43 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-10 00:06:07 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-10 00:06:07 +01:00
2025-03-10 00:06:07 +01:00
2025-03-06 18:17:29 +01:00
2025-03-04 23:45:48 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-02 10:57:52 +01:00
2025-03-01 23:07:56 +01:00
2025-03-08 15:25:32 +01:00
2025-11-05 16:00:54 +01:00
2025-03-01 23:07:56 +01:00
2025-03-10 00:06:07 +01:00
2025-03-05 17:30:23 +01:00
2025-03-08 00:00:43 +01:00
2025-03-06 18:17:29 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-08 15:25:32 +01:00
2025-03-06 19:08:59 +01:00
2025-03-08 15:25:32 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-01 23:07:56 +01:00
2025-03-10 00:06:07 +01:00

Functional programming library for golang V2

Go 1.24 introduces generic type aliases which are leveraged by V2.

⚠️ Breaking Changes

  • use of generic type aliases which requires go1.24
  • order of generic type arguments adjusted such that types that cannot be inferred by the method argument come first, e.g. in the Ap methods
  • monadic operations for Pair operate on the second argument, to be compatible with the Haskell definition

Simplifications

  • use type aliases to get rid of namespace imports for type declarations, e.g. instead of
import (
    ET "github.com/IBM/fp-go/v2/either"
)

func doSth() ET.Either[error, string] {
    ...
}

you can declare your type once

import (
    "github.com/IBM/fp-go/v2/either"
)

type Either[A any] = either.Either[error, A]

and then use it across your codebase

func doSth() Either[string] {
    ...
}
  • library implementation does no longer need to use the generic subpackage, this simplifies reading and understanding of the code