Documentation
¶
Overview ¶
This package defines several widget types that allow logic for certian common operations to be passed arround as state.
Index ¶
- Variables
- type Arith
- func (w *Arith[T, I]) Add(res *T, l *T, r *T)
- func (w *Arith[T, I]) Div(res *T, l *T, r *T)
- func (w *Arith[T, I]) Mul(res *T, l *T, r *T)
- func (w *Arith[T, I]) Neg(v *T)
- func (w *Arith[T, I]) Neq(l *T, r *T) bool
- func (w *Arith[T, I]) Sub(res *T, l *T, r *T)
- func (w *Arith[T, I]) UnitVal() T
- func (w *Arith[T, I]) ZeroVal() T
- type ArithInterface
- type ArithPntr
- func (p ArithPntr[T, I]) Add(res **T, l **T, r **T)
- func (p ArithPntr[T, I]) Div(res **T, l **T, r **T)
- func (p ArithPntr[T, I]) Eq(l **T, r **T) bool
- func (p ArithPntr[T, I]) Hash(other **T) hash.Hash
- func (p ArithPntr[T, I]) Mul(res **T, l **T, r **T)
- func (p ArithPntr[T, I]) Neg(v **T)
- func (p ArithPntr[T, I]) Sub(res **T, l **T, r **T)
- func (p ArithPntr[T, I]) UnitVal() *T
- func (p ArithPntr[T, I]) Zero(other **T)
- func (p ArithPntr[T, I]) ZeroVal() *T
- type Base
- type BaseInterface
- type BasePntr
- type BuiltinBool
- type BuiltinByte
- func (_ BuiltinByte) Add(res *byte, l *byte, r *byte)
- func (_ BuiltinByte) Div(res *byte, l *byte, r *byte)
- func (_ BuiltinByte) Eq(l *byte, r *byte) bool
- func (_ BuiltinByte) Hash(v *byte) hash.Hash
- func (_ BuiltinByte) Lt(l *byte, r *byte) bool
- func (_ BuiltinByte) Mul(res *byte, l *byte, r *byte)
- func (_ BuiltinByte) Neg(v *byte)
- func (_ BuiltinByte) Sub(res *byte, l *byte, r *byte)
- func (_ BuiltinByte) UnitVal() byte
- func (_ BuiltinByte) Zero(other *byte)
- func (_ BuiltinByte) ZeroVal() byte
- type BuiltinComplex128
- func (_ BuiltinComplex128) Add(res *complex128, l *complex128, r *complex128)
- func (_ BuiltinComplex128) Div(res *complex128, l *complex128, r *complex128)
- func (_ BuiltinComplex128) Eq(l *complex128, r *complex128) bool
- func (_ BuiltinComplex128) Hash(v *complex128) hash.Hash
- func (_ BuiltinComplex128) Mul(res *complex128, l *complex128, r *complex128)
- func (_ BuiltinComplex128) Neg(v *complex128)
- func (_ BuiltinComplex128) Sub(res *complex128, l *complex128, r *complex128)
- func (_ BuiltinComplex128) UnitVal() complex128
- func (_ BuiltinComplex128) Zero(other *complex128)
- func (_ BuiltinComplex128) ZeroVal() complex128
- type BuiltinComplex64
- func (_ BuiltinComplex64) Add(res *complex64, l *complex64, r *complex64)
- func (_ BuiltinComplex64) Div(res *complex64, l *complex64, r *complex64)
- func (_ BuiltinComplex64) Eq(l *complex64, r *complex64) bool
- func (_ BuiltinComplex64) Hash(v *complex64) hash.Hash
- func (_ BuiltinComplex64) Mul(res *complex64, l *complex64, r *complex64)
- func (_ BuiltinComplex64) Neg(v *complex64)
- func (_ BuiltinComplex64) Sub(res *complex64, l *complex64, r *complex64)
- func (_ BuiltinComplex64) UnitVal() complex64
- func (_ BuiltinComplex64) Zero(other *complex64)
- func (_ BuiltinComplex64) ZeroVal() complex64
- type BuiltinFloat32
- func (_ BuiltinFloat32) Add(res *float32, l *float32, r *float32)
- func (_ BuiltinFloat32) Div(res *float32, l *float32, r *float32)
- func (_ BuiltinFloat32) Eq(l *float32, r *float32) bool
- func (_ BuiltinFloat32) Hash(v *float32) hash.Hash
- func (_ BuiltinFloat32) Lt(l *float32, r *float32) bool
- func (_ BuiltinFloat32) Mul(res *float32, l *float32, r *float32)
- func (_ BuiltinFloat32) Neg(v *float32)
- func (_ BuiltinFloat32) Sub(res *float32, l *float32, r *float32)
- func (_ BuiltinFloat32) UnitVal() float32
- func (_ BuiltinFloat32) Zero(other *float32)
- func (_ BuiltinFloat32) ZeroVal() float32
- type BuiltinFloat64
- func (_ BuiltinFloat64) Add(res *float64, l *float64, r *float64)
- func (_ BuiltinFloat64) Div(res *float64, l *float64, r *float64)
- func (_ BuiltinFloat64) Eq(l *float64, r *float64) bool
- func (_ BuiltinFloat64) Hash(v *float64) hash.Hash
- func (_ BuiltinFloat64) Lt(l *float64, r *float64) bool
- func (_ BuiltinFloat64) Mul(res *float64, l *float64, r *float64)
- func (_ BuiltinFloat64) Neg(v *float64)
- func (_ BuiltinFloat64) Sub(res *float64, l *float64, r *float64)
- func (_ BuiltinFloat64) UnitVal() float64
- func (_ BuiltinFloat64) Zero(other *float64)
- func (_ BuiltinFloat64) ZeroVal() float64
- type BuiltinHash
- func (_ BuiltinHash) Add(res *hash.Hash, l *hash.Hash, r *hash.Hash)
- func (_ BuiltinHash) Div(res *hash.Hash, l *hash.Hash, r *hash.Hash)
- func (_ BuiltinHash) Eq(l *hash.Hash, r *hash.Hash) bool
- func (_ BuiltinHash) Hash(v *hash.Hash) hash.Hash
- func (_ BuiltinHash) Lt(l *hash.Hash, r *hash.Hash) bool
- func (_ BuiltinHash) Mul(res *hash.Hash, l *hash.Hash, r *hash.Hash)
- func (_ BuiltinHash) Neg(v *hash.Hash)
- func (_ BuiltinHash) Sub(res *hash.Hash, l *hash.Hash, r *hash.Hash)
- func (_ BuiltinHash) UnitVal() hash.Hash
- func (_ BuiltinHash) Zero(other *hash.Hash)
- func (_ BuiltinHash) ZeroVal() hash.Hash
- type BuiltinInt
- func (_ BuiltinInt) Add(res *int, l *int, r *int)
- func (_ BuiltinInt) Div(res *int, l *int, r *int)
- func (_ BuiltinInt) Eq(l *int, r *int) bool
- func (_ BuiltinInt) Hash(v *int) hash.Hash
- func (_ BuiltinInt) Lt(l *int, r *int) bool
- func (_ BuiltinInt) Mul(res *int, l *int, r *int)
- func (_ BuiltinInt) Neg(v *int)
- func (_ BuiltinInt) Sub(res *int, l *int, r *int)
- func (_ BuiltinInt) UnitVal() int
- func (_ BuiltinInt) Zero(other *int)
- func (_ BuiltinInt) ZeroVal() int
- type BuiltinInt16
- func (_ BuiltinInt16) Add(res *int16, l *int16, r *int16)
- func (_ BuiltinInt16) Div(res *int16, l *int16, r *int16)
- func (_ BuiltinInt16) Eq(l *int16, r *int16) bool
- func (_ BuiltinInt16) Hash(v *int16) hash.Hash
- func (_ BuiltinInt16) Lt(l *int16, r *int16) bool
- func (_ BuiltinInt16) Mul(res *int16, l *int16, r *int16)
- func (_ BuiltinInt16) Neg(v *int16)
- func (_ BuiltinInt16) Sub(res *int16, l *int16, r *int16)
- func (_ BuiltinInt16) UnitVal() int16
- func (_ BuiltinInt16) Zero(other *int16)
- func (_ BuiltinInt16) ZeroVal() int16
- type BuiltinInt32
- func (_ BuiltinInt32) Add(res *int32, l *int32, r *int32)
- func (_ BuiltinInt32) Div(res *int32, l *int32, r *int32)
- func (_ BuiltinInt32) Eq(l *int32, r *int32) bool
- func (_ BuiltinInt32) Hash(v *int32) hash.Hash
- func (_ BuiltinInt32) Lt(l *int32, r *int32) bool
- func (_ BuiltinInt32) Mul(res *int32, l *int32, r *int32)
- func (_ BuiltinInt32) Neg(v *int32)
- func (_ BuiltinInt32) Sub(res *int32, l *int32, r *int32)
- func (_ BuiltinInt32) UnitVal() int32
- func (_ BuiltinInt32) Zero(other *int32)
- func (_ BuiltinInt32) ZeroVal() int32
- type BuiltinInt64
- func (_ BuiltinInt64) Add(res *int64, l *int64, r *int64)
- func (_ BuiltinInt64) Div(res *int64, l *int64, r *int64)
- func (_ BuiltinInt64) Eq(l *int64, r *int64) bool
- func (_ BuiltinInt64) Hash(v *int64) hash.Hash
- func (_ BuiltinInt64) Lt(l *int64, r *int64) bool
- func (_ BuiltinInt64) Mul(res *int64, l *int64, r *int64)
- func (_ BuiltinInt64) Neg(v *int64)
- func (_ BuiltinInt64) Sub(res *int64, l *int64, r *int64)
- func (_ BuiltinInt64) UnitVal() int64
- func (_ BuiltinInt64) Zero(other *int64)
- func (_ BuiltinInt64) ZeroVal() int64
- type BuiltinInt8
- func (_ BuiltinInt8) Add(res *int8, l *int8, r *int8)
- func (_ BuiltinInt8) Div(res *int8, l *int8, r *int8)
- func (_ BuiltinInt8) Eq(l *int8, r *int8) bool
- func (_ BuiltinInt8) Hash(v *int8) hash.Hash
- func (_ BuiltinInt8) Lt(l *int8, r *int8) bool
- func (_ BuiltinInt8) Mul(res *int8, l *int8, r *int8)
- func (_ BuiltinInt8) Neg(v *int8)
- func (_ BuiltinInt8) Sub(res *int8, l *int8, r *int8)
- func (_ BuiltinInt8) UnitVal() int8
- func (_ BuiltinInt8) Zero(other *int8)
- func (_ BuiltinInt8) ZeroVal() int8
- type BuiltinString
- type BuiltinUint
- func (_ BuiltinUint) Add(res *uint, l *uint, r *uint)
- func (_ BuiltinUint) Div(res *uint, l *uint, r *uint)
- func (_ BuiltinUint) Eq(l *uint, r *uint) bool
- func (_ BuiltinUint) Hash(v *uint) hash.Hash
- func (_ BuiltinUint) Lt(l *uint, r *uint) bool
- func (_ BuiltinUint) Mul(res *uint, l *uint, r *uint)
- func (_ BuiltinUint) Neg(v *uint)
- func (_ BuiltinUint) Sub(res *uint, l *uint, r *uint)
- func (_ BuiltinUint) UnitVal() uint
- func (_ BuiltinUint) Zero(other *uint)
- func (_ BuiltinUint) ZeroVal() uint
- type BuiltinUint16
- func (_ BuiltinUint16) Add(res *uint16, l *uint16, r *uint16)
- func (_ BuiltinUint16) Div(res *uint16, l *uint16, r *uint16)
- func (_ BuiltinUint16) Eq(l *uint16, r *uint16) bool
- func (_ BuiltinUint16) Hash(v *uint16) hash.Hash
- func (_ BuiltinUint16) Lt(l *uint16, r *uint16) bool
- func (_ BuiltinUint16) Mul(res *uint16, l *uint16, r *uint16)
- func (_ BuiltinUint16) Neg(v *uint16)
- func (_ BuiltinUint16) Sub(res *uint16, l *uint16, r *uint16)
- func (_ BuiltinUint16) UnitVal() uint16
- func (_ BuiltinUint16) Zero(other *uint16)
- func (_ BuiltinUint16) ZeroVal() uint16
- type BuiltinUint32
- func (_ BuiltinUint32) Add(res *uint32, l *uint32, r *uint32)
- func (_ BuiltinUint32) Div(res *uint32, l *uint32, r *uint32)
- func (_ BuiltinUint32) Eq(l *uint32, r *uint32) bool
- func (_ BuiltinUint32) Hash(v *uint32) hash.Hash
- func (_ BuiltinUint32) Lt(l *uint32, r *uint32) bool
- func (_ BuiltinUint32) Mul(res *uint32, l *uint32, r *uint32)
- func (_ BuiltinUint32) Neg(v *uint32)
- func (_ BuiltinUint32) Sub(res *uint32, l *uint32, r *uint32)
- func (_ BuiltinUint32) UnitVal() uint32
- func (_ BuiltinUint32) Zero(other *uint32)
- func (_ BuiltinUint32) ZeroVal() uint32
- type BuiltinUint64
- func (_ BuiltinUint64) Add(res *uint64, l *uint64, r *uint64)
- func (_ BuiltinUint64) Div(res *uint64, l *uint64, r *uint64)
- func (_ BuiltinUint64) Eq(l *uint64, r *uint64) bool
- func (_ BuiltinUint64) Hash(v *uint64) hash.Hash
- func (_ BuiltinUint64) Lt(l *uint64, r *uint64) bool
- func (_ BuiltinUint64) Mul(res *uint64, l *uint64, r *uint64)
- func (_ BuiltinUint64) Neg(v *uint64)
- func (_ BuiltinUint64) Sub(res *uint64, l *uint64, r *uint64)
- func (_ BuiltinUint64) UnitVal() uint64
- func (_ BuiltinUint64) Zero(other *uint64)
- func (_ BuiltinUint64) ZeroVal() uint64
- type BuiltinUint8
- func (_ BuiltinUint8) Add(res *uint8, l *uint8, r *uint8)
- func (_ BuiltinUint8) Div(res *uint8, l *uint8, r *uint8)
- func (_ BuiltinUint8) Eq(l *uint8, r *uint8) bool
- func (_ BuiltinUint8) Hash(v *uint8) hash.Hash
- func (_ BuiltinUint8) Lt(l *uint8, r *uint8) bool
- func (_ BuiltinUint8) Mul(res *uint8, l *uint8, r *uint8)
- func (_ BuiltinUint8) Neg(v *uint8)
- func (_ BuiltinUint8) Sub(res *uint8, l *uint8, r *uint8)
- func (_ BuiltinUint8) UnitVal() uint8
- func (_ BuiltinUint8) Zero(other *uint8)
- func (_ BuiltinUint8) ZeroVal() uint8
- type BuiltinUintptr
- func (_ BuiltinUintptr) Add(res *uintptr, l *uintptr, r *uintptr)
- func (_ BuiltinUintptr) Div(res *uintptr, l *uintptr, r *uintptr)
- func (_ BuiltinUintptr) Eq(l *uintptr, r *uintptr) bool
- func (_ BuiltinUintptr) Hash(v *uintptr) hash.Hash
- func (_ BuiltinUintptr) Lt(l *uintptr, r *uintptr) bool
- func (_ BuiltinUintptr) Mul(res *uintptr, l *uintptr, r *uintptr)
- func (_ BuiltinUintptr) Neg(v *uintptr)
- func (_ BuiltinUintptr) Sub(res *uintptr, l *uintptr, r *uintptr)
- func (_ BuiltinUintptr) UnitVal() uintptr
- func (_ BuiltinUintptr) Zero(other *uintptr)
- func (_ BuiltinUintptr) ZeroVal() uintptr
- type NilWidget
- type PartialOrder
- type PartialOrderArith
- func (w *PartialOrderArith[T, I]) Add(res *T, l *T, r *T)
- func (w *PartialOrderArith[T, I]) Div(res *T, l *T, r *T)
- func (w *PartialOrderArith[T, I]) Gt(l *T, r *T) bool
- func (w *PartialOrderArith[T, I]) Gte(l *T, r *T) bool
- func (w *PartialOrderArith[T, I]) Lt(l *T, r *T) bool
- func (w *PartialOrderArith[T, I]) Lte(l *T, r *T) bool
- func (w *PartialOrderArith[T, I]) Mul(res *T, l *T, r *T)
- func (w *PartialOrderArith[T, I]) Neg(v *T)
- func (w *PartialOrderArith[T, I]) Neq(l *T, r *T) bool
- func (w *PartialOrderArith[T, I]) Sub(res *T, l *T, r *T)
- func (w *PartialOrderArith[T, I]) UnitVal() T
- func (w *PartialOrderArith[T, I]) ZeroVal() T
- type PartialOrderArithInterface
- type PartialOrderArithPntr
- func (p PartialOrderArithPntr[T, I]) Add(res **T, l **T, r **T)
- func (p PartialOrderArithPntr[T, I]) Div(res **T, l **T, r **T)
- func (p PartialOrderArithPntr[T, I]) Eq(l **T, r **T) bool
- func (p PartialOrderArithPntr[T, I]) Hash(other **T) hash.Hash
- func (p PartialOrderArithPntr[T, I]) Lt(l **T, r **T) bool
- func (p PartialOrderArithPntr[T, I]) Mul(res **T, l **T, r **T)
- func (p PartialOrderArithPntr[T, I]) Neg(v **T)
- func (p PartialOrderArithPntr[T, I]) Sub(res **T, l **T, r **T)
- func (p PartialOrderArithPntr[T, I]) UnitVal() *T
- func (p PartialOrderArithPntr[T, I]) Zero(other **T)
- func (p PartialOrderArithPntr[T, I]) ZeroVal() *T
- type PartialOrderInterface
- type PartialOrderPntr
- type ZeroStructWidget
Examples ¶
Constants ¶
This section is empty.
Variables ¶
var ( // The random seed will be different every time the program runs // meaning that between runs the hash values will not be consistent. // This was done for security purposes. RANDOM_SEED_STRING maphash.Seed = maphash.MakeSeed() )
Functions ¶
This section is empty.
Types ¶
type Arith ¶
type Arith[T any, I ArithInterface[T]] struct { Base[T, I] }
A concrete arithmitic widget. Internally, this struct will create an interface value of type ArithInterface that points to nil data. All methods on widget are then very thin pass through functions that call the needed methods on the interface value with the supplied values.
Example ¶
v1, v2 := 0, -1
res := 0
w := Arith[int, BuiltinInt]{}
fmt.Println("ZeroVal:", w.ZeroVal())
fmt.Println("UnitVal:", w.UnitVal())
w.Neg(&v2)
fmt.Println("Neg:", v2)
w.Add(&res, &v1, &v2)
fmt.Println("Add:", res)
w.Mul(&res, &v1, &v2)
fmt.Println("Mul:", res)
Output: ZeroVal: 0 UnitVal: 1 Neg: 1 Add: 1 Mul: 0
func (*Arith[T, I]) Add ¶
func (w *Arith[T, I]) Add(res *T, l *T, r *T)
Adds the supplied values using the function from the interface that was supplied as a generic type.
func (*Arith[T, I]) Div ¶
func (w *Arith[T, I]) Div(res *T, l *T, r *T)
Divides the supplied values using the function from the interface that was supplied as a generic type.
func (*Arith[T, I]) Mul ¶
func (w *Arith[T, I]) Mul(res *T, l *T, r *T)
Multiplies the supplied values using the function from the interface that was supplied as a generic type.
func (*Arith[T, I]) Neg ¶
func (w *Arith[T, I]) Neg(v *T)
Negates the supplied value using the function from the interface that was supplied as a generic type.
func (*Arith[T, I]) Neq ¶
func (w *Arith[T, I]) Neq(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l!=r using the Eq function from the interface that was supplied as a generic type.
func (*Arith[T, I]) Sub ¶
func (w *Arith[T, I]) Sub(res *T, l *T, r *T)
Subtracts the supplied values using the function from the interface that was supplied as a generic type.
type ArithInterface ¶
type ArithInterface[T any] interface { BaseInterface[T] // Returns the value that represents "zero" for the underlying type. ZeroVal() T // Returns the value that represent "1" for the underlying type. UnitVal() T // Negates the value that is supplied to it. Neg(v *T) // Adds l and r and places the results in res. No uniqueness guarantees // are placed on res, l, and r. They may all be the same value. The // implementation of this interface needs to recognize this. Add(res *T, l *T, r *T) // Subtracts l and r and places the results in res. No uniqueness // guarantees are placed on res, l, and r. They may all be the same // value. The implementation of this interface needs to recognize this. Sub(res *T, l *T, r *T) // Multiplies l and r and places the results in res. No uniqueness // guarantees are placed on res, l, and r. They may all be the same // value. The implementation of this interface needs to recognize this. Mul(res *T, l *T, r *T) // Divides l and r and places the results in res. No uniqueness // guarantees are placed on res, l, and r. They may all be the same // value. The implementation of this interface needs to recognize this. Div(res *T, l *T, r *T) }
The interface that defines what it means to be a widget that can do basic arithmetic. Implementations of this interface are expected to hold no state that pertains to the widget functions as the methods will not be called in any predetermined order.
type ArithPntr ¶
type ArithPntr[T any, I ArithInterface[T]] struct { // contains filtered or unexported fields }
A pass through widget that represents a pointer to an underlying type that is an arith widget. This is useful for when you need a widget for a pointer. Consider a *int that you need an arith widget for. The ArithPntr struct would be used like this:
ArithPntr[int, widgets.BuiltinInt]
type Base ¶
type Base[T any, I BaseInterface[T]] struct { // contains filtered or unexported fields }
A concrete base widget. Internally, this struct will create an interface value of type BaseInterface that points to nil data. All methods on widget are then very thin pass through functions that call the needed methods on the interface value with the supplied values.
Example ¶
v1, v2 := 0, 1
w := Base[int, BuiltinInt]{}
fmt.Println("Equality:", w.Eq(&v1, &v2))
fmt.Println("Hash:", w.Hash(&v2))
w.Zero(&v2)
fmt.Println("Zeroed:", v2)
Output: Equality: false Hash: 1 Zeroed: 0
func (*Base[T, I]) Eq ¶
func (w *Base[T, I]) Eq(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l==r using the Eq function from the interface that was supplied as a generic type.
func (*Base[T, I]) Hash ¶
Generates a hash for the given value using the hash function from the interface that was supplied as a generic type.
type BaseInterface ¶
type BaseInterface[T any] interface { // A function that should return true if the current value equals other. Eq(l *T, r *T) bool // Returns a hash value that represent the currently wrapped value. Hash(v *T) hash.Hash // Zero's the supplied value. Equivalent to a destructor except Go does // not have manual memory management so this is mainly just to prevent // things like dangling pointers. Zero(v *T) }
The interface that defines what it means to be a widget. Implementations of this interface are expected to hold no state that pertains to the widget functions as the methods shown below will not be called in any predetermined order.
type BasePntr ¶
type BasePntr[T any, I BaseInterface[T]] struct { // contains filtered or unexported fields }
A pass through widget that represents a pointer to an underlying type that is a base widget. This is useful for when you need a widget for a pointer. Consider a *int that you need a base widget for. The BasePntr struct would be used like this:
BasePntr[int, widgets.BuiltinInt]
type BuiltinBool ¶
type BuiltinBool struct{}
A widget to represent the built-in bool type
func (BuiltinBool) Eq ¶
func (_ BuiltinBool) Eq(l *bool, r *bool) bool
Returns true if both bool's are equal. Uses the standard == operator internally.
type BuiltinByte ¶
type BuiltinByte struct{}
A widget to represent the built-in byte type
func (BuiltinByte) Add ¶
func (_ BuiltinByte) Add(res *byte, l *byte, r *byte)
Adds l to r, placing the result in the value that res points to.
func (BuiltinByte) Div ¶
func (_ BuiltinByte) Div(res *byte, l *byte, r *byte)
Divides l to r, placing the result in the value that res points to.
func (BuiltinByte) Eq ¶
func (_ BuiltinByte) Eq(l *byte, r *byte) bool
Returns true if both byte's are equal. Uses the standard == operator internally.
func (BuiltinByte) Hash ¶
func (_ BuiltinByte) Hash(v *byte) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinByte) Lt ¶
func (_ BuiltinByte) Lt(l *byte, r *byte) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinByte) Mul ¶
func (_ BuiltinByte) Mul(res *byte, l *byte, r *byte)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinByte) Neg ¶
func (_ BuiltinByte) Neg(v *byte)
Negates v, updating the value that v points to.
func (BuiltinByte) Sub ¶
func (_ BuiltinByte) Sub(res *byte, l *byte, r *byte)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinByte) UnitVal ¶
func (_ BuiltinByte) UnitVal() byte
Returns the unit value for the byte type.
func (BuiltinByte) ZeroVal ¶
func (_ BuiltinByte) ZeroVal() byte
Returns the zero value for the byte type.
type BuiltinComplex128 ¶
type BuiltinComplex128 struct{}
A widget to represent the built-in complex128 type
func (BuiltinComplex128) Add ¶
func (_ BuiltinComplex128) Add(res *complex128, l *complex128, r *complex128)
Adds l to r, placing the result in the value that res points to.
func (BuiltinComplex128) Div ¶
func (_ BuiltinComplex128) Div(res *complex128, l *complex128, r *complex128)
Divides l to r, placing the result in the value that res points to.
func (BuiltinComplex128) Eq ¶
func (_ BuiltinComplex128) Eq(l *complex128, r *complex128) bool
Returns true if both complex128's are equal. Uses the standard == operator internally.
func (BuiltinComplex128) Hash ¶
func (_ BuiltinComplex128) Hash(v *complex128) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinComplex128) Mul ¶
func (_ BuiltinComplex128) Mul(res *complex128, l *complex128, r *complex128)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinComplex128) Neg ¶
func (_ BuiltinComplex128) Neg(v *complex128)
Negates v, updating the value that v points to.
func (BuiltinComplex128) Sub ¶
func (_ BuiltinComplex128) Sub(res *complex128, l *complex128, r *complex128)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinComplex128) UnitVal ¶
func (_ BuiltinComplex128) UnitVal() complex128
Returns the unit value for the complex128 type.
func (BuiltinComplex128) Zero ¶
func (_ BuiltinComplex128) Zero(other *complex128)
Zeros the supplied value.
func (BuiltinComplex128) ZeroVal ¶
func (_ BuiltinComplex128) ZeroVal() complex128
Returns the zero value for the complex128 type.
type BuiltinComplex64 ¶
type BuiltinComplex64 struct{}
A widget to represent the built-in complex64 type
func (BuiltinComplex64) Add ¶
func (_ BuiltinComplex64) Add(res *complex64, l *complex64, r *complex64)
Adds l to r, placing the result in the value that res points to.
func (BuiltinComplex64) Div ¶
func (_ BuiltinComplex64) Div(res *complex64, l *complex64, r *complex64)
Divides l to r, placing the result in the value that res points to.
func (BuiltinComplex64) Eq ¶
func (_ BuiltinComplex64) Eq(l *complex64, r *complex64) bool
Returns true if both complex64's are equal. Uses the standard == operator internally.
func (BuiltinComplex64) Hash ¶
func (_ BuiltinComplex64) Hash(v *complex64) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinComplex64) Mul ¶
func (_ BuiltinComplex64) Mul(res *complex64, l *complex64, r *complex64)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinComplex64) Neg ¶
func (_ BuiltinComplex64) Neg(v *complex64)
Negates v, updating the value that v points to.
func (BuiltinComplex64) Sub ¶
func (_ BuiltinComplex64) Sub(res *complex64, l *complex64, r *complex64)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinComplex64) UnitVal ¶
func (_ BuiltinComplex64) UnitVal() complex64
Returns the unit value for the complex64 type.
func (BuiltinComplex64) Zero ¶
func (_ BuiltinComplex64) Zero(other *complex64)
Zeros the supplied value.
func (BuiltinComplex64) ZeroVal ¶
func (_ BuiltinComplex64) ZeroVal() complex64
Returns the zero value for the complex64 type.
type BuiltinFloat32 ¶
type BuiltinFloat32 struct{}
A widget to represent the built-in float32 type
func (BuiltinFloat32) Add ¶
func (_ BuiltinFloat32) Add(res *float32, l *float32, r *float32)
Adds l to r, placing the result in the value that res points to.
func (BuiltinFloat32) Div ¶
func (_ BuiltinFloat32) Div(res *float32, l *float32, r *float32)
Divides l to r, placing the result in the value that res points to.
func (BuiltinFloat32) Eq ¶
func (_ BuiltinFloat32) Eq(l *float32, r *float32) bool
Returns true if both float32's are equal. Uses the standard == operator internally.
func (BuiltinFloat32) Hash ¶
func (_ BuiltinFloat32) Hash(v *float32) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinFloat32) Lt ¶
func (_ BuiltinFloat32) Lt(l *float32, r *float32) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinFloat32) Mul ¶
func (_ BuiltinFloat32) Mul(res *float32, l *float32, r *float32)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinFloat32) Neg ¶
func (_ BuiltinFloat32) Neg(v *float32)
Negates v, updating the value that v points to.
func (BuiltinFloat32) Sub ¶
func (_ BuiltinFloat32) Sub(res *float32, l *float32, r *float32)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinFloat32) UnitVal ¶
func (_ BuiltinFloat32) UnitVal() float32
Returns the unit value for the float32 type.
func (BuiltinFloat32) ZeroVal ¶
func (_ BuiltinFloat32) ZeroVal() float32
Returns the zero value for the float32 type.
type BuiltinFloat64 ¶
type BuiltinFloat64 struct{}
A widget to represent the built-in float64 type
func (BuiltinFloat64) Add ¶
func (_ BuiltinFloat64) Add(res *float64, l *float64, r *float64)
Adds l to r, placing the result in the value that res points to.
func (BuiltinFloat64) Div ¶
func (_ BuiltinFloat64) Div(res *float64, l *float64, r *float64)
Divides l to r, placing the result in the value that res points to.
func (BuiltinFloat64) Eq ¶
func (_ BuiltinFloat64) Eq(l *float64, r *float64) bool
Returns true if both float64's are equal. Uses the standard == operator internally.
func (BuiltinFloat64) Hash ¶
func (_ BuiltinFloat64) Hash(v *float64) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinFloat64) Lt ¶
func (_ BuiltinFloat64) Lt(l *float64, r *float64) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinFloat64) Mul ¶
func (_ BuiltinFloat64) Mul(res *float64, l *float64, r *float64)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinFloat64) Neg ¶
func (_ BuiltinFloat64) Neg(v *float64)
Negates v, updating the value that v points to.
func (BuiltinFloat64) Sub ¶
func (_ BuiltinFloat64) Sub(res *float64, l *float64, r *float64)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinFloat64) UnitVal ¶
func (_ BuiltinFloat64) UnitVal() float64
Returns the unit value for the float64 type.
func (BuiltinFloat64) ZeroVal ¶
func (_ BuiltinFloat64) ZeroVal() float64
Returns the zero value for the float64 type.
type BuiltinHash ¶
type BuiltinHash struct{}
A widget to represent the built-in hash.Hash type
func (BuiltinHash) Eq ¶
Returns true if both hash.Hash's are equal. Uses the standard == operator internally.
func (BuiltinHash) Hash ¶
func (_ BuiltinHash) Hash(v *hash.Hash) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinHash) Neg ¶
func (_ BuiltinHash) Neg(v *hash.Hash)
Negates v, updating the value that v points to.
func (BuiltinHash) UnitVal ¶
func (_ BuiltinHash) UnitVal() hash.Hash
Returns the unit value for the hash.Hash type.
func (BuiltinHash) ZeroVal ¶
func (_ BuiltinHash) ZeroVal() hash.Hash
Returns the zero value for the hash.Hash type.
type BuiltinInt ¶
type BuiltinInt struct{}
A widget to represent the built-in int type
func (BuiltinInt) Add ¶
func (_ BuiltinInt) Add(res *int, l *int, r *int)
Adds l to r, placing the result in the value that res points to.
func (BuiltinInt) Div ¶
func (_ BuiltinInt) Div(res *int, l *int, r *int)
Divides l to r, placing the result in the value that res points to.
func (BuiltinInt) Eq ¶
func (_ BuiltinInt) Eq(l *int, r *int) bool
Returns true if both int's are equal. Uses the standard == operator internally.
func (BuiltinInt) Hash ¶
func (_ BuiltinInt) Hash(v *int) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinInt) Lt ¶
func (_ BuiltinInt) Lt(l *int, r *int) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinInt) Mul ¶
func (_ BuiltinInt) Mul(res *int, l *int, r *int)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinInt) Neg ¶
func (_ BuiltinInt) Neg(v *int)
Negates v, updating the value that v points to.
func (BuiltinInt) Sub ¶
func (_ BuiltinInt) Sub(res *int, l *int, r *int)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinInt) UnitVal ¶
func (_ BuiltinInt) UnitVal() int
Returns the unit value for the int type.
func (BuiltinInt) ZeroVal ¶
func (_ BuiltinInt) ZeroVal() int
Returns the zero value for the int type.
type BuiltinInt16 ¶
type BuiltinInt16 struct{}
A widget to represent the built-in int16 type
func (BuiltinInt16) Add ¶
func (_ BuiltinInt16) Add(res *int16, l *int16, r *int16)
Adds l to r, placing the result in the value that res points to.
func (BuiltinInt16) Div ¶
func (_ BuiltinInt16) Div(res *int16, l *int16, r *int16)
Divides l to r, placing the result in the value that res points to.
func (BuiltinInt16) Eq ¶
func (_ BuiltinInt16) Eq(l *int16, r *int16) bool
Returns true if both int16's are equal. Uses the standard == operator internally.
func (BuiltinInt16) Hash ¶
func (_ BuiltinInt16) Hash(v *int16) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinInt16) Lt ¶
func (_ BuiltinInt16) Lt(l *int16, r *int16) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinInt16) Mul ¶
func (_ BuiltinInt16) Mul(res *int16, l *int16, r *int16)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinInt16) Neg ¶
func (_ BuiltinInt16) Neg(v *int16)
Negates v, updating the value that v points to.
func (BuiltinInt16) Sub ¶
func (_ BuiltinInt16) Sub(res *int16, l *int16, r *int16)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinInt16) UnitVal ¶
func (_ BuiltinInt16) UnitVal() int16
Returns the unit value for the int16 type.
func (BuiltinInt16) ZeroVal ¶
func (_ BuiltinInt16) ZeroVal() int16
Returns the zero value for the int16 type.
type BuiltinInt32 ¶
type BuiltinInt32 struct{}
A widget to represent the built-in int32 type
func (BuiltinInt32) Add ¶
func (_ BuiltinInt32) Add(res *int32, l *int32, r *int32)
Adds l to r, placing the result in the value that res points to.
func (BuiltinInt32) Div ¶
func (_ BuiltinInt32) Div(res *int32, l *int32, r *int32)
Divides l to r, placing the result in the value that res points to.
func (BuiltinInt32) Eq ¶
func (_ BuiltinInt32) Eq(l *int32, r *int32) bool
Returns true if both int32's are equal. Uses the standard == operator internally.
func (BuiltinInt32) Hash ¶
func (_ BuiltinInt32) Hash(v *int32) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinInt32) Lt ¶
func (_ BuiltinInt32) Lt(l *int32, r *int32) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinInt32) Mul ¶
func (_ BuiltinInt32) Mul(res *int32, l *int32, r *int32)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinInt32) Neg ¶
func (_ BuiltinInt32) Neg(v *int32)
Negates v, updating the value that v points to.
func (BuiltinInt32) Sub ¶
func (_ BuiltinInt32) Sub(res *int32, l *int32, r *int32)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinInt32) UnitVal ¶
func (_ BuiltinInt32) UnitVal() int32
Returns the unit value for the int32 type.
func (BuiltinInt32) ZeroVal ¶
func (_ BuiltinInt32) ZeroVal() int32
Returns the zero value for the int32 type.
type BuiltinInt64 ¶
type BuiltinInt64 struct{}
A widget to represent the built-in int64 type
func (BuiltinInt64) Add ¶
func (_ BuiltinInt64) Add(res *int64, l *int64, r *int64)
Adds l to r, placing the result in the value that res points to.
func (BuiltinInt64) Div ¶
func (_ BuiltinInt64) Div(res *int64, l *int64, r *int64)
Divides l to r, placing the result in the value that res points to.
func (BuiltinInt64) Eq ¶
func (_ BuiltinInt64) Eq(l *int64, r *int64) bool
Returns true if both int64's are equal. Uses the standard == operator internally.
func (BuiltinInt64) Hash ¶
func (_ BuiltinInt64) Hash(v *int64) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinInt64) Lt ¶
func (_ BuiltinInt64) Lt(l *int64, r *int64) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinInt64) Mul ¶
func (_ BuiltinInt64) Mul(res *int64, l *int64, r *int64)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinInt64) Neg ¶
func (_ BuiltinInt64) Neg(v *int64)
Negates v, updating the value that v points to.
func (BuiltinInt64) Sub ¶
func (_ BuiltinInt64) Sub(res *int64, l *int64, r *int64)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinInt64) UnitVal ¶
func (_ BuiltinInt64) UnitVal() int64
Returns the unit value for the int64 type.
func (BuiltinInt64) ZeroVal ¶
func (_ BuiltinInt64) ZeroVal() int64
Returns the zero value for the int64 type.
type BuiltinInt8 ¶
type BuiltinInt8 struct{}
A widget to represent the built-in int8 type
func (BuiltinInt8) Add ¶
func (_ BuiltinInt8) Add(res *int8, l *int8, r *int8)
Adds l to r, placing the result in the value that res points to.
func (BuiltinInt8) Div ¶
func (_ BuiltinInt8) Div(res *int8, l *int8, r *int8)
Divides l to r, placing the result in the value that res points to.
func (BuiltinInt8) Eq ¶
func (_ BuiltinInt8) Eq(l *int8, r *int8) bool
Returns true if both int8's are equal. Uses the standard == operator internally.
func (BuiltinInt8) Hash ¶
func (_ BuiltinInt8) Hash(v *int8) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinInt8) Lt ¶
func (_ BuiltinInt8) Lt(l *int8, r *int8) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinInt8) Mul ¶
func (_ BuiltinInt8) Mul(res *int8, l *int8, r *int8)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinInt8) Neg ¶
func (_ BuiltinInt8) Neg(v *int8)
Negates v, updating the value that v points to.
func (BuiltinInt8) Sub ¶
func (_ BuiltinInt8) Sub(res *int8, l *int8, r *int8)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinInt8) UnitVal ¶
func (_ BuiltinInt8) UnitVal() int8
Returns the unit value for the int8 type.
func (BuiltinInt8) ZeroVal ¶
func (_ BuiltinInt8) ZeroVal() int8
Returns the zero value for the int8 type.
type BuiltinString ¶
type BuiltinString struct{}
A widget to represent the built-in string type
func (BuiltinString) Eq ¶
func (_ BuiltinString) Eq(l *string, r *string) bool
Returns true if both string's are equal. Uses the standard == operator internally.
func (BuiltinString) Hash ¶
func (_ BuiltinString) Hash(v *string) hash.Hash
Provides a hash function for the value that it is wrapping.
type BuiltinUint ¶
type BuiltinUint struct{}
A widget to represent the built-in uint type
func (BuiltinUint) Add ¶
func (_ BuiltinUint) Add(res *uint, l *uint, r *uint)
Adds l to r, placing the result in the value that res points to.
func (BuiltinUint) Div ¶
func (_ BuiltinUint) Div(res *uint, l *uint, r *uint)
Divides l to r, placing the result in the value that res points to.
func (BuiltinUint) Eq ¶
func (_ BuiltinUint) Eq(l *uint, r *uint) bool
Returns true if both uint's are equal. Uses the standard == operator internally.
func (BuiltinUint) Hash ¶
func (_ BuiltinUint) Hash(v *uint) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinUint) Lt ¶
func (_ BuiltinUint) Lt(l *uint, r *uint) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinUint) Mul ¶
func (_ BuiltinUint) Mul(res *uint, l *uint, r *uint)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinUint) Neg ¶
func (_ BuiltinUint) Neg(v *uint)
Negates v, updating the value that v points to.
func (BuiltinUint) Sub ¶
func (_ BuiltinUint) Sub(res *uint, l *uint, r *uint)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinUint) UnitVal ¶
func (_ BuiltinUint) UnitVal() uint
Returns the unit value for the uint type.
func (BuiltinUint) ZeroVal ¶
func (_ BuiltinUint) ZeroVal() uint
Returns the zero value for the uint type.
type BuiltinUint16 ¶
type BuiltinUint16 struct{}
A widget to represent the built-in uint16 type
func (BuiltinUint16) Add ¶
func (_ BuiltinUint16) Add(res *uint16, l *uint16, r *uint16)
Adds l to r, placing the result in the value that res points to.
func (BuiltinUint16) Div ¶
func (_ BuiltinUint16) Div(res *uint16, l *uint16, r *uint16)
Divides l to r, placing the result in the value that res points to.
func (BuiltinUint16) Eq ¶
func (_ BuiltinUint16) Eq(l *uint16, r *uint16) bool
Returns true if both uint16's are equal. Uses the standard == operator internally.
func (BuiltinUint16) Hash ¶
func (_ BuiltinUint16) Hash(v *uint16) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinUint16) Lt ¶
func (_ BuiltinUint16) Lt(l *uint16, r *uint16) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinUint16) Mul ¶
func (_ BuiltinUint16) Mul(res *uint16, l *uint16, r *uint16)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinUint16) Neg ¶
func (_ BuiltinUint16) Neg(v *uint16)
Negates v, updating the value that v points to.
func (BuiltinUint16) Sub ¶
func (_ BuiltinUint16) Sub(res *uint16, l *uint16, r *uint16)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinUint16) UnitVal ¶
func (_ BuiltinUint16) UnitVal() uint16
Returns the unit value for the uint16 type.
func (BuiltinUint16) ZeroVal ¶
func (_ BuiltinUint16) ZeroVal() uint16
Returns the zero value for the uint16 type.
type BuiltinUint32 ¶
type BuiltinUint32 struct{}
A widget to represent the built-in uint32 type
func (BuiltinUint32) Add ¶
func (_ BuiltinUint32) Add(res *uint32, l *uint32, r *uint32)
Adds l to r, placing the result in the value that res points to.
func (BuiltinUint32) Div ¶
func (_ BuiltinUint32) Div(res *uint32, l *uint32, r *uint32)
Divides l to r, placing the result in the value that res points to.
func (BuiltinUint32) Eq ¶
func (_ BuiltinUint32) Eq(l *uint32, r *uint32) bool
Returns true if both uint32's are equal. Uses the standard == operator internally.
func (BuiltinUint32) Hash ¶
func (_ BuiltinUint32) Hash(v *uint32) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinUint32) Lt ¶
func (_ BuiltinUint32) Lt(l *uint32, r *uint32) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinUint32) Mul ¶
func (_ BuiltinUint32) Mul(res *uint32, l *uint32, r *uint32)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinUint32) Neg ¶
func (_ BuiltinUint32) Neg(v *uint32)
Negates v, updating the value that v points to.
func (BuiltinUint32) Sub ¶
func (_ BuiltinUint32) Sub(res *uint32, l *uint32, r *uint32)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinUint32) UnitVal ¶
func (_ BuiltinUint32) UnitVal() uint32
Returns the unit value for the uint32 type.
func (BuiltinUint32) ZeroVal ¶
func (_ BuiltinUint32) ZeroVal() uint32
Returns the zero value for the uint32 type.
type BuiltinUint64 ¶
type BuiltinUint64 struct{}
A widget to represent the built-in uint64 type
func (BuiltinUint64) Add ¶
func (_ BuiltinUint64) Add(res *uint64, l *uint64, r *uint64)
Adds l to r, placing the result in the value that res points to.
func (BuiltinUint64) Div ¶
func (_ BuiltinUint64) Div(res *uint64, l *uint64, r *uint64)
Divides l to r, placing the result in the value that res points to.
func (BuiltinUint64) Eq ¶
func (_ BuiltinUint64) Eq(l *uint64, r *uint64) bool
Returns true if both uint64's are equal. Uses the standard == operator internally.
func (BuiltinUint64) Hash ¶
func (_ BuiltinUint64) Hash(v *uint64) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinUint64) Lt ¶
func (_ BuiltinUint64) Lt(l *uint64, r *uint64) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinUint64) Mul ¶
func (_ BuiltinUint64) Mul(res *uint64, l *uint64, r *uint64)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinUint64) Neg ¶
func (_ BuiltinUint64) Neg(v *uint64)
Negates v, updating the value that v points to.
func (BuiltinUint64) Sub ¶
func (_ BuiltinUint64) Sub(res *uint64, l *uint64, r *uint64)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinUint64) UnitVal ¶
func (_ BuiltinUint64) UnitVal() uint64
Returns the unit value for the uint64 type.
func (BuiltinUint64) ZeroVal ¶
func (_ BuiltinUint64) ZeroVal() uint64
Returns the zero value for the uint64 type.
type BuiltinUint8 ¶
type BuiltinUint8 struct{}
A widget to represent the built-in uint8 type
func (BuiltinUint8) Add ¶
func (_ BuiltinUint8) Add(res *uint8, l *uint8, r *uint8)
Adds l to r, placing the result in the value that res points to.
func (BuiltinUint8) Div ¶
func (_ BuiltinUint8) Div(res *uint8, l *uint8, r *uint8)
Divides l to r, placing the result in the value that res points to.
func (BuiltinUint8) Eq ¶
func (_ BuiltinUint8) Eq(l *uint8, r *uint8) bool
Returns true if both uint8's are equal. Uses the standard == operator internally.
func (BuiltinUint8) Hash ¶
func (_ BuiltinUint8) Hash(v *uint8) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinUint8) Lt ¶
func (_ BuiltinUint8) Lt(l *uint8, r *uint8) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinUint8) Mul ¶
func (_ BuiltinUint8) Mul(res *uint8, l *uint8, r *uint8)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinUint8) Neg ¶
func (_ BuiltinUint8) Neg(v *uint8)
Negates v, updating the value that v points to.
func (BuiltinUint8) Sub ¶
func (_ BuiltinUint8) Sub(res *uint8, l *uint8, r *uint8)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinUint8) UnitVal ¶
func (_ BuiltinUint8) UnitVal() uint8
Returns the unit value for the uint8 type.
func (BuiltinUint8) ZeroVal ¶
func (_ BuiltinUint8) ZeroVal() uint8
Returns the zero value for the uint8 type.
type BuiltinUintptr ¶
type BuiltinUintptr struct{}
A widget to represent the built-in uintptr type
func (BuiltinUintptr) Add ¶
func (_ BuiltinUintptr) Add(res *uintptr, l *uintptr, r *uintptr)
Adds l to r, placing the result in the value that res points to.
func (BuiltinUintptr) Div ¶
func (_ BuiltinUintptr) Div(res *uintptr, l *uintptr, r *uintptr)
Divides l to r, placing the result in the value that res points to.
func (BuiltinUintptr) Eq ¶
func (_ BuiltinUintptr) Eq(l *uintptr, r *uintptr) bool
Returns true if both uintptr's are equal. Uses the standard == operator internally.
func (BuiltinUintptr) Hash ¶
func (_ BuiltinUintptr) Hash(v *uintptr) hash.Hash
Provides a hash function for the value that it is wrapping.
func (BuiltinUintptr) Lt ¶
func (_ BuiltinUintptr) Lt(l *uintptr, r *uintptr) bool
Returns true if l<r. Uses the standard < operator internally.
func (BuiltinUintptr) Mul ¶
func (_ BuiltinUintptr) Mul(res *uintptr, l *uintptr, r *uintptr)
Multiplies l to r, placing the result in the value that res points to.
func (BuiltinUintptr) Neg ¶
func (_ BuiltinUintptr) Neg(v *uintptr)
Negates v, updating the value that v points to.
func (BuiltinUintptr) Sub ¶
func (_ BuiltinUintptr) Sub(res *uintptr, l *uintptr, r *uintptr)
Subtracts l to r, placing the result in the value that res points to.
func (BuiltinUintptr) UnitVal ¶
func (_ BuiltinUintptr) UnitVal() uintptr
Returns the unit value for the uintptr type.
func (BuiltinUintptr) ZeroVal ¶
func (_ BuiltinUintptr) ZeroVal() uintptr
Returns the zero value for the uintptr type.
type NilWidget ¶
type NilWidget[T any] struct{}
A widget value that is used when values do not necessarily need the methods that the widget interface imposes but still need to be used in scenarios that expect a widget type. The behavior of the widget interface is as follows:
- Widgets of this type will never be considered equal
- Widgets of this type will never be considered less than another
- Widgets of this type will always have a hash of 0
- Widgets of this type will perform no action with the zero function
type PartialOrder ¶
type PartialOrder[T any, I PartialOrderInterface[T]] struct { Base[T, I] }
A concrete partial order widget. Internally, this struct will create an interface value of type PartialOrderInterface that points to nil data. All methods on widget are then very thin pass through functions that call the needed methods on the interface value with the supplied values.
Example ¶
v1, v2 := 0, 1
w := PartialOrder[int, BuiltinInt]{}
fmt.Println("Lt:", w.Lt(&v1, &v2))
Output: Lt: true
func (*PartialOrder[T, I]) Gt ¶
func (w *PartialOrder[T, I]) Gt(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l>r using the Lt and Eq functions from the interface that was supplied as a generic type.
func (*PartialOrder[T, I]) Gte ¶
func (w *PartialOrder[T, I]) Gte(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l>=r using the Lt function from the interface that was supplied as a generic type.
type PartialOrderArith ¶
type PartialOrderArith[T any, I PartialOrderArithInterface[T]] struct { Base[T, I] }
A concrete arithmitic widget. Internally, this struct will create an interface value of type PartialOrderArith that points to nil data. All methods on widget are then very thin pass through functions that call the needed methods on the interface value with the supplied values.
func (*PartialOrderArith[T, I]) Add ¶
func (w *PartialOrderArith[T, I]) Add(res *T, l *T, r *T)
Adds the supplied values using the function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Div ¶
func (w *PartialOrderArith[T, I]) Div(res *T, l *T, r *T)
Divides the supplied values using the function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Gt ¶
func (w *PartialOrderArith[T, I]) Gt(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l>r using the Lt and Eq functions from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Gte ¶
func (w *PartialOrderArith[T, I]) Gte(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l>=r using the Lt function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Lt ¶
func (w *PartialOrderArith[T, I]) Lt(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l<r using the Lt function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Lte ¶
func (w *PartialOrderArith[T, I]) Lte(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l<=r using the Lt and Eq functions from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Mul ¶
func (w *PartialOrderArith[T, I]) Mul(res *T, l *T, r *T)
Multiplies the supplied values using the function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Neg ¶
func (w *PartialOrderArith[T, I]) Neg(v *T)
Negates the supplied value using the function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Neq ¶
func (w *PartialOrderArith[T, I]) Neq(l *T, r *T) bool
Compares the left (l) and right (r) values and returns true is l!=r using the Eq function from the interface that was supplied as a generic type.
func (*PartialOrderArith[T, I]) Sub ¶
func (w *PartialOrderArith[T, I]) Sub(res *T, l *T, r *T)
Subtracts the supplied values using the function from the interface that was supplied as a generic type.
type PartialOrderArithInterface ¶
type PartialOrderArithInterface[T any] interface { ArithInterface[T] PartialOrderInterface[T] }
The interface that defines what it means to be a widget that supports both the arithmetic and partial order interface. Implementations of this interface are expected to hold no state that pertains to the widget functions as the methods will not be called in any predetermined order.
type PartialOrderArithPntr ¶
type PartialOrderArithPntr[T any, I PartialOrderArithInterface[T]] struct { // contains filtered or unexported fields }
A pass through widget that represents a pointer to an underlying type that is an arith partial order widget. This is useful for when you need a widget for a pointer. Consider a *int that you need a partial order arith widget for. The PartialOrderArithPntr struct would be used like this:
PartialOrderArithPntr[int, widgets.BuiltinInt]
func (PartialOrderArithPntr[T, I]) Add ¶
func (p PartialOrderArithPntr[T, I]) Add(res **T, l **T, r **T)
func (PartialOrderArithPntr[T, I]) Div ¶
func (p PartialOrderArithPntr[T, I]) Div(res **T, l **T, r **T)
func (PartialOrderArithPntr[T, I]) Mul ¶
func (p PartialOrderArithPntr[T, I]) Mul(res **T, l **T, r **T)
type PartialOrderInterface ¶
type PartialOrderInterface[T any] interface { BaseInterface[T] // A function that should return true if l<r. Lt(l *T, r *T) bool }
The interface that defines what it means to be a widget that can be compared to other widgets. Implementations of this interface are expected to hold no state that pertains to the widget functions as the methods shown below will not be called in any predetermined order.
type PartialOrderPntr ¶
type PartialOrderPntr[T any, I PartialOrderInterface[T]] struct { // contains filtered or unexported fields }
A pass through widget that represents a pointer to an underlying type that is a partial order widget. This is useful for when you need a widget for a pointer. Consider a *int that you need a partial order widget for. The PartialOrderPntr struct would be used like this:
PartialOrderPntr[int, widgets.BuiltinInt]
type ZeroStructWidget ¶
type ZeroStructWidget struct{}
A widget value that is used to represent explicitly zero values. The behavior of the widget interface is as follows:
- Widgets of this type will always be considered equal
- Widgets of this type will never be considered less than another
- Widgets of this type will always have a hash of 0
- Widgets of this type will perform no action with the zero function
Source Files
¶
- BuiltinBool.gen.go
- BuiltinByte.gen.go
- BuiltinComplex128.gen.go
- BuiltinComplex64.gen.go
- BuiltinFloat32.gen.go
- BuiltinFloat64.gen.go
- BuiltinHash.gen.go
- BuiltinInt.gen.go
- BuiltinInt16.gen.go
- BuiltinInt32.gen.go
- BuiltinInt64.gen.go
- BuiltinInt8.gen.go
- BuiltinString.gen.go
- BuiltinUint.gen.go
- BuiltinUint16.gen.go
- BuiltinUint32.gen.go
- BuiltinUint64.gen.go
- BuiltinUint8.gen.go
- BuiltinUintptr.gen.go
- Common.go
- NilWidget.go
- Pntr.go