Skip to content
This repository has been archived by the owner on Jul 8, 2020. It is now read-only.

grosenberg/enum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go Rich Enums

Concise, expressive implementation of rich enums in Go.

A singleton generic base implementation that provides all essential enum behaviors, including global uniqueness and mutual-comparability. Rich enum sets are realized effectively as separate type-specializations of the generic base. These type-specializations are minimal and can be easily implemented in one or more user packages.

Rich enums can encapsulate any number of custom member fields and corresponding functions. Rich enums are type-safe, immutable, and globally unique. Within a defined enum set, the enums are mutually comparable; enums from different sets are incomparable.

Part of the Go Generics proof-of-concept packages: Collections Generic Maths & Rich Enums .

Documentation

Rich enums uses a variant of the Go generics pattern.

For a summary of the Go generics pattern, see the [Go Generics](https://github.com/grosenberg/maths/Go Generics.md) file.

License

Copyright © 2015 Gerald Rosenberg.

Use of this source code is governed by a BSD-style license that can be found in the License.md file.

About

Concise, expressive implementation of rich enums in Go.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages