mirror of
https://github.com/duke-git/lancet.git
synced 2026-02-04 12:52:28 +08:00
add playground demo
This commit is contained in:
@@ -47,7 +47,7 @@ func Before(n int, fn any) func(args ...any) []reflect.Value {
|
||||
type CurryFn[T any] func(...T) T
|
||||
|
||||
// New make a curry function for specific value.
|
||||
// Play: Todo
|
||||
// Play: https://go.dev/play/p/5HopfDwANKX
|
||||
func (cf CurryFn[T]) New(val T) func(...T) T {
|
||||
return func(vals ...T) T {
|
||||
args := append([]T{val}, vals...)
|
||||
@@ -56,7 +56,7 @@ func (cf CurryFn[T]) New(val T) func(...T) T {
|
||||
}
|
||||
|
||||
// Compose compose the functions from right to left.
|
||||
// Play: Todo
|
||||
// Play: https://go.dev/play/p/KKfugD4PKYF
|
||||
func Compose[T any](fnList ...func(...T) T) func(...T) T {
|
||||
return func(args ...T) T {
|
||||
firstFn := fnList[0]
|
||||
|
||||
@@ -3,7 +3,7 @@ package function
|
||||
import "time"
|
||||
|
||||
// Watcher is used for record code excution time
|
||||
// Play: Todo
|
||||
// Play: https://go.dev/play/p/l2yrOpCLd1I
|
||||
type Watcher struct {
|
||||
startTime int64
|
||||
stopTime int64
|
||||
|
||||
Reference in New Issue
Block a user