!X,EFE      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~            ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D (c) Artem ChirkinBSD3chirkin@arch.ethz.chNone &'+,-FQV dimensionsSame as EvidenceO, but allows to separate constraint function from the type it is applied to. dimensionsQBring an instance of certain class or constaint satisfaction evidence into scope.  dimensionsCombine evidence  dimensionsCombine evidence  dimensions5Pattern match agains evidence to get constraints info      4(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone%&'+,-;=>?DFGQSTVeijkU" dimensions/Figure out whether the type-level dimension is  or !0. Useful for generalized inference functions. dimensionsGADT to support : type class. Match against its constructors to know if k is Nat or XNat dimensions Working on Nat. dimensions Working on XNat. dimensionsLConstraints given by an XNat type on possible values of a Nat hidden inside. dimensionscFriendly error message if `m <= n` constraint is not satisfied. Use this type family instead of (<=) if possible or try 7 function as the last resort. dimensionsFind out the type of ! constructor dimensions.Pattern-match against this to out the type of ! constructor dimensionsThis class provides the & associated with a type-level natural. dimensions'Get value of type-level dim at runtime.0Note, this function is supposed to be used with TypeApplications , and the KnownDimj class has varying kind of the parameter; thus, the function has two type paremeters (kind and type of n ). For example, you can type::set -XTypeApplications:set -XDataKinds:t dim @Nat @3dim @Nat @3 :: Dim 3:set -XTypeOperators:t dim @_ @(13 - 6)dim @_ @(13 - 6) :: Dim 7:t dim @_ @(N 17)dim @_ @(N 17) :: Dim (N 17) dimensions3Singleton type to store type-level dimension value.On the one hand, it can be used to let type-inference system know relations between type-level naturals. On the other hand, this is just a newtype wrapper on the Word type.Usually, the type parameter of Dim is either Nat or XNat=. If dimensionality of your data is known in advance, use NatY; if you know the size of some dimensions, but do not know the size of others, use XNats to represent them. dimensionsSame as E dimensionsFind out whether XNat! is of known or constrained type. dimensionsGiven XNat is known dimensionsGiven XNat is constrained unknown dimensionsKnown natural number  dimensionsBUnknown natural number, known to be not smaller than the given Nat! dimensions6Either known or unknown at compile-time natural number$ dimensions!- that is unknown at compile time. Same as Ef, but for a dimension: Hide dimension size inside, but allow specifying its minimum possible value.% dimensionsStatically known !& dimensionsSame as Dim pattern, but constrained to Nat kind.' dimensionsLIndependently of the kind of type-level number, construct an instance of  from it.$Match against this pattern to bring < instance into scope when you don't know the kind of the Dim parameter.( dimensions Similar to F from   , but returns G.) dimensions Similar to F from   , but returns G.* dimensions Similar to H from   .+ dimensions%Change the minimum allowed size of a  Dim (XN x)4, while testing if the value inside satisfies it., dimensions+% with explicitly-passed constraining Dim to avoid AllowAmbiguousTypes.- dimensions#Decrease minimum allowed size of a  Dim (XN x).. dimensionskWe either get evidence that this function was instantiated with the same type-level numbers, or Nothing.Note, this function works on Nat%-indexed dimensions only, because  Dim (XN x)) does not have runtime evidence to infer x6 and `KnownDim x` does not imply `KnownDim (XN x)`./ dimensionskWe either get evidence that this function was instantiated with the same type-level numbers, or Nothing.0 dimensionsOrdering of dimension values.1 dimensionsOrdering of dimension values.7 dimensionsMinDim implies (<=)o, but this fact is not so clear to GHC. This function assures the type system that the relation takes place.I dimensions8This function does GHC's magic to convert user-supplied & function to create an instance of d typeclass at runtime. The trick is taken from Edward Kmett's reflection library explained in Chttps://www.schoolofhaskell.com/user/thoughtpolice/using-reflection/'&%$ !"#()*+,-./012345673!"# '&%$'&%$()*./01+,-234567(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone,-;<=>?AFSTc J dimensions,Another data type to make Reverse injective.K dimensionsA special data type that can have either a single element, or more than two. This feature is not enforced in the type system - this is just a way to make injective Snoc.Y dimensions@Represent a triple of lists forming a relation `as ++ bs ~ asbs`g dimensions$Synonym for an empty type-level listh dimensions&Reverse a type-level list (injective!)i dimensions&Prefix-style synonym for concatenationj dimensionsList concatenationk dimensionsPrefix-style synonym for snocl dimensions*Synonym for a type-level snoc (injective!)m dimensionsPrefix-style synonym for consn dimensionseSynonym for a type-level cons (injective, since this is just a synonym for the list constructor)YZ[\]^_`abcdefghijklmnjlngmk`_^]ihfe\[ZdcbaYj5l5n5(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone%&',-;<=>?DFQSTVei{vp dimensions]Representable type lists. Allows getting type information about list structure at runtime.q dimensionsGet type-level constructed listL dimensions"A list of evidence for constraintsr dimensionsA list of type proxiess dimensionsType-indexed listt dimensionsReverse a typed listu dimensions3Constructing a type-indexed list from the other endv dimensions5Constructing a type-indexed list in the canonical wayw dimensions Constructing a type-indexed listx dimensions"Zero-length type list; synonym to y.y dimensionsZero-length type listz dimensionsPattern matching against this allows manipulating lists of constraints. Useful when creating functions that change the shape of dimensions.{ dimensions%Pattern matching against this causes pc instance come into scope. Also it allows constructing a term-level list out of a constraint. dimensions,Map a function over contents of a typed list dimensionsGet a constructible r from any other s/; Pattern matching agains the result brings p constraint into the scope:  case types ts of TypeList -> ...M dimensions8This function does GHC's magic to convert user-supplied q& function to create an instance of pd typeclass at runtime. The trick is taken from Edward Kmett's reflection library explained in Chttps://www.schoolofhaskell.com/user/thoughtpolice/using-reflection2YZ[\]^_`abcdefghijklmnpqrsywx{zvut|}~$sywx{zvutywx{zvutpqr|}~w5(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone!%&',-13456;<=>?DFKQSTVeiq  dimensions"A tuple indexed by a list of types dimensions#This is an almost complete copy of   by (c) Andy Gill 2001. dimensions Constructing a type-indexed list dimensions Constructing a type-indexed list dimensionsGrow a tuple on the left O(1). dimensionsAGrow a tuple on the left while evaluating arguments to WHNF O(1). dimensionsMGrow a tuple on the right. Note, it traverses an element list inside O(n). dimensionspGrow a tuple on the right while evaluating arguments to WHNF. Note, it traverses an element list inside O(n).N dimensionsInternal (non-exported) O helper for P See Note [Function coercion] in  Data.Foldable for more details. dimensionsOrd instance of the Tuple implements inverse lexicorgaphic ordering. That is, the last element in the tuple is the most significant one.:Note, this will never work on infinite-dimensional tuples!sywx{vutsywx{vutywx{vut555555(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone!%&',-13456;<=>?DFKQSTVei'  dimensions"A tuple indexed by a list of types dimensions#This is an almost complete copy of   by (c) Andy Gill 2001. dimensions Constructing a type-indexed list dimensions Constructing a type-indexed list dimensionsGrow a tuple on the left O(1). dimensionsAGrow a tuple on the left while evaluating arguments to WHNF O(1). dimensionsMGrow a tuple on the right. Note, it traverses an element list inside O(n). dimensionspGrow a tuple on the right while evaluating arguments to WHNF. Note, it traverses an element list inside O(n).Q dimensionsInternal (non-exported) O helper for P See Note [Function coercion] in  Data.Foldable for more details. dimensionsOrd instance of the Tuple implements inverse lexicorgaphic ordering. That is, the last element in the tuple is the most significant one.:Note, this will never work on infinite-dimensional tuples!sywx{vutsywx{vutywx{vut555555(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone:sywx{vut(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone%&'+,-;<=>?CDFGQSTVei dimensionsSynonym for (+:) that treats Nat values 0 and 1 in a special way: it preserves the property that all dimensions are greater than 1. dimensionsSynonym for (:+) that treats Nat values 0 and 1 in a special way: it preserves the property that all dimensions are greater than 1. dimensions$Know the structure of each dimension dimensions Constrain Nat dimensions hidden behind XNats. dimensionsMap XDims onto Dims (injective) dimensionsMap Dims onto XDims (injective) dimensions Analogous to (, but weaker and more specific (list of !7). This class is used to check if an existing fixed q satisfy constraints imposed by some interface (e.g. all dimensions are greater than 2). It is weaker than Y in that it only requires knowledge of constraints rather than exact dimension values. dimensionsGiven a @, test if its runtime value satisfies constraints imposed by  XDimensions, and returns it back being !-indexed on success.qThis function allows to guess safely individual dimension values, as well as the length of the dimension list. dimensionsPut runtime evidence of 2 value inside function constraints. Similar to  or KnownNat?, but for lists of numbers. Normally, the kind paramater is  (known dimenionality) or !. (either known or constrained dimensionality). dimensionsFGet dimensionality of a space at runtime, represented as a list of .0Note, this function is supposed to be used with TypeApplications , and the  Dimensionsj class has varying kind of the parameter; thus, the function has two type paremeters (kind and type of ds ). For example, you can type::set -XTypeApplications:set -XDataKinds:t dims @_ @'[N 17, N 12],dims @_ @'[N 17, N 12] :: Dims '[N 17, N 12]:t dims @XNat @'[]dims @XNat @'[] :: Dims '[]:t dims @_ @(Tail '[3,2,5,7])-dims @_ @(Tail '[3,2,5,7]) :: Dims '[2, 5, 7] dimensionsTSame as SomeNat, but for Dimensions: Hide all information about Dimensions inside dimensionsType-level dimensionality O(1). dimensions?An easy way to convert Nat-indexed dims into XNat-indexed dims. dimensionsPattern-matching against this constructor reveals Nat-kinded list of dims, pretending the dimensionality is known at compile time within the scope of the pattern match. This is the main recommended way to get F at runtime; for example, reading a list of dimensions from a file.,In order to use this pattern, one must know XNat8 type constructors in each dimension at compile time. dimensions O(Length ds)  and  for each individual dimension. dimensionsO(1)4 Pattern-matching against this constructor brings a  instance into the scope. Thus, you can do arbitrary operations on your dims and use this pattern at any time to reconstruct the class instance at runtime. dimensions=Convert `Dims xs` to a plain haskell list of dimension sizes O(1). dimensions^Convert a plain haskell list of dimension sizes into an unknown type-level dimensionality O(1). dimensionsProduct of all dimension sizes  O(Length xs). dimensionsProduct of all dimension sizes  O(Length xs). dimensions4Get XNat-indexed dims given their fixed counterpart. dimensions4Get XNat-indexed dims given their fixed counterpart. dimensionsfWe either get evidence that this function was instantiated with the same type-level Dimensions, or R  O(Length xs).Note, this function works on Nat%-indexed dimensions only, because  Dims '[XN x]) does not have runtime evidence to infer x6 and `KnownDim x` does not imply `KnownDim (XN x)`. dimensionsfWe either get evidence that this function was instantiated with the same type-level Dimensions, or R  O(Length xs). dimensionsCompare dimensions by their size in lexicorgaphic order from the last dimension to the first dimension (the last dimension is the most significant one). Literally, GcompareDims a b = compare (reverse $ listDims a) (reverse $ listDims b) dimensionsCompare dimensions by their size in lexicorgaphic order from the last dimension to the first dimension (the last dimension is the most significant one)  O(Length xs). Literally, GcompareDims a b = compare (reverse $ listDims a) (reverse $ listDims b)This is the same compare rule, as for Idxs.  dimensions Similar to S or  asProxyTypeOf.; to be used on such implicit functions as , dimMax, etc.  dimensions Similar to  asProxyTypeOfH, Give a hint to type checker to fix the type of a function argument.T dimensions8This function does GHC's magic to convert user-supplied & function to create an instance of d typeclass at runtime. The trick is taken from Edward Kmett's reflection library explained in Chttps://www.schoolofhaskell.com/user/thoughtpolice/using-reflectionZ&'%$ !"#()*+,-./01234567pqrsywx{vut  6sywx{vutywx{vut  pqr66 (c) Artem ChirkinBSD3chirkin@arch.ethz.chNone&'+,-16;<=CDFKTVijk dimensionskType-level dimensional indexing with arbitrary Word values inside. Most of the operations on it require  constraint, because the Idxs3 itself does not store info about dimension bounds.Note, this type has a special U instance: VR gives an offset of the index in a flat 1D array; this is in line with a weird U instance of  type. dimensionsOThis type is used to index a single dimension; the range of indices is from 1 to n.Note, this type has a weird U instance:fromEnum (Idx 7)6"The logic behind this is that the UY class is used to transform indices to offsets. That is, element of an array at index  k :: Idx n5 is the element taken by an offset `k - 1 :: Int`.W dimensions!Offset difference of two indices  idx1 - idx2X dimensions%Step dimension index by an Int offset* dimensionsDWith this instance we can slightly reduce indexing expressions, e.g. +x ! (1 :* 2 :* 4) == x ! (1 :* 2 :* 4 :* U), dimensionsCompare indices by their importance in lexicorgaphic order from the last dimension to the first dimension (the last dimension is the most significant one)  O(Length xs). Literally, Ccompare a b = compare (reverse $ listIdxs a) (reverse $ listIdxs b)This is the same compare rule, as for v. Another reason to reverse the list of indices is to have a consistent behavior when calculating index offsets: sort == sortOn fromEnumc&'%$ !"#()*+,-./01234567pqrsywx{vut   !"  !" (c) Artem ChirkinBSD3chirkin@arch.ethz.chNone,FA6 dimensions8Go over all dimensions keeping track of index and offset7 dimensionsIGo over all dimensions in reverse order keeping track of index and offset8 dimensions8Go over all dimensions keeping track of index and offset9 dimensions-Go over all dimensions keeping track of index: dimensions-Go over all dimensions keeping track of index; dimensions4Go over all dimensions keeping track of total offset< dimensions4Go over all dimensions keeping track of total offset= dimensions>Go over all dimensions in reverse order keeping track of index> dimensions:Fold over all dimensions keeping track of index and offset? dimensionsKFold over all dimensions in reverse order keeping track of index and offset@ dimensions/Fold over all dimensions keeping track of indexA dimensions6Fold over all dimensions keeping track of total offsetB dimensions@Fold over all dimensions in reverse order keeping track of indexC dimensionsTraverse from the first index to the second index in each dimension. You can combine positive and negative traversal directions along different dimensions.{Note, initial and final indices are included in the range; the argument function is guaranteed to execute at least once.D dimensionsTraverse from the first index to the second index in each dimension. You can combine positive and negative traversal directions along different dimensions.{Note, initial and final indices are included in the range; the argument function is guaranteed to execute at least once.6 dimensionsShape of a space dimensions"Function to call on each dimension dimensionsInitial offset dimensions Offset step dimensions Initial value7 dimensionsShape of a space dimensions"Function to call on each dimension dimensionsInitial offset dimensions-Offset step (substracted from initial offset) dimensions Initial value8 dimensionsShape of a space dimensions"Function to call on each dimension dimensionsInitial offset dimensions Offset step9 dimensionsShape of a space dimensions"Function to call on each dimension dimensions Initial value: dimensionsShape of a space dimensions"Function to call on each dimension; dimensionsShape of a space dimensions'Function to call with each offset value dimensionsInitial offset dimensions Offset step dimensions Initial value< dimensionsShape of a space dimensions'Function to call with each offset value dimensionsInitial offset dimensions Offset step= dimensionsShape of a space dimensions"Function to call on each dimension dimensions Initial value> dimensionsShape of a space dimensions"Function to call on each dimension dimensionsInitial offset dimensions Offset step dimensions Initial value? dimensionsShape of a space dimensions"Function to call on each dimension dimensionsInitial offset dimensions-Offset step (substracted from initial offset) dimensions Initial value@ dimensionsShape of a space dimensions"Function to call on each dimension dimensions Initial valueA dimensionsShape of a space dimensions"Function to call on each dimension dimensionsInitial offset dimensions Offset step dimensions Initial valueB dimensionsShape of a space dimensions"Function to call on each dimension dimensions Initial valueC dimensionsInitial indices dimensions Final indices dimensions"Function to call on each dimension dimensionsInitial offset (at index minBound :: Idxs ds:) Note, this is not an offset value at initial indices. dimensions Offset step dimensions initial valueD dimensionsInitial indices dimensions Final indices dimensions"Function to call on each dimension dimensions initial value6789:;<=>?@ABCD689:;<7=>@A?BCD(c) Artem ChirkinBSD3chirkin@arch.ethz.chNoneB &'%$ !"#()*+,-./01234567YZ[\]^_`abcdefghijklmnpqrsywx{vut   !"6789:;<=>?@ABCDY !"#$%&'()*+,-./01234543678.9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~y|~x                         !"#$#%&'(') * +,(dimensions-1.0.1.1-7RcT9arRqD18mMNFhSmcR Numeric.DimNumeric.Type.EvidenceNumeric.Type.ListNumeric.TypedListNumeric.Tuple.StrictNumeric.Tuple.Lazy Numeric.TupleNumeric.Dimensions.DimsNumeric.Dimensions.IdxsNumeric.Dimensions.FoldGHCTypeLits Data.FunctorIdentityNumeric.Dimensionsghc-prim GHC.TypesNatbase GHC.TypeNats+*^-CmpNat Evidence'E'EvidenceEsumEvs+!+ withEvidence toEvidence toEvidence' KnownDimKinddimKindDimKindDimNatDimXNatFixedDimMinDim KnownXNatTypexNatTypeKnownDimdimDimSomeDimXNatTypeNtXNtNXNXNatDxDnDdimValdimVal' someDimVal constrain constrainByrelaxsameDimsameDim' compareDim compareDim'plusDimminusDim minusDimMtimesDimpowerDim inferDimLE $fShowDim$fOrdDim $fOrdDim0$fEqDim$fEqDim0 $fReadDim$fKnownDimXNatN$fKnownDimNat20$fKnownDimNat19$fKnownDimNat18$fKnownDimNat17$fKnownDimNat16$fKnownDimNat15$fKnownDimNat14$fKnownDimNat13$fKnownDimNat12$fKnownDimNat11$fKnownDimNat10$fKnownDimNat9$fKnownDimNat8$fKnownDimNat7$fKnownDimNat6$fKnownDimNat5$fKnownDimNat4$fKnownDimNat3$fKnownDimNat2$fKnownDimNat1$fKnownDimNat0$fKnownDimNatn$fKnownXNatTypeXN$fKnownXNatTypeN$fKnownDimKindXNat$fKnownDimKindNat ConcatListMapAllLengthLastInitTailHeadIsSuffixIsPrefixPrefixSuffixDropTakeEmptyReverseConcat++Snoc+:Cons:+$fConcatListkasbsasbsRepresentableListtListTypeList TypedList:*UEvListconssnocreversetakedropheadtailinitlastlengthsplitAtconcatmaptypesorder'order$fRepresentableListk:$fRepresentableListk[]TupleIdrunId:!:$*$*!$*!* $fMonadZipId $fMonadFixId $fMonadId$fApplicativeId $fFunctorId $fFoldableId$fShowId$fReadId$fReadTypedList$fShowTypedList$fOrdTypedList $fEqTypedList$fBoundedTypedList$fMonoidTypedList$fSemigroupTypedList$fBitsId $fBoundedId$fDataId$fEnumId$fEqId$fFiniteBitsId $fFloatingId$fFractionalId $fGenericId $fGeneric1Id $fIntegralId $fIsStringId$fIxId $fMonoidId$fNumId$fOrdId$fRealId $fRealFracId $fRealFloatId $fSemigroupId $fStorableId$fTraversableIdtoStrict fromStrict>::<KnownXNatTypes FixedDimsAsDimsAsXDims XDimensions constrainDims DimensionsdimsSomeDimsDimsXDims KnownDimslistDims someDimsValtotalDim totalDim'xDimsxDims'sameDims sameDims' compareDims compareDims' inSpaceOf asSpaceOf$fOrdTypedList0$fEqTypedList0$fReadSomeDims$fShowSomeDims $fOrdSomeDims $fEqSomeDims$fDimensionsk:$fDimensionsk[]$fXDimensions:$fXDimensions:0$fXDimensions[]IdxsIdxunIdxunsafeIdxFromWord idxFromWord idxToWordlistIdxs idxsFromWords$fNumIdx $fEnumIdx $fBoundedIdx $fShowIdx $fReadIdx$fEnumTypedList$fNumTypedList $fDataIdx $fGenericIdx $fGeneric1Idx $fIntegralIdx $fRealIdx $fStorableIdx$fEqIdx$fOrdIdxoverDimoverDimReverseoverDim_ overDimIdx overDimIdx_ overDimOff overDimOff_overDimReverseIdxfoldDimfoldDimReverse foldDimIdx foldDimOfffoldDimReverseIdx overDimPartoverDimPartIdxSomeNat GHC.TypeLitsnatValWord someNatValreifyDim ReversingSnocing EvidenceList reifyRepList#. Coercible Data.FoldableelemGHC.BaseNothingconst reifyDimsGHC.EnumEnumfromEnumdiffIdxstepIdx