package generic

import "github.com/IBM/fp-go/optics/lens/array/generic"

Index

Functions

func AtHead

func AtHead[AS []A, A any]() L.Lens[AS, O.Option[A]]

AtHead focusses on the head of an array. The setter works as follows - if the new value is none, the result will be an empty array - if the new value is some and the array is empty, it creates a new array with one element - if the new value is some and the array is not empty, it replaces the head

Source Files

head.go

Version
v1.0.151 (latest)
Published
Nov 23, 2024
Platform
linux/amd64
Imports
3 packages
Last checked
4 months ago

Tools for package owners.