go-immutable

module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: MPL-2.0

README

go-immutable

Build Status Go Report Card PkgGoDev

This library contains functions to operate on Go types in a generic and immutable way. Most of the overall behavior exists in the standard library as mutating functions already and you should really only use this library if you specifically require the immutability guarantees.

See it in action:

package foo

import (
   "slices"
   
   "github.com/mkeeler/go-immutable/immutableslice"
)

func FindAndRemove(s []int, v int) []int {
   idx := slices.Index(s, v)
   return immutableslice.Delete(s, idx, idx+1)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL