{"repo":"elliotchance/pie","free":true,"listed":false,"github":"https://github.com/elliotchance/pie","clone":"git clone https://github.com/elliotchance/pie.git","description":"🍕 Enjoy a slice! A utility library for dealing with slices and maps that focuses on type safety and performance.","language":"Go","stars":2037,"topics":["golang","go","utility","slices","generics"],"license":"MIT","category":"dev-tools","readme_excerpt":"🍕 github.com/elliotchance/pie Enjoy a slice! pie is a library of utility functions for common operations on slices and maps. - Quick Start - FAQ What are the requirements? What are the goals of pie ? How do I contribute a function? Why is the emoji a slice of pizza instead of a pie? Quick Start If you are using (or require) Go 1.17 or below, you will have to use v1. pie can be used in two ways, the first is to use the regular parameterized functions: Run this program Or, if you need to chain multiple operations you can use one of: - pie.Of - works with any element type, but functions are limited. - pie.OfOrdered - only works with numbers and strings, but has more functions. - pie.OfNumeric - only works with numbers, but has all functions. Run this program You can find the full documentation here. FAQ What are the requirements? pie v2 only supports Go 1.18+. If you have an older version you can use v1. What are the goals of pie ? 1. Type safety. I never want to hit runtime bugs because I could pass in the wrong type, or perform an invalid type case out the other end. 2. Performance. The functions need to be as fast as native Go implementations otherwise there's no point in this library existing. 3. Nil-safe. All of the functions will happily accept nil and treat them as empty slices. Apart from less possible panics, it makes it easier to chain. 4. Immutable. Functions never modify inputs (except in cases where it would be illogical), unlike some built-ins such as sort.Strings","default_branch":null,"files":null,"tree":[],"storefront":"/r/elliotchance","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/elliotchance/pie/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}