| License | MIT |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Language.Egison.Type.Index
Description
This module defines tensor index types for the Egison type system. Indices can be superscript (contravariant, ~i) or subscript (covariant, _i).
Synopsis
- data IndexKind
- data Index
- type IndexSpec = [Index]
- newtype IndexTyVar = IndexTyVar String
- isSupSubPair :: Index -> Index -> Bool
- isSuperscript :: Index -> Bool
- isSubscript :: Index -> Bool
- isPlaceholder :: Index -> Bool
- indexSymbol :: Index -> Maybe String
- flipIndexKind :: IndexKind -> IndexKind
Documentation
The kind of tensor index
Constructors
| Superscript | Contravariant index, written as ~i |
| Subscript | Covariant index, written as _i |
Instances
| Generic IndexKind Source # | |
Defined in Language.Egison.Type.Index | |
| Show IndexKind Source # | |
| Eq IndexKind Source # | |
| Ord IndexKind Source # | |
| Hashable IndexKind Source # | |
Defined in Language.Egison.Type.Index | |
| type Rep IndexKind Source # | |
A tensor index
Constructors
| IndexSym IndexKind String | Named index, e.g., _i, ~j |
| IndexPlaceholder IndexKind | Placeholder index, e.g., _#, ~# |
| IndexVar String | Index variable (for type-level computation) |
Instances
newtype IndexTyVar Source #
Index variable for type schemes (type-level)
Constructors
| IndexTyVar String |
Instances
| Generic IndexTyVar Source # | |||||
Defined in Language.Egison.Type.Index Associated Types
| |||||
| Show IndexTyVar Source # | |||||
Defined in Language.Egison.Type.Index Methods showsPrec :: Int -> IndexTyVar -> ShowS # show :: IndexTyVar -> String # showList :: [IndexTyVar] -> ShowS # | |||||
| Eq IndexTyVar Source # | |||||
Defined in Language.Egison.Type.Index | |||||
| Ord IndexTyVar Source # | |||||
Defined in Language.Egison.Type.Index Methods compare :: IndexTyVar -> IndexTyVar -> Ordering # (<) :: IndexTyVar -> IndexTyVar -> Bool # (<=) :: IndexTyVar -> IndexTyVar -> Bool # (>) :: IndexTyVar -> IndexTyVar -> Bool # (>=) :: IndexTyVar -> IndexTyVar -> Bool # max :: IndexTyVar -> IndexTyVar -> IndexTyVar # min :: IndexTyVar -> IndexTyVar -> IndexTyVar # | |||||
| type Rep IndexTyVar Source # | |||||
Defined in Language.Egison.Type.Index type Rep IndexTyVar = D1 ('MetaData "IndexTyVar" "Language.Egison.Type.Index" "egison-5.0.0-IKLJXBVxR779jp4wYu1Icq" 'True) (C1 ('MetaCons "IndexTyVar" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String))) | |||||
isSupSubPair :: Index -> Index -> Bool Source #
Check if two indices form a superscript-subscript pair (for contraction) For example, ~i and _i form a pair
isSuperscript :: Index -> Bool Source #
Check if an index is a superscript
isSubscript :: Index -> Bool Source #
Check if an index is a subscript
isPlaceholder :: Index -> Bool Source #
Check if an index is a placeholder