sort

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package sort provides sorting in place slice elements

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Asc added in v0.0.11

func Asc[T constraints.Ordered, TS ~[]T](elements TS) TS

Asc sorts orderable elements ascending

func By added in v0.0.6

func By[T any, O constraints.Ordered, TS ~[]T](elements TS, orderConverter func(T) O) TS

By sorts elements in ascending order, using the orderConverner function to retrieve a value of type Ordered.

func Desc added in v0.0.11

func Desc[T constraints.Ordered, TS ~[]T](elements TS) TS

Desc sorts orderable elements descending

func DescBy added in v0.0.11

func DescBy[T any, O constraints.Ordered, TS ~[]T](elements TS, orderConverter func(T) O) TS

DescBy sorts elements in descending order, using the orderConverner function to retrieve a value of type Ordered.

Types

This section is empty.

Directories

Path Synopsis
Package asc provides aliases for storing slice functions.
Package asc provides aliases for storing slice functions.
Package desc provides aliases for storing slice functions.
Package desc provides aliases for storing slice functions.

Jump to

Keyboard shortcuts

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