Skip to content

icholy/higher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Higher Build Status

Higher order functions in Go (really unsafe). You probably shouldn't use this.

godoc

Examples

s1 := []int{1, 2, 3, 4, 5}
s2 := higher.Filter(s1, func(x int) bool { return x > 2 })
s3 := higher.Map(s, strconv.Itoa).([]string)

You can chain them too.

s := higher.Wrap([]int{1, 2, 3, 4, 5}).
        Filter(func(x int) bool { return x > 2 }).
        PMap(strconv.Itoa).
        Tap(fmt.Println).
        Val().([]string)

Available functions:

  • Map
  • PMap
  • Filter
  • PFilter
  • Reduce reduce can't be parallel
  • ForEach
  • PForEach
  • Tap
  • PTap
  • Any
  • PAny
  • Every
  • PEvery
  • Contains
  • PContains
  • Find
  • PFind

Chaining

  • Wrap
  • Val

About

Higher order functions for Go

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages