Hacker Newsnew | past | comments | ask | show | jobs | submit | BooleanCat_'s commentslogin

I've been working on a library that allows folks to write code in a more functional-like manner. Most of the ideas are taken from Rust's `Option`, `Result` and `Iterator` packages so should looks familiar to Rustaceans.

You can do things like "find all even natural numbers":

  // All even natural numbers (2, 4, 6, 8...)
  isEven := func(n int) bool { return n%2 == 0 }
  evens := iter.Filter[int](iter.Drop[int](iter.Count(), 1), isEven)
I'm aware that this style is very divisive in the Go community :D

Edit: formatting


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: