1
0
mirror of https://github.com/IBM/fp-go.git synced 2025-11-23 22:14:53 +02:00

fix: add more examples

Signed-off-by: Dr. Carsten Leue <carsten.leue@de.ibm.com>
This commit is contained in:
Dr. Carsten Leue
2023-09-05 22:51:46 +02:00
parent 5d77d5bb3d
commit 52b71ef4f3
4 changed files with 245 additions and 13 deletions

View File

@@ -20,7 +20,7 @@ import (
"strings"
F "github.com/IBM/fp-go/function"
O "github.com/IBM/fp-go/ord"
"github.com/IBM/fp-go/ord"
)
var (
@@ -31,7 +31,7 @@ var (
ToLowerCase = strings.ToLower
// Ord implements the default ordering for strings
Ord = O.FromStrictCompare[string]()
Ord = ord.FromStrictCompare[string]()
)
func Eq(left string, right string) bool {
@@ -42,6 +42,10 @@ func ToBytes(s string) []byte {
return []byte(s)
}
func ToRunes(s string) []rune {
return []rune(s)
}
func IsEmpty(s string) bool {
return len(s) == 0
}