expr

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package expr contains the expression types for all built in optics, combinators and functions.

Index

Constants

View Source
const (
	EditInsert EditType = 1 << iota
	EditDelete
	EditSubstitute
	EditTranspose

	EditLevenshtein = EditInsert | EditDelete | EditSubstitute
	EditOSA         = EditLevenshtein | EditTranspose
	EditLCS         = EditInsert | EditDelete

	EditAny = 0xFF
)
View Source
const (
	OpticTypeReturnManyFlag OpticType = 1 << iota
	OpticTypeReadWriteFlag
	OpticTypeBiDirFlag
	OpticTypeIdentityFlag

	OpticTypeGetter    = opticTypeReturnOneFlag | opticTypeReadOnlyFlag | opticTypeUniDirFlag
	OpticTypeLens      = opticTypeReturnOneFlag | OpticTypeReadWriteFlag | opticTypeUniDirFlag
	OpticTypeIteration = OpticTypeReturnManyFlag | opticTypeReadOnlyFlag | opticTypeUniDirFlag
	OpticTypeTraversal = OpticTypeReturnManyFlag | OpticTypeReadWriteFlag | opticTypeUniDirFlag
	OpticTypeIso       = opticTypeReturnOneFlag | OpticTypeReadWriteFlag | OpticTypeBiDirFlag
	OpticTypePrism     = OpticTypeReturnManyFlag | OpticTypeReadWriteFlag | OpticTypeBiDirFlag
	OpticTypeIdentity  = opticTypeReturnOneFlag | OpticTypeReadWriteFlag | OpticTypeBiDirFlag | OpticTypeIdentityFlag
)

Variables

This section is empty.

Functions

func Custom

func Custom(id string) func(ot OpticTypeExpr) OpticExpression

func CustomReducer

func CustomReducer(id string) func(ot ReducerTypeExpr) ReducerExpression

func GetPurity

func GetPurity[ERR any]() bool

func TODO

func TODO(id string) func(ot OpticTypeExpr) OpticExpression

Types

type All

type All struct {
	OpticTypeExpr
	Optic OpticExpression
	Pred  OpticExpression
}

func (All) Short

func (e All) Short() string

func (All) String

func (e All) String() string

type Any

type Any struct {
	OpticTypeExpr
	Optic OpticExpression
	Pred  OpticExpression
}

func (Any) Short

func (e Any) Short() string

func (Any) String

func (e Any) String() string

type AppendCol

type AppendCol struct {
	OpticTypeExpr
	I reflect.Type
	A reflect.Type
}

func (AppendCol) Short

func (e AppendCol) Short() string

func (AppendCol) String

func (e AppendCol) String() string

type AppendSliceReducerExpr

type AppendSliceReducerExpr struct {
	ReducerTypeExpr
}

func (AppendSliceReducerExpr) Short

func (m AppendSliceReducerExpr) Short() string

func (AppendSliceReducerExpr) String

func (m AppendSliceReducerExpr) String() string

type AsReducer

type AsReducer struct {
	ReducerTypeExpr
	Empty  OpticExpression
	Append OpticExpression
	End    OpticExpression
}

func (AsReducer) Short

func (m AsReducer) Short() string

func (AsReducer) String

func (m AsReducer) String() string

type AsSeqExpr

type AsSeqExpr interface {
	AsExpr() SeqExpr
}

type AtT2

type AtT2 struct {
	OpticTypeExpr
	V      reflect.Type
	Equals OpticExpression
}

func (AtT2) Short

func (e AtT2) Short() string

func (AtT2) String

func (e AtT2) String() string

type Beside

type Beside struct {
	OpticTypeExpr
	Optic1 OpticExpression
	Optic2 OpticExpression
}

func (Beside) Short

func (e Beside) Short() string

func (Beside) String

func (e Beside) String() string

type BesideEither

type BesideEither struct {
	OpticTypeExpr
	OnLeft  OpticExpression
	OnRight OpticExpression
}

func (BesideEither) Short

func (e BesideEither) Short() string

func (BesideEither) String

func (e BesideEither) String() string

type BinaryExpr

type BinaryExpr struct {
	OpticTypeExpr
	L  reflect.Type
	R  reflect.Type
	Op string
}

func (BinaryExpr) Short

func (e BinaryExpr) Short() string

func (BinaryExpr) String

func (e BinaryExpr) String() string

type BottomUpFiltered

type BottomUpFiltered struct {
	OpticTypeExpr

	Children OpticExpression
	Pred     OpticExpression
}

func (BottomUpFiltered) Short

func (e BottomUpFiltered) Short() string

func (BottomUpFiltered) String

func (e BottomUpFiltered) String() string

type BreadthFirstFiltered

type BreadthFirstFiltered struct {
	OpticTypeExpr

	Children OpticExpression
	Pred     OpticExpression
}

func (BreadthFirstFiltered) Short

func (e BreadthFirstFiltered) Short() string

func (BreadthFirstFiltered) String

func (e BreadthFirstFiltered) String() string

type Bytes

type Bytes struct {
	OpticTypeExpr
}

func (Bytes) Short

func (e Bytes) Short() string

func (Bytes) String

func (e Bytes) String() string

type CaptureString

type CaptureString struct {
	OpticTypeExpr
	MatchOn *regexp.Regexp
}

func (CaptureString) Short

func (e CaptureString) Short() string

func (CaptureString) String

func (e CaptureString) String() string

type Case

type Case struct {
	OpticTypeExpr
	Condition OpticExpression
	Default   OpticExpression
}

func (Case) Short

func (e Case) Short() string

func (Case) String

func (e Case) String() string

type Cast

type Cast struct {
	OpticTypeExpr
}

func (Cast) Short

func (e Cast) Short() string

func (Cast) String

func (e Cast) String() string

type Catch

type Catch struct {
	OpticTypeExpr

	Optic  OpticExpression
	CatchA OpticExpression
	CatchT OpticExpression
}

func (Catch) Short

func (e Catch) Short() string

func (Catch) String

func (e Catch) String() string

type Children

type Children struct {
	OpticTypeExpr
}

func (Children) Short

func (e Children) Short() string

func (Children) String

func (e Children) String() string

type Chosen

type Chosen struct {
	OpticTypeExpr
}

func (Chosen) Short

func (e Chosen) Short() string

func (Chosen) String

func (e Chosen) String() string

type Coalesce

type Coalesce struct {
	OpticTypeExpr

	Optics []OpticExpression
}

func (Coalesce) Short

func (e Coalesce) Short() string

func (Coalesce) String

func (e Coalesce) String() string

type ColFocusErr

type ColFocusErr struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (ColFocusErr) Short

func (e ColFocusErr) Short() string

func (ColFocusErr) String

func (e ColFocusErr) String() string

type ColSourceErr

type ColSourceErr struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (ColSourceErr) Short

func (e ColSourceErr) Short() string

func (ColSourceErr) String

func (e ColSourceErr) String() string

type ColSourceFocusErr

type ColSourceFocusErr struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (ColSourceFocusErr) Short

func (e ColSourceFocusErr) Short() string

func (ColSourceFocusErr) String

func (e ColSourceFocusErr) String() string

type CollectionOf

type CollectionOf struct {
	OpticTypeExpr
	I     reflect.Type
	A     reflect.Type
	B     reflect.Type
	Optic OpticExpression
}

func (CollectionOf) Short

func (e CollectionOf) Short() string

func (CollectionOf) String

func (e CollectionOf) String() string

type Compose

type Compose struct {
	OpticTypeExpr

	Left  OpticExpression
	Right OpticExpression
	IxMap OpticExpression
}

func (Compose) Short

func (e Compose) Short() string

func (Compose) String

func (e Compose) String() string

type Concat

type Concat struct {
	OpticTypeExpr
	Optics []OpticExpression
}

func (Concat) Short

func (e Concat) Short() string

func (Concat) String

func (e Concat) String() string

type Const

type Const struct {
	OpticTypeExpr
	Index any
	Value any
}

func (Const) Short

func (e Const) Short() string

func (Const) String

func (e Const) String() string

type CustomOptic

type CustomOptic struct {
	OpticTypeExpr
	Id string
}

func (CustomOptic) Short

func (e CustomOptic) Short() string

func (CustomOptic) String

func (e CustomOptic) String() string

type CustomReducerExpr

type CustomReducerExpr struct {
	ReducerTypeExpr
	Id string
}

func (CustomReducerExpr) Short

func (m CustomReducerExpr) Short() string

func (CustomReducerExpr) String

func (m CustomReducerExpr) String() string

type DecodeFileExpr

type DecodeFileExpr struct {
	OpticTypeExpr
	Encoding encoding.Encoding
}

func (DecodeFileExpr) Short

func (e DecodeFileExpr) Short() string

func (DecodeFileExpr) String

func (e DecodeFileExpr) String() string

type Desc

type Desc struct {
	OpticTypeExpr

	Optic OpticExpression
}

func (Desc) Short

func (e Desc) Short() string

func (Desc) String

func (e Desc) String() string

type DiffCol

type DiffCol struct {
	OpticTypeExpr

	Threshold float64
	Distance  OpticExpression
	IxMatch   OpticExpression
}

func (DiffCol) Short

func (e DiffCol) Short() string

func (DiffCol) String

func (e DiffCol) String() string

type DiffTree

type DiffTree struct {
	OpticTypeExpr

	I reflect.Type
	A reflect.Type

	Children  OpticExpression
	Threshold float64
	Distance  OpticExpression
	IxMatch   OpticExpression
}

func (DiffTree) Short

func (e DiffTree) Short() string

func (DiffTree) String

func (e DiffTree) String() string

type EditDistance

type EditDistance struct {
	OpticTypeExpr
	Optic        OpticExpression
	AllowedEdits EditType
}

func (EditDistance) Short

func (e EditDistance) Short() string

func (EditDistance) String

func (e EditDistance) String() string

type EditType

type EditType byte

type Empty

type Empty struct {
	OpticTypeExpr
}

func (Empty) Short

func (e Empty) Short() string

func (Empty) String

func (e Empty) String() string

type EncodeString

type EncodeString struct {
	OpticTypeExpr
	Encoding encoding.Encoding
}

func (EncodeString) Short

func (e EncodeString) Short() string

func (EncodeString) String

func (e EncodeString) String() string

type EqDeep

type EqDeep struct {
	OpticTypeExpr
}

func (EqDeep) Short

func (e EqDeep) Short() string

func (EqDeep) String

func (e EqDeep) String() string

type EqT2Of

type EqT2Of struct {
	OpticTypeExpr
	Optic OpticExpression
	Eq    OpticExpression
}

func (EqT2Of) Short

func (e EqT2Of) Short() string

func (EqT2Of) String

func (e EqT2Of) String() string

type ErrDuplicateKeyReducerExpr

type ErrDuplicateKeyReducerExpr struct {
	ReducerTypeExpr
}

func (ErrDuplicateKeyReducerExpr) Short

func (ErrDuplicateKeyReducerExpr) String

type Error

type Error struct {
	OpticTypeExpr

	Err error
}

func (Error) Short

func (e Error) Short() string

func (Error) String

func (e Error) String() string

type ErrorAs

type ErrorAs struct {
	OpticTypeExpr
}

func (ErrorAs) Short

func (e ErrorAs) Short() string

func (ErrorAs) String

func (e ErrorAs) String() string

type ErrorIs

type ErrorIs struct {
	OpticTypeExpr

	Target error
}

func (ErrorIs) Short

func (e ErrorIs) Short() string

func (ErrorIs) String

func (e ErrorIs) String() string

type ExtentData

type ExtentData struct {
	OpticTypeExpr
}

func (ExtentData) Short

func (e ExtentData) Short() string

func (ExtentData) String

func (e ExtentData) String() string

type FieldLens

type FieldLens struct {
	OpticTypeExpr
	Field    reflect.StructField
	FieldNum int
}

func (FieldLens) Short

func (e FieldLens) Short() string

func (FieldLens) String

func (e FieldLens) String() string

type FilterMode

type FilterMode byte
const (
	FilterStop FilterMode = iota
	FilterContinue
	FilterYieldAll
)

func (FilterMode) String

func (f FilterMode) String() string

type Filtered

type Filtered struct {
	OpticTypeExpr

	PosPred     OpticExpression
	Pred        OpticExpression
	Optic       OpticExpression
	NoMatchMode FilterMode
	MatchMode   FilterMode
}

func (Filtered) Short

func (e Filtered) Short() string

func (Filtered) String

func (e Filtered) String() string

type ForEach

type ForEach struct {
	OpticTypeExpr
	ForEach OpticExpression
	Op      OpticExpression
}

func (ForEach) Short

func (e ForEach) Short() string

func (ForEach) String

func (e ForEach) String() string

type FormatFloat

type FormatFloat struct {
	OpticTypeExpr
	Fmt     byte
	Prec    int
	BitSize int
}

func (FormatFloat) Short

func (e FormatFloat) Short() string

func (FormatFloat) String

func (e FormatFloat) String() string

type FormatInt

type FormatInt struct {
	OpticTypeExpr
	Base int
}

func (FormatInt) Short

func (e FormatInt) Short() string

func (FormatInt) String

func (e FormatInt) String() string

type GoFuncExpr

type GoFuncExpr struct {
	OpticTypeExpr
	Func reflect.Value
}

func (GoFuncExpr) Short

func (e GoFuncExpr) Short() string

func (GoFuncExpr) String

func (e GoFuncExpr) String() string

type Grouped

type Grouped struct {
	OpticTypeExpr
	Optic   OpticExpression
	Reducer ReducerExpression
}

func (Grouped) Short

func (e Grouped) Short() string

func (Grouped) String

func (e Grouped) String() string

type HtmlChildren

type HtmlChildren struct {
	OpticTypeExpr
}

func (HtmlChildren) Short

func (e HtmlChildren) Short() string

func (HtmlChildren) String

func (e HtmlChildren) String() string

type Identity

type Identity struct {
	Index any
	OpticTypeExpr
}

func (Identity) Short

func (e Identity) Short() string

func (Identity) String

func (e Identity) String() string

type Ignore

type Ignore struct {
	OpticTypeExpr

	Optic     OpticExpression
	Predicate OpticExpression
}

func (Ignore) Short

func (e Ignore) Short() string

func (Ignore) String

func (e Ignore) String() string

type IgnoreWrite

type IgnoreWrite struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (IgnoreWrite) Short

func (e IgnoreWrite) Short() string

func (IgnoreWrite) String

func (e IgnoreWrite) String() string

type Index

type Index struct {
	OpticTypeExpr

	Index any
	Optic OpticExpression
}

func (Index) Short

func (e Index) Short() string

func (Index) String

func (e Index) String() string

type Indexing

type Indexing struct {
	OpticTypeExpr

	Optic OpticExpression
}

func (Indexing) Short

func (e Indexing) Short() string

func (Indexing) String

func (e Indexing) String() string

type IsoOpT2BindExpr

type IsoOpT2BindExpr struct {
	OpticTypeExpr
	Op    OpticExpression
	InvOp OpticExpression
	S     reflect.Type
	Right any
}

func (IsoOpT2BindExpr) Short

func (e IsoOpT2BindExpr) Short() string

func (IsoOpT2BindExpr) String

func (e IsoOpT2BindExpr) String() string

type IxMap

type IxMap struct {
	OpticTypeExpr

	Type IxMapperType
}

func (IxMap) Short

func (e IxMap) Short() string

func (IxMap) String

func (e IxMap) String() string

type IxMapperType

type IxMapperType int
const (
	IxMapperCustom IxMapperType = iota
	IxMapperLeft
	IxMapperRight
	IxMapperBoth
)

func (IxMapperType) String

func (i IxMapperType) String() string

type IxMatch

type IxMatch struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (IxMatch) Short

func (e IxMatch) Short() string

func (IxMatch) String

func (e IxMatch) String() string

type JqContains

type JqContains struct {
	OpticTypeExpr
}

func (JqContains) Short

func (e JqContains) Short() string

func (JqContains) String

func (e JqContains) String() string

type JqObjectsOf

type JqObjectsOf struct {
	OpticTypeExpr
	Fields OpticExpression
}

func (JqObjectsOf) Short

func (e JqObjectsOf) Short() string

func (JqObjectsOf) String

func (e JqObjectsOf) String() string

type JqOrderBy

type JqOrderBy struct {
	OpticTypeExpr
}

func (JqOrderBy) Short

func (e JqOrderBy) Short() string

func (JqOrderBy) String

func (e JqOrderBy) String() string

type JqPick

type JqPick struct {
	OpticTypeExpr
	Paths [][]any
}

func (JqPick) Short

func (e JqPick) Short() string

func (JqPick) String

func (e JqPick) String() string

type Last

type Last struct {
	OpticTypeExpr

	Optic OpticExpression
}

func (Last) Short

func (e Last) Short() string

func (Last) String

func (e Last) String() string

type Left

type Left struct {
	OpticTypeExpr
	B reflect.Type
}

func (Left) Short

func (e Left) Short() string

func (Left) String

func (e Left) String() string

type Length

type Length struct {
	OpticTypeExpr

	Optic OpticExpression
}

func (Length) Short

func (e Length) Short() string

func (Length) String

func (e Length) String() string

type Lookup

type Lookup struct {
	OpticTypeExpr
	Optic  OpticExpression
	Source any
}

func (Lookup) Short

func (e Lookup) Short() string

func (Lookup) String

func (e Lookup) String() string

type Make

type Make struct {
	OpticTypeExpr
	Size []int
}

func (Make) Short

func (e Make) Short() string

func (Make) String

func (e Make) String() string

type MapOfReduced

type MapOfReduced struct {
	OpticTypeExpr

	Optic   OpticExpression
	Reducer ReducerExpression
}

func (MapOfReduced) Short

func (e MapOfReduced) Short() string

func (MapOfReduced) String

func (e MapOfReduced) String() string

type MapReduce

type MapReduce struct {
	OpticTypeExpr

	Optic   OpticExpression
	Reducer ReducerExpression
	Mapper  OpticExpression
}

func (MapReduce) Short

func (e MapReduce) Short() string

func (MapReduce) String

func (e MapReduce) String() string

type MatchString

type MatchString struct {
	OpticTypeExpr
	Match *regexp.Regexp
}

func (MatchString) Short

func (e MatchString) Short() string

func (MatchString) String

func (e MatchString) String() string

type Matching

type Matching struct {
	OpticTypeExpr
	Match OpticExpression
}

func (Matching) Short

func (e Matching) Short() string

func (Matching) String

func (e Matching) String() string

type MeanReducer

type MeanReducer struct {
	ReducerTypeExpr
}

func (MeanReducer) Short

func (m MeanReducer) Short() string

func (MeanReducer) String

func (m MeanReducer) String() string

type MedianReducer

type MedianReducer struct {
	ReducerTypeExpr
}

func (MedianReducer) Short

func (m MedianReducer) Short() string

func (MedianReducer) String

func (m MedianReducer) String() string

type MethodGetter

type MethodGetter struct {
	OpticTypeExpr
	MethodName string
	Method     reflect.Type
}

func (MethodGetter) Short

func (e MethodGetter) Short() string

func (MethodGetter) String

func (e MethodGetter) String() string

type MethodLens

type MethodLens struct {
	OpticTypeExpr
	GetterName string
	Getter     reflect.Type
	SetterName string
	Setter     reflect.Type
}

func (MethodLens) Short

func (e MethodLens) Short() string

func (MethodLens) String

func (e MethodLens) String() string

type ModeReducer

type ModeReducer struct {
	ReducerTypeExpr
}

func (ModeReducer) Short

func (m ModeReducer) Short() string

func (ModeReducer) String

func (m ModeReducer) String() string

type Modify

type Modify struct {
	OpticTypeExpr
	Optic OpticExpression
	Fmap  OpticExpression
}

func (Modify) Short

func (e Modify) Short() string

func (Modify) String

func (e Modify) String() string

type Non

type Non struct {
	OpticTypeExpr
	Default any
	Equal   OpticExpression
}

func (Non) Short

func (e Non) Short() string

func (Non) String

func (e Non) String() string

type None

type None struct {
	OpticTypeExpr
}

func (None) Short

func (e None) Short() string

func (None) String

func (e None) String() string

type OpIxGet

type OpIxGet struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (OpIxGet) Short

func (e OpIxGet) Short() string

func (OpIxGet) String

func (e OpIxGet) String() string

type OpT2BindExpr

type OpT2BindExpr struct {
	OpticTypeExpr
	Op         OpticExpression
	S          reflect.Type
	RightValue any
}

func (OpT2BindExpr) Short

func (e OpT2BindExpr) Short() string

func (OpT2BindExpr) String

func (e OpT2BindExpr) String() string

type OpticExpression

type OpticExpression interface {
	OpticI() reflect.Type
	OpticS() reflect.Type
	OpticT() reflect.Type
	OpticA() reflect.Type
	OpticB() reflect.Type

	// Provides this optics internal type. This indicates which methods have efficient implementations.
	OpticType() OpticType

	Pure() bool

	//Provides a string representation of this Optic for diagnosis/logging purposes.
	String() string
	Short() string
}

type OpticType

type OpticType byte

func GetOpticType

func GetOpticType[RET, RW, DIR any]() OpticType

func (OpticType) String

func (o OpticType) String() string

type OpticTypeExpr

type OpticTypeExpr struct {
	// contains filtered or unexported fields
}

func NewOpticTypeExpr

func NewOpticTypeExpr[I, S, T, A, B, RET, RW, DIR, ERR any]() OpticTypeExpr

func (OpticTypeExpr) OpticA

func (o OpticTypeExpr) OpticA() reflect.Type

func (OpticTypeExpr) OpticB

func (o OpticTypeExpr) OpticB() reflect.Type

func (OpticTypeExpr) OpticI

func (o OpticTypeExpr) OpticI() reflect.Type

func (OpticTypeExpr) OpticS

func (o OpticTypeExpr) OpticS() reflect.Type

func (OpticTypeExpr) OpticT

func (o OpticTypeExpr) OpticT() reflect.Type

func (OpticTypeExpr) OpticType

func (o OpticTypeExpr) OpticType() OpticType

Provides this optics internal type. This indicates which methods have efficient implementations.

func (OpticTypeExpr) Pure

func (o OpticTypeExpr) Pure() bool

func (OpticTypeExpr) Signature

func (o OpticTypeExpr) Signature() string

type OptionOfFirst

type OptionOfFirst struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (OptionOfFirst) Short

func (e OptionOfFirst) Short() string

func (OptionOfFirst) String

func (e OptionOfFirst) String() string

type OrderBy

type OrderBy struct {
	OpticTypeExpr

	Optic OpticExpression
}

func (OrderBy) Short

func (e OrderBy) Short() string

func (OrderBy) String

func (e OrderBy) String() string

type OrderByN

type OrderByN struct {
	OpticTypeExpr

	Optics []OpticExpression
}

func (OrderByN) Short

func (e OrderByN) Short() string

func (OrderByN) String

func (e OrderByN) String() string

type Ordered

type Ordered struct {
	OpticTypeExpr

	Optic   OpticExpression
	OrderBy OpticExpression
}

func (Ordered) Short

func (e Ordered) Short() string

func (Ordered) String

func (e Ordered) String() string

type Overwrite

type Overwrite struct {
	OpticTypeExpr
}

func (Overwrite) Short

func (e Overwrite) Short() string

func (Overwrite) String

func (e Overwrite) String() string

type ParseFloat

type ParseFloat struct {
	OpticTypeExpr
	Fmt     byte
	Prec    int
	BitSize int
}

func (ParseFloat) Short

func (e ParseFloat) Short() string

func (ParseFloat) String

func (e ParseFloat) String() string

type ParseFloatP

type ParseFloatP struct {
	OpticTypeExpr
	BitSize int
}

func (ParseFloatP) Short

func (e ParseFloatP) Short() string

func (ParseFloatP) String

func (e ParseFloatP) String() string

type ParseHtml

type ParseHtml struct {
	OpticTypeExpr
}

func (ParseHtml) Short

func (e ParseHtml) Short() string

func (ParseHtml) String

func (e ParseHtml) String() string

type ParseInt

type ParseInt struct {
	OpticTypeExpr
	Base    int
	BitSize int
}

func (ParseInt) Short

func (e ParseInt) Short() string

func (ParseInt) String

func (e ParseInt) String() string

type ParseJson

type ParseJson struct {
	OpticTypeExpr
}

func (ParseJson) Short

func (e ParseJson) Short() string

func (ParseJson) String

func (e ParseJson) String() string

type Polymorphic

type Polymorphic struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (Polymorphic) Short

func (e Polymorphic) Short() string

func (Polymorphic) String

func (e Polymorphic) String() string

type Prefixed

type Prefixed struct {
	OpticTypeExpr
	Path     OpticExpression
	Val      any
	ValMatch OpticExpression
}

func (Prefixed) Short

func (e Prefixed) Short() string

func (Prefixed) String

func (e Prefixed) String() string

type PtrOption

type PtrOption struct {
	OpticTypeExpr
	A reflect.Type
	B reflect.Type
}

func (PtrOption) Short

func (e PtrOption) Short() string

func (PtrOption) String

func (e PtrOption) String() string

type ReIndexed

type ReIndexed struct {
	OpticTypeExpr

	IxMap   OpticExpression
	IxMatch OpticExpression
	Optic   OpticExpression
}

func (ReIndexed) Short

func (e ReIndexed) Short() string

func (ReIndexed) String

func (e ReIndexed) String() string

type ReIndexedCol

type ReIndexedCol struct {
	OpticTypeExpr

	IxMap    OpticExpression
	IxMatchI OpticExpression
	IxMatchJ OpticExpression
}

func (ReIndexedCol) Short

func (e ReIndexedCol) Short() string

func (ReIndexedCol) String

func (e ReIndexedCol) String() string

type ReIndexedTree

type ReIndexedTree struct {
	OpticTypeExpr

	I     reflect.Type
	A     reflect.Type
	B     reflect.Type
	IxMap OpticExpression
}

func (ReIndexedTree) Short

func (e ReIndexedTree) Short() string

func (ReIndexedTree) String

func (e ReIndexedTree) String() string

type Reader

type Reader struct {
	OpticTypeExpr
}

func (Reader) Short

func (e Reader) Short() string

func (Reader) String

func (e Reader) String() string

type ReducerExpression

type ReducerExpression interface {
	ReducerS() reflect.Type
	ReducerE() reflect.Type
	ReducerR() reflect.Type

	//Provides a string representation of this Reducer for diagnosis/logging purposes.
	String() string
	Short() string
}

type ReducerN

type ReducerN struct {
	ReducerTypeExpr
	Reducers []ReducerExpression
}

func (ReducerN) Short

func (m ReducerN) Short() string

func (ReducerN) String

func (m ReducerN) String() string

type ReducerTypeExpr

type ReducerTypeExpr struct {
	// contains filtered or unexported fields
}

func NewReducerTypeExpr

func NewReducerTypeExpr[S, A, R any]() ReducerTypeExpr

func (ReducerTypeExpr) ReducerE

func (o ReducerTypeExpr) ReducerE() reflect.Type

func (ReducerTypeExpr) ReducerR

func (o ReducerTypeExpr) ReducerR() reflect.Type

func (ReducerTypeExpr) ReducerS

func (o ReducerTypeExpr) ReducerS() reflect.Type

type ResolvePath

type ResolvePath struct {
	OpticTypeExpr
	Children OpticExpression
	Path     []any
}

func (ResolvePath) Short

func (e ResolvePath) Short() string

func (ResolvePath) String

func (e ResolvePath) String() string

type Reverse

type Reverse struct {
	OpticTypeExpr
	I reflect.Type
	A reflect.Type
	B reflect.Type
}

func (Reverse) Short

func (e Reverse) Short() string

func (Reverse) String

func (e Reverse) String() string

type ReverseGet

type ReverseGet struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (ReverseGet) Short

func (e ReverseGet) Short() string

func (ReverseGet) String

func (e ReverseGet) String() string

type Reversed

type Reversed struct {
	OpticTypeExpr

	Optic OpticExpression
}

func (Reversed) Short

func (e Reversed) Short() string

func (Reversed) String

func (e Reversed) String() string

type Rewrite

type Rewrite struct {
	OpticTypeExpr

	Children  OpticExpression
	RewriteOp OpticExpression
}

func (Rewrite) Short

func (e Rewrite) Short() string

func (Rewrite) String

func (e Rewrite) String() string
type Right struct {
	OpticTypeExpr
	A reflect.Type
}

func (Right) Short

func (e Right) Short() string

func (Right) String

func (e Right) String() string

type SelfIndex

type SelfIndex struct {
	OpticTypeExpr

	IxMatch OpticExpression
	Optic   OpticExpression
}

func (SelfIndex) Short

func (e SelfIndex) Short() string

func (SelfIndex) String

func (e SelfIndex) String() string

type SeqExpr

type SeqExpr func(ctx context.Context, yield func(SeqExprValue) bool)

type SeqExprValue

type SeqExprValue struct {
	Index    any
	Value    any
	ValuePtr any
	Error    error
}

type SeqOf

