-@      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                 ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? (c) Artem ChirkinBSD3chirkin@arch.ethz.chNone &'+,-FQVSame as EvidenceO, but allows to separate constraint function from the type it is applied to.QBring an instance of certain class or constaint satisfaction evidence into scope. Combine evidence Combine evidence 5Pattern match agains evidence to get constraints info       4(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone%&'+,-;=>?DFGQSTVdhijN"/Figure out whether the type-level dimension is  or !0. Useful for generalized inference functions.GADT to support : type class. Match against its constructors to know if k is Nat or XNat Working on Nat. Working on XNat.LConstraints given by an XNat type on possible values of a Nat hidden inside.cFriendly 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.Find out the type of ! constructor.Pattern-match against this to out the type of ! constructorThis class provides the & associated with a type-level natural.'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)3Singleton 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.Same as @Find out whether XNat! is of known or constrained type.Given XNat is knownGiven XNat is constrained unknownKnown natural number BUnknown natural number, known to be not smaller than the given Nat!6Either known or unknown at compile-time natural number$!- that is unknown at compile time. Same as @f, but for a dimension: Hide dimension size inside, but allow specifying its minimum possible value.%Statically known !&Same as Dim pattern, but constrained to Nat kind.'LIndependently 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.( Similar to A from   , but returns B.) Similar to A from   , but returns B.* Similar to C from   .+%Change the minimum allowed size of a  Dim (XN x)4, while testing if the value inside satisfies it.,+% with explicitly-passed constraining Dim to avoid AllowAmbiguousTypes.-#Decrease minimum allowed size of a  Dim (XN x)..kWe 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)`./kWe either get evidence that this function was instantiated with the same type-level numbers, or Nothing.0Ordering of dimension values.1Ordering of dimension values.7MinDim implies (<=)o, but this fact is not so clear to GHC. This function assures the type system that the relation takes place.D8This 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/'&%$ !"#()*+,-./01234567/!"# '&%$()*./01+,-234567 EFGHIJ!"#'&%$(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone,-;<=>?AFST[ K,Another data type to make Reverse injective.LA 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@Represent a triple of lists forming a relation `as ++ bs ~ asbs`g$Synonym for an empty type-level listh&Reverse a type-level list (injective!)i&Prefix-style synonym for concatenationjList concatenationkPrefix-style synonym for snocl*Synonym for a type-level snoc (injective!)mPrefix-style synonym for consneSynonym for a type-level cons (injective, since this is just a synonym for the list constructor)YZ[\]^_`abcdefghijklmnjlngmk`_^]ihfe\[ZdcbaYKMNLOPj5l5n5(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone%&',-;<=>?DFQSTVdhpp]Representable type lists. Allows getting type information about list structure at runtime.qGet type-level constructed listQ"A list of evidence for constraintsrA list of type proxiessType-indexed listtReverse a typed listu3Constructing a type-indexed list from the other endv5Constructing a type-indexed list in the canonical wayw Constructing a type-indexed listx"Zero-length type list; synonym to y.yZero-length type listzPattern matching against this allows manipulating lists of constraints. Useful when creating functions that change the shape of dimensions.{%Pattern matching against this causes pc instance come into scope. Also it allows constructing a term-level list out of a constraint.,Map a function over contents of a typed listGet a constructible r from any other s/; Pattern matching agains the result brings p constraint into the scope:  case types ts of TypeList -> ...R8This 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{zvutpqr|}~STUVWXYZ[\pqs]sywx{zvutw5(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone!%&',-13456;<=>?DFKQSTVdh "A tuple indexed by a list of types#This is an almost complete copy of   by (c) Andy Gill 2001. Constructing a type-indexed list Constructing a type-indexed listGrow a tuple on the left O(1).AGrow a tuple on the left while evaluating arguments to WHNF O(1).MGrow a tuple on the right. Note, it traverses an element list inside O(n).pGrow a tuple on the right while evaluating arguments to WHNF. Note, it traverses an element list inside O(n).^Internal (non-exported) _ helper for ` See Note [Function coercion] in  Data.Foldable for more details.Ord 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{vuts555555(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone!%&',-13456;<=>?DFKQSTVdh "A tuple indexed by a list of types#This is an almost complete copy of   by (c) Andy Gill 2001. Constructing a type-indexed list Constructing a type-indexed listGrow a tuple on the left O(1).AGrow a tuple on the left while evaluating arguments to WHNF O(1).MGrow a tuple on the right. Note, it traverses an element list inside O(n).pGrow a tuple on the right while evaluating arguments to WHNF. Note, it traverses an element list inside O(n).aInternal (non-exported) _ helper for ` See Note [Function coercion] in  Data.Foldable for more details.Ord 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{vuts555555(c) Artem ChirkinBSD3chirkin@arch.ethz.chNonesxyw{vut(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone%&'+,-;<=>?CDFGQSTVdhSynonym for (+:) that treats Nat values 0 and 1 in a special way: it preserves the property that all dimensions are greater than 1.Synonym for (:+) that treats Nat values 0 and 1 in a special way: it preserves the property that all dimensions are greater than 1.$Know the structure of each dimension Constrain Nat dimensions hidden behind XNats.Map XDims onto Dims (injective)Map Dims onto XDims (injective)FGet 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]TSame as SomeNat, but for Dimensions: Hide all information about Dimensions insideType-level dimensionality O(1).?An easy way to convert Nat-indexed dims into XNat-indexed dims.Pattern-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. O(Length ds)  and  for each individual dimension.O(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.=Convert `Dims xs` to a plain haskell list of dimension sizes O(1).^Convert a plain haskell list of dimension sizes into an unknown type-level dimensionality O(1).Product of all dimension sizes  O(Length xs).Product of all dimension sizes  O(Length xs).4Get XNat-indexed dims given their fixed counterpart.4Get XNat-indexed dims given their fixed counterpart.fWe either get evidence that this function was instantiated with the same type-level Dimensions, or b  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)`.fWe either get evidence that this function was instantiated with the same type-level Dimensions, or b  O(Length xs).Compare 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)Compare 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. Similar to c or  asProxyTypeOf.; to be used on such implicit functions as , dimMax, etc. Similar to  asProxyTypeOfH, Give a hint to type checker to fix the type of a function argument.d8This 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-reflectionX&'%$ !"#()*+,-./01234567pqrsywx{vut)sywx{vutpqrefghijkls66 (c) Artem ChirkinBSD3chirkin@arch.ethz.chNone&'+,-16;<=CDFKTVhijkType-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 m instance: nR gives an offset of the index in a flat 1D array; this is in line with a weird m instance of  type.OThis type is used to index a single dimension; the range of indices is from 1 to n.Note, this type has a weird m instance:fromEnum (Idx 7)6"The logic behind this is that the mY 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`.o!Offset difference of two indices  idx1 - idx2p%Step dimension index by an Int offset%DWith this instance we can slightly reduce indexing expressions, e.g. +x ! (1 :* 2 :* 4) == x ! (1 :* 2 :* 4 :* U)'Compare 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 fromEnuma&'%$ !"#()*+,-./01234567pqrsxyw{vut  (c) Artem ChirkinBSD3chirkin@arch.ethz.chNone,F18Go over all dimensions keeping track of index and offset2IGo over all dimensions in reverse order keeping track of index and offset38Go over all dimensions keeping track of index and offset4-Go over all dimensions keeping track of index5-Go over all dimensions keeping track of index64Go over all dimensions keeping track of total offset74Go over all dimensions keeping track of total offset8>Go over all dimensions in reverse order keeping track of index9:Fold over all dimensions keeping track of index and offset:KFold over all dimensions in reverse order keeping track of index and offset;/Fold over all dimensions keeping track of index<6Fold over all dimensions keeping track of total offset=@Fold over all dimensions in reverse order keeping track of index>Traverse 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.?Traverse 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.1Shape of a space"Function to call on each dimensionInitial offset Offset step Initial value2Shape of a space"Function to call on each dimensionInitial offset-Offset step (substracted from initial offset) Initial value3Shape of a space"Function to call on each dimensionInitial offset Offset step4Shape of a space"Function to call on each dimension Initial value5Shape of a space"Function to call on each dimension6Shape of a space'Function to call with each offset valueInitial offset Offset step Initial value7Shape of a space'Function to call with each offset valueInitial offset Offset step8Shape of a space"Function to call on each dimension Initial value9Shape of a space"Function to call on each dimensionInitial offset Offset step Initial value:Shape of a space"Function to call on each dimensionInitial offset-Offset step (substracted from initial offset) Initial value;Shape of a space"Function to call on each dimension Initial value<Shape of a space"Function to call on each dimensionInitial offset Offset step Initial value=Shape of a space"Function to call on each dimension Initial value>Initial indices Final indices"Function to call on each dimensionInitial offset (at index minBound :: Idxs ds:) Note, this is not an offset value at initial indices. Offset step initial value?Initial indices Final indices"Function to call on each dimension initial value123456789:;<=>?134567289;<:=>?qr(c) Artem ChirkinBSD3chirkin@arch.ethz.chNone &'%$ !"#()*+,-./01234567YZ[\]^_`abcdefghijklmnpqrsxyw{vut123456789:;<=>?s !"#$%&'()*+,-./01234543678.9:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~y|~x                    !"#$#%&%''(()*+,)-.-/0112233445657 8 9 : :;)dimensions-1.0.0.0-JqapYVXbO0lFbcgM5G0LVG 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 DimensionsdimsSomeDimsDimsXDims KnownDimslistDims someDimsValtotalDim totalDim'xDimsxDims'sameDims sameDims' compareDims compareDims' inSpaceOf asSpaceOf$fOrdTypedList0$fEqTypedList0$fReadSomeDims$fShowSomeDims $fOrdSomeDims $fEqSomeDims$fDimensionsk:$fDimensionsk[]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 someNatValreifyDimPatXDimPatNPatXNMagicDimDimSing ReversingSnocingREmptyRReverseSSingleSCons EvidenceList reifyRepListPatConsPatCNilPatSnocPatSNil PatReverse MagicRepList#. Coercible Data.FoldableelemGHC.BaseNothingconst reifyDimsPatKDims PatAsXDimsPatXDims MagicDimsGHC.EnumEnumfromEnumdiffIdxstepIdxStepSize