-
Notifications
You must be signed in to change notification settings - Fork 0
Comparable GOST for GOPL
License
syntelos/go-sort
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Comparable GOST for GOPL type Ordered interface func Ascending[T Ordered](array []T) ([]T) { func Descending[T Ordered](array []T) ([]T) { Review A "traditional" abstraction type Comparable interface func Sort(array []Comparable) ([]Comparable) fails syntactically. go test # github.com/syntelos/go-sort [github.com/syntelos/go-sort.test] ./sort_test.go:61:7: cannot use vector (variable of type TestList) as []Comparable value in argument to Sort FAIL github.com/syntelos/go-sort [build failed] The dynamical semantics required are available via parametric type abstraction, represented by the "Ordered" interface found in [MERO]. Note Bene The definition provided currently is a test of conception. type Ordered interface { ~int | ~uint | ~string } References [GOST] http://pkg.go.dev/sort [MERO] https://blog.merovius.de/posts/2024-01-05_constraining_complexity/
About
Comparable GOST for GOPL
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published