type SeqOf struct {
	OpticTypeExpr
	I     reflect.Type
	A     reflect.Type
	B     reflect.Type
	Optic OpticExpression
}

func (SeqOf) Short

func (e SeqOf) Short() string

func (SeqOf) String

func (e SeqOf) String() string

type Set

type Set struct {
	OpticTypeExpr
	Optic OpticExpression
	Val   any
}

func (Set) Short

func (e Set) Short() string

func (Set) String

func (e Set) String() string

type SliceChildren

type SliceChildren struct {
	OpticTypeExpr
	A reflect.Type
}

func (SliceChildren) Short

func (e SliceChildren) Short() string

func (SliceChildren) String

func (e SliceChildren) String() string

type SliceOf

type SliceOf struct {
	OpticTypeExpr
	I     reflect.Type
	A     reflect.Type
	B     reflect.Type
	Optic OpticExpression
}

func (SliceOf) Short

func (e SliceOf) Short() string

func (SliceOf) String

func (e SliceOf) String() string

type Some

type Some struct {
	OpticTypeExpr
}

func (Some) Short

func (e Some) Short() string

func (Some) String

func (e Some) String() string

type SplitFileExpr

type SplitFileExpr struct {
	OpticTypeExpr
	SplitOn byte
}

func (SplitFileExpr) Short

func (e SplitFileExpr) Short() string

func (SplitFileExpr) String

func (e SplitFileExpr) String() string

type SplitString

type SplitString struct {
	OpticTypeExpr
	SplitOn *regexp.Regexp
}

func (SplitString) Short

func (e SplitString) Short() string

func (SplitString) String

func (e SplitString) String() string

type StatExpr

type StatExpr struct {
	OpticTypeExpr
}

func (StatExpr) Short

func (e StatExpr) Short() string

func (StatExpr) String

func (e StatExpr) String() string

type Stop

type Stop struct {
	OpticTypeExpr

	Optic     OpticExpression
	Predicate OpticExpression
}

func (Stop) Short

func (e Stop) Short() string

func (Stop) String

func (e Stop) String() string

type StringBuilderReducerExpr

type StringBuilderReducerExpr struct {
	ReducerTypeExpr
}

func (StringBuilderReducerExpr) Short

func (m StringBuilderReducerExpr) Short() string

func (StringBuilderReducerExpr) String

func (m StringBuilderReducerExpr) String() string

type StringHasPrefix

type StringHasPrefix struct {
	OpticTypeExpr
	Prefix string
}

func (StringHasPrefix) Short

func (e StringHasPrefix) Short() string

func (StringHasPrefix) String

func (e StringHasPrefix) String() string

type StringHasSuffix

type StringHasSuffix struct {
	OpticTypeExpr
	Suffix string
}

func (StringHasSuffix) Short

func (e StringHasSuffix) Short() string

func (StringHasSuffix) String

func (e StringHasSuffix) String() string

type StringOf

type StringOf struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (StringOf) Short

func (e StringOf) Short() string

func (StringOf) String

func (e StringOf) String() string

type SubCol

type SubCol struct {
	OpticTypeExpr
	Start  int
	Length int
}

func (SubCol) Short

func (e SubCol) Short() string

func (SubCol) String

func (e SubCol) String() string

type SwapTuple

type SwapTuple struct {
	OpticTypeExpr
	A reflect.Type
	B reflect.Type
}

func (SwapTuple) Short

func (e SwapTuple) Short() string

func (SwapTuple) String

func (e SwapTuple) String() string

type Switch

type Switch struct {
	OpticTypeExpr

	Whens   []Case
	Default OpticExpression
}

func (Switch) Short

func (e Switch) Short() string

func (Switch) String

func (e Switch) String() string

type Throw

type Throw struct {
	OpticTypeExpr
}

func (Throw) Short

func (e Throw) Short() string

func (Throw) String

func (e Throw) String() string

type ToCol

type ToCol struct {
	OpticTypeExpr
	I reflect.Type
	A reflect.Type
	B reflect.Type
}

func (ToCol) Short

func (e ToCol) Short() string

func (ToCol) String

func (e ToCol) String() string

type TopDownFiltered

type TopDownFiltered struct {
	OpticTypeExpr

	Children OpticExpression
	Pred     OpticExpression
}

func (TopDownFiltered) Short

func (e TopDownFiltered) Short() string

func (TopDownFiltered) String

func (e TopDownFiltered) String() string

type TopDownMatch

type TopDownMatch struct {
	OpticTypeExpr
	Children OpticExpression
	Matcher  OpticExpression
}

func (TopDownMatch) Short

func (e TopDownMatch) Short() string

func (TopDownMatch) String

func (e TopDownMatch) String() string

type Traverse

type Traverse struct {
	OpticTypeExpr
}

func (Traverse) Short

func (e Traverse) Short() string

func (Traverse) String

func (e Traverse) String() string

type TraverseDirExpr

type TraverseDirExpr struct {
	OpticTypeExpr
}

func (TraverseDirExpr) Short

func (e TraverseDirExpr) Short() string

func (TraverseDirExpr) String

func (e TraverseDirExpr) String() string

type TraverseFile

type TraverseFile struct {
	OpticTypeExpr
	Perm    os.FileMode
	BufSize int
}

func (TraverseFile) Short

func (e TraverseFile) Short() string

func (TraverseFile) String

func (e TraverseFile) String() string

type TraverseMembers

type TraverseMembers struct {
	OpticTypeExpr
}

func (TraverseMembers) Short

func (e TraverseMembers) Short() string

func (TraverseMembers) String

func (e TraverseMembers) String() string

type TraverseTreeChildrenExpr

type TraverseTreeChildrenExpr struct {
	OpticTypeExpr

	IxMatch OpticExpression

	I reflect.Type
	A reflect.Type
}

func (TraverseTreeChildrenExpr) Short

func (e TraverseTreeChildrenExpr) Short() string

func (TraverseTreeChildrenExpr) String

func (e TraverseTreeChildrenExpr) String() string

type TreeMerge

type TreeMerge struct {
	OpticTypeExpr
	Children    OpticExpression
	ChildrenSeq OpticExpression
}

func (TreeMerge) Short

func (e TreeMerge) Short() string

func (TreeMerge) String

func (e TreeMerge) String() string

type TreeOp

type TreeOp struct {
	OpticTypeExpr
	Children OpticExpression
	Op       OpticExpression
}

func (TreeOp) Short

func (e TreeOp) Short() string

func (TreeOp) String

func (e TreeOp) String() string

type TupleDup

type TupleDup struct {
	OpticTypeExpr
	N int
}

func (TupleDup) Short

func (e TupleDup) Short() string

func (TupleDup) String

func (e TupleDup) String() string

type TupleElement

type TupleElement struct {
	OpticTypeExpr
	Index int
}

func (TupleElement) Short

func (e TupleElement) Short() string

func (TupleElement) String

func (e TupleElement) String() string

type TupleOf

type TupleOf struct {
	OpticTypeExpr
	Elements []OpticExpression
}

func (TupleOf) Short

func (e TupleOf) Short() string

func (TupleOf) String

func (e TupleOf) String() string

type UnaryExpr

type UnaryExpr struct {
	OpticTypeExpr
	Op string
}

func (UnaryExpr) Short

func (e UnaryExpr) Short() string

func (UnaryExpr) String

func (e UnaryExpr) String() string

type Unknown

type Unknown struct{}

type Value

type Value struct {
	OpticTypeExpr
	Value any
}

func (Value) Short

func (e Value) Short() string

func (Value) String

func (e Value) String() string

type Var

type Var struct {
	OpticTypeExpr
	Name string
}

func (Var) Short

func (e Var) Short() string

func (Var) String

func (e Var) String() string

type WithChildPath

type WithChildPath struct {
	OpticTypeExpr

	Optic OpticExpression
	I     reflect.Type
	A     reflect.Type
}

func (WithChildPath) Short

func (e WithChildPath) Short() string

func (WithChildPath) String

func (e WithChildPath) String() string

type WithComprehension

type WithComprehension struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (WithComprehension) Short

func (e WithComprehension) Short() string

func (WithComprehension) String

func (e WithComprehension) String() string

type WithEither

type WithEither struct {
	OpticTypeExpr
	P     reflect.Type
	Optic OpticExpression
}

func (WithEither) Short

func (e WithEither) Short() string

func (WithEither) String

func (e WithEither) String() string

type WithFunc

type WithFunc struct {
	OpticTypeExpr
	P     reflect.Type
	Optic OpticExpression
}

func (WithFunc) Short

func (e WithFunc) Short() string

func (WithFunc) String

func (e WithFunc) String() string

type WithIndex

type WithIndex struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (WithIndex) Short

func (e WithIndex) Short() string

func (WithIndex) String

func (e WithIndex) String() string

type WithMetrics

type WithMetrics struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (WithMetrics) Short

func (e WithMetrics) Short() string

func (WithMetrics) String

func (e WithMetrics) String() string

type WithOption

type WithOption struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (WithOption) Short

func (e WithOption) Short() string

func (WithOption) String

func (e WithOption) String() string

type WithPanic

type WithPanic struct {
	OpticTypeExpr
	Optic OpticExpression
}

func (WithPanic) Short

func (e WithPanic) Short() string

func (WithPanic) String

func (e WithPanic) String() string

type WithValidation

type WithValidation struct {
	OpticTypeExpr
	V     reflect.Type
	Optic OpticExpression
}

func (WithValidation) Short

func (e WithValidation) Short() string

func (WithValidation) String

func (e WithValidation) String() string

type WithVar

type WithVar struct {
	OpticTypeExpr
	WithVar OpticExpression
	Name    string
	Value   OpticExpression
}

func (WithVar) Short

func (e WithVar) Short() string

func (WithVar) String

func (e WithVar) String() string

Jump to

Keyboard shortcuts

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