"-      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable Safe,-;<=>?FSTVh'Apply list of params to N-ary function.N-ary function from n arguments of type t to value of type r.(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable None&'+,-;<=>?FSTVh-Enumeration of length n+ starting from given value with given step.Enumeration of length n starting from given value. Fill the list of length n with the same values. Constraint of the . function. Constraint of the - function. Right fold of a list of length n with no base element.Left fold of a list of length n.Right fold of a list of length n with no base element.Right fold of a list of length n.DCheck if all elements of the list satisfy the predicate. Type param n is the length of the list.5Apply function to all elements of a list. Type param n is the length of the list.-Filter list with given predicate. Type param n is the length of the list.6Zip 2 lists together using given function. Type param n! is the length of the first list.Unzip a list. Type param n is the length of the list.!Zip 3 lists together. Type param n! is the length of the first list.!!Zip 2 lists together. Type param n! is the length of the first list.#/Number of resulting chunks when list of length len split by chunks of length clen.$+Split list into chunks of the given length c. n is length of the list.&Take n elements from a list(Drop n elements from a list.*Append two lists. Type param l is the length of the left list.,Split list at n -th element.-'Map each element of the list of length n& to a monoid, and combine the results..*Sum of the elements of the list of length n.Starting value.Step.Starting value.*  !"#$%&'()*+,-.**+()&',$%#!"  - .    !"$%&'()*+(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable None&'+,-.068;<=>?FQSTVh7UDemote a type-level list to value-level list with a type-indexed function. The function takes list element as type parameter x and applies constraints ctx for that element.WMake a constraint for type x :: kx from -?, or partially applied constraint, or make an empty constraint.XDemote type-level list of ..UVWXY XY[ZWUV]\UVXY(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable None&'+,-.068;<=>?FQSTVhXe^Constraints for / instance for  dims e._Constraints for 0 instance for  dims e.`Constraints for 1 instance for  dims e.aConstraints for 2 instance for  dims e.b#Shape of the tensor after appending(:kind! DimsAfterAppend 0 [2,3,4] [5,3,4]*DimsAfterAppend 0 [2,3,4] [5,3,4] :: [Nat] = '[7, 3, 4](:kind! DimsAfterAppend 1 [2,3,4] [2,5,4]*DimsAfterAppend 1 [2,3,4] [2,5,4] :: [Nat] = '[2, 8, 4](:kind! DimsAfterAppend 2 [2,3,4] [2,3,5]*DimsAfterAppend 2 [2,3,4] [2,3,5] :: [Nat] = '[2, 3, 9]cConstraints for .d"Shape of the tensor after snoc'ing:kind! DimsAfterSnoc 0 [2,3,4] DimsAfterSnoc 0 [2,3,4] :: [Nat] = '[3, 3, 4]:kind! DimsAfterSnoc 1 [2,3,4] DimsAfterSnoc 1 [2,3,4] :: [Nat] = '[2, 4, 4]:kind! DimsAfterSnoc 2 [2,3,4] DimsAfterSnoc 2 [2,3,4] :: [Nat] = '[2, 3, 5]e/Shape of subtensor being snoc'ed to the tensor dims.":kind! SnocSubtensorDims 0 [2,3,4]%SnocSubtensorDims 0 [2,3,4] :: [Nat] = '[1, 3, 4]":kind! SnocSubtensorDims 1 [2,3,4]%SnocSubtensorDims 1 [2,3,4] :: [Nat] = '[2, 1, 4]":kind! SnocSubtensorDims 2 [2,3,4]%SnocSubtensorDims 2 [2,3,4] :: [Nat] = '[2, 3, 1]fConstraints for .g"Shape of the tensor after cons'ing:kind! DimsAfterCons 0 [2,3,4] DimsAfterCons 0 [2,3,4] :: [Nat] = '[3, 3, 4]:kind! DimsAfterCons 1 [2,3,4] DimsAfterCons 1 [2,3,4] :: [Nat] = '[2, 4, 4]:kind! DimsAfterCons 2 [2,3,4] DimsAfterCons 2 [2,3,4] :: [Nat] = '[2, 3, 5]h/Shape of subtensor being cons'ed to the tensor dims.":kind! ConsSubtensorDims 0 [2,3,4]%ConsSubtensorDims 0 [2,3,4] :: [Nat] = '[1, 3, 4] ":kind! ConsSubtensorDims 1 [2,3,4]%ConsSubtensorDims 1 [2,3,4] :: [Nat] = '[2, 1, 4] ":kind! ConsSubtensorDims 2 [2,3,4]%ConsSubtensorDims 2 [2,3,4] :: [Nat] = '[2, 3, 1] iConstraints for .3Worker function for .4%Shape of the slice to be removed. axis is the index of dimension in dims  indexOnAxis is offset of the slice along axis.5.Starting index of the slice to be removed. axis is the index of dimension in dims  indexOnAxis is offset of the slice along axis.jShape of a tensor dims after removing a slice at index along axis.":kind! DimsAfterRemove 0 0 [2,3,4]$DimsAfterRemove 0 0 [2,3,4] :: [Nat] = '[1, 3, 4]":kind! DimsAfterRemove 1 0 [2,3,4]$DimsAfterRemove 1 0 [2,3,4] :: [Nat] = '[2, 2, 4]":kind! DimsAfterRemove 2 0 [2,3,4]$DimsAfterRemove 2 0 [2,3,4] :: [Nat] = '[2, 3, 3]kConstraints for .lConstraints for .6Worker function for mConstraints for .nConstraints for .7Worker function for .oConstraints for .pConstraints for .qConstraints for  function.8#Check if index is inside the slice.9 Map over indexes.r*Check each element of the tensor of shape dims# if it is inside the slice from  startIndex of shape  sliceDimsh. The slice must be contained inside the tensor. All dimensions of the slice must be positive.  startIndex,  sliceDims and dims must have the same length..:kind! ElemsInSlice '[0,0,0] '[2,2,2] '[2,3,4]1ElemsInSlice '[0,0,0] '[2,2,2] '[2,3,4] :: [Bool]?= '['True, 'True, 'False, 'False, 'True, 'True, 'False, 'False,A 'False, 'False, 'False, 'False, 'True, 'True, 'False, 'False,A 'True, 'True, 'False, 'False, 'False, 'False, 'False, 'False].:kind! ElemsInSlice '[1,1,0] '[1,2,4] '[2,3,4]1ElemsInSlice '[1,1,0] '[1,2,4] '[2,3,4] :: [Bool]C= '['False, 'False, 'False, 'False, 'False, 'False, 'False, 'False,C 'False, 'False, 'False, 'False, 'False, 'False, 'False, 'False,; 'True, 'True, 'True, 'True, 'True, 'True, 'True, 'True]s-Index of the end of the slice of the tensor.  startIndex2 parameter is the starting index of the slice,  sliceDims is the shape of the slice, dims is the shape of the tensor. The slice must be contained inside the tensor. All dimensions of the slice must be positive.  startIndex,  sliceDims and dimsw must have the same length. If you want to get slice of lower rank than the tensor's, set one or more dimensions in  sliceDims to 1./:kind! SliceEndIndex '[0,0,0] '[2,2,2] '[2,3,4]1SliceEndIndex '[0,0,0] '[2,2,2] '[2,3,4] :: [Nat] = '[1, 1, 1]/:kind! SliceEndIndex '[1,1,0] '[1,2,4] '[2,3,4]1SliceEndIndex '[1,1,0] '[1,2,4] '[2,3,4] :: [Nat] = '[1, 2, 3]tConstraint for  function.uConstraint for  function.vConstraints for .wConstraint for  function.xConstraint for  function.yConstraint for  function.zConstraint for  function.{CIndex of the first element of the subtensor of the tensor of shape dims at indexk. This function returns index with number of dimensions equal to number of dimensions of the tensor.(:kind! SubtensorStartIndex '[1] '[2,3,4]*SubtensorStartIndex '[1] '[2,3,4] :: [Nat] = '[1, 0, 0]*:kind! SubtensorStartIndex '[0,1] '[2,3,4],SubtensorStartIndex '[0,1] '[2,3,4] :: [Nat] = '[0, 1, 0]*:kind! SubtensorStartIndex '[1,1] '[2,3,4],SubtensorStartIndex '[1,1] '[2,3,4] :: [Nat] = '[1, 1, 0]|(Shape of a subtensor of tensor of shape dims located at index$. Resulting shape is not normalized.":kind! SubtensorDims '[0] '[2,3,4]$SubtensorDims '[0] '[2,3,4] :: [Nat] = '[1, 3, 4]$:kind! SubtensorDims '[0,0] '[2,3,4]&SubtensorDims '[0,0] '[2,3,4] :: [Nat] = '[1, 1, 4]}BNumber of elements of all subtensors of a tensor with given shape dims.&:kind! SubtensorsElemsNumbers '[2,3,4](SubtensorsElemsNumbers '[2,3,4] :: [Nat] = '[12, 4, 1]$:kind! SubtensorsElemsNumbers '[4,4]&SubtensorsElemsNumbers '[4,4] :: [Nat] = '[4, 1]~ Subtensor at index of a tensor of shape dims.#:kind! Subtensor '[] '[2,3,4] Float!Subtensor '[] '[2,3,4] Float :: *= Tensor '[2, 3, 4] Float$:kind! Subtensor '[0] '[2,3,4] Float"Subtensor '[0] '[2,3,4] Float :: *= Tensor '[3, 4] Float&:kind! Subtensor '[0,0] '[2,3,4] Float$Subtensor '[0,0] '[2,3,4] Float :: *= Tensor '[4] Float(:kind! Subtensor '[0,0,0] '[2,3,4] Float&Subtensor '[0,0,0] '[2,3,4] Float :: *= Tensor '[] Float: Worker for .Constraints for  function.Nested list of given depth.:kind! NestedList 3 Float [[[Float]]]:kind! NestedList 2 Float [[Float]]Constraints for  function.Constraints for  function.Constraints for  function.;Constraints for .Constraints for .Constraints for .Constraints for .Number of elements in a tensor."Type of a tensor data constructor.%:kind! TensorConstructor '[2,2] Float#TensorConstructor '[2,2] Float :: *:= Float -> Float -> Float -> Float -> Tensor '[2, 2] FloatyData family of unboxed tensors. Dimensions of a tensor are represented as type-level list of naturals. For instance, Tensor [3] Float is a vector of 3 < elements; Tensor [4,3] Double* is a matrix with 4 rows 3 columns of = and so on.8Tensor data constructor for given size and element type.-Alias for a concrete tensor data constructor.tensor @[2,2] @Int 0 1 2 3Tensor'2'2 [[0,1],[2,3]];Build tensor from the list. The list must contain at least >, elements or method will throw an exception.Convert tensor to list.)Generate range of naturals starting from from param inclusive and up to to param inclusive.?4Ranges for each dimension of an index of the tensor.:kind! IndexesRanges '[2,3,4]!IndexesRanges '[2,3,4] :: [[Nat]]'= '['[0, 1], '[0, 1, 2], '[0, 1, 2, 3]]@Append two type-level lists.A Type-level B.-Sequence of all indexes in a tensor of shape dims.:kind! AllIndexes '[2,3,4]AllIndexes '[2,3,4] :: [[Nat]]?= '['[0, 0, 0], '[0, 0, 1], '[0, 0, 2], '[0, 0, 3], '[0, 1, 0],? '[0, 1, 1], '[0, 1, 2], '[0, 1, 3], '[0, 2, 0], '[0, 2, 1],? '[0, 2, 2], '[0, 2, 3], '[1, 0, 0], '[1, 0, 1], '[1, 0, 2],? '[1, 0, 3], '[1, 1, 0], '[1, 1, 1], '[1, 1, 2], '[1, 1, 3],3 '[1, 2, 0], '[1, 2, 1], '[1, 2, 2], '[1, 2, 3]]2Remove unit dimentions, i.e. dimensions with size 1.:kind! NormalizeDims '[2, 1, 3]'[2, 3]Convert multidimentional index in tensor of shape dims to flat index. index( parameter must have the same length as dims.%:kind! FlattenIndex '[1,1,1] '[2,3,4]%FlattenIndex '[1,1,1] '[2,3,4] :: Nat= 17+Check if all dimensions are greater than 0.C Version of D with explicit type application.#Pass tensor elements to a function.DwithTensor (matrix @2 @2 @Float 0 1 2 3) (\a b c d -> a * d - b * c)-2.0@withTensor (vector @2 @Float 3 4) (\x y -> sqrt $ x * x + y * y)5.0Dimensions of a tensor.Number of elements in a tensor.1Number of elements of all subtensors of a tensor.subtensorsElemsNumbers @[2,3,4][12,4,1]subtensorsElemsNumbers @[4,4][4,1]Add two tensors element-wise.#Substract two tensors element-wise.2Multiply every element of a tensor by given value."Tensor filled with given elements.Tensor filled with zeros.@Tensor which elements are enumeration starting from given value.PTensor which elements are enumeration starting from given value with given step.=Generate a tensor by applying the function to each index. ctx4 type parameter is a producer of constraint of kind kctx for each index. See   for more info.import Data.Singletonsjtype Ctx (dims :: [Nat]) (index :: [Nat]) = KnownNat (FlattenIndex index dims); $(genDefunSymbols [''Ctx])generate @[2,3,4] @Int @([Nat] ~> Constraint) @(CtxSym1 [2,3,4]) $ \(Proxy :: Proxy index) -> fromIntegral $ natVal (Proxy @(FlattenIndex index [2,3,4]))\Tensor'2'3'4 [[[0,1,2,3],[4,5,6,7],[8,9,10,11]],[[12,13,14,15],[16,17,18,19],[20,21,22,23]]]Convert tensor to nested list.!Extract subtensor at given index.6Extract elements of subtensor at given index. Like (, but without building actual subtensor.Set subtensor at given index.Like > but takes a list of elements instead of a tensor. Returns Nothing! if list has not enough elements.*Modify subtensor elements with a function."Lens for subtensor at given index.!let t = enumFromN @[2,3,4] @Int 0t Tensor'2'3'4 [[[ 0, 1, 2, 3] ,[ 4, 5, 6, 7]! ,[ 8, 9, 10, 11]] ,[[ 12, 13, 14, 15] ,[ 16, 17, 18, 19]" ,[ 20, 21, 22, 23]]]t ^. subtensor @'[0] Tensor'3'4 [[ 0, 1, 2, 3] ,[ 4, 5, 6, 7]! ,[ 8, 9, 10, 11]]t ^. subtensor @'[1] Tensor'3'4 [[ 12, 13, 14, 15] ,[ 16, 17, 18, 19]! ,[ 20, 21, 22, 23]]t ^. subtensor @'[0,0] Tensor'4 [ 0, 1, 2, 3]t ^. subtensor @'[1,0] Tensor'4 [ 12, 13, 14, 15] Lens for an element of a tensor.!let t = enumFromN @[2,3,4] @Int 0t Tensor'2'3'4 [[[ 0, 1, 2, 3] ,[ 4, 5, 6, 7]! ,[ 8, 9, 10, 11]] ,[[ 12, 13, 14, 15] ,[ 16, 17, 18, 19]" ,[ 20, 21, 22, 23]]]t ^. tensorElem @[1,1,1]17set (tensorElem @[1,1,1]) 0 t Tensor'2'3'4 [[[ 0, 1, 2, 3] ,[ 4, 5, 6, 7]! ,[ 8, 9, 10, 11]] ,[[ 12, 13, 14, 15] ,[ 16, 0, 18, 19]" ,[ 20, 21, 22, 23]]]!Lens for the slice starting from  startIndex of shape  sliceDims of the tensor of shape dims.#let t = (enumFromN @[2,3,4] @Int 0)t Tensor'2'3'4 [[[ 0, 1, 2, 3] ,[ 4, 5, 6, 7]! ,[ 8, 9, 10, 11]] ,[[ 12, 13, 14, 15] ,[ 16, 17, 18, 19]" ,[ 20, 21, 22, 23]]]t ^. slice @[0,0,0] @[2,2,2]Tensor'2'2'2 [[[ 0, 1] ,[ 4, 5]] ,[[ 12, 13] ,[ 16, 17]]]$set (slice @[0,0,0] @[2,2,2]) zero t Tensor'2'3'4 [[[ 0, 0, 2, 3] ,[ 0, 0, 6, 7]! ,[ 8, 9, 10, 11]] ,[[ 0, 0, 14, 15] ,[ 0, 0, 18, 19]" ,[ 20, 21, 22, 23]]]Extract slice of shape  sliceDims from a tensor of shape dims starting at  startIndex for each axis.GSame as slice but returns list of elements instead of tensor data type.EbFail when list representation of a tensor has less elements than tensor. This should never happen.Set elements of the slice.Like > but takes a list of elements instead of a tensor. Returns Nothing if list has less than  sliceDims elements.&Modify slice elements with a function.Remove a slice from the tensor. We can only remove slices which have one dimension fewer than the tensor, and which span from borders of the tensor to opposite borders of the tensor (i.e. contain all elements of the tensor in their dimensions).axis is the index of dimension in dims  indexOnAxis is offset along axis( that points to the slice to be removed.$For example, suppose we have tensor t :: Tensor '[2,3,4] Float6 that is, tensor made of two matrices of 3*4 elements.+If we want to remove first matrix we write remove @0 @0 t, if second - remove @0 @1 t.7If we want to remove n-th row in all matrices we write remove @1 @n t.:If we want to remove n-th column in all matrices we write remove @2 @n t.!let t = enumFromN @[2,3,4] @Int 0tTensor'2'3'4 [[[ 0, 1, 2, 3] ,[ 4, 5, 6, 7] ,[ 8, 9,10,11]] ,[[12,13,14,15] ,[16,17,18,19] ,[20,21,22,23]]]remove @0 @0 tTensor'1'3'4 [[[12,13,14,15] ,[16,17,18,19] ,[20,21,22,23]]]remove @1 @0 tTensor'2'2'4 [[[ 4, 5, 6, 7] ,[ 8, 9,10,11]] ,[[16,17,18,19] ,[20,21,22,23]]]remove @2 @0 tTensor'2'3'3 [[[ 1, 2, 3] ,[ 5, 6, 7] ,[ 9,10,11]] ,[[13,14,15] ,[17,18,19] ,[21,22,23]]]Prepend a subtensor along axis to the tensor with shape dimsDcons @0 (enumFromStepN @[3,4] @Int (-1) (-1)) (enumFromN @[2,3,4] 0) #Tensor'3'3'4 [[[ -1, -2, -3, -4]# ,[ -5, -6, -7, -8]$ ,[ -9, -10, -11, -12]]# ,[[ 0, 1, 2, 3]# ,[ 4, 5, 6, 7]$ ,[ 8, 9, 10, 11]]# ,[[ 12, 13, 14, 15]# ,[ 16, 17, 18, 19]% ,[ 20, 21, 22, 23]]]Dcons @1 (enumFromStepN @[2,4] @Int (-1) (-1)) (enumFromN @[2,3,4] 0)#Tensor'2'4'4 [[[ -1, -2, -3, -4]# ,[ 0, 1, 2, 3]# ,[ 4, 5, 6, 7]$ ,[ 8, 9, 10, 11]]# ,[[ -5, -6, -7, -8]# ,[ 12, 13, 14, 15]# ,[ 16, 17, 18, 19]% ,[ 20, 21, 22, 23]]]Dcons @2 (enumFromStepN @[2,3] @Int (-1) (-1)) (enumFromN @[2,3,4] 0)(Tensor'2'3'5 [[[ -1, 0, 1, 2, 3]( ,[ -2, 4, 5, 6, 7]) ,[ -3, 8, 9, 10, 11]]( ,[[ -4, 12, 13, 14, 15]( ,[ -5, 16, 17, 18, 19]* ,[ -6, 20, 21, 22, 23]]]Append a subtensor along axis to the tensor with shape dimsDsnoc @0 (enumFromN @[2,3,4] 0) (enumFromStepN @[3,4] @Int (-1) (-1)) #Tensor'3'3'4 [[[ 0, 1, 2, 3]# ,[ 4, 5, 6, 7]$ ,[ 8, 9, 10, 11]]# ,[[ 12, 13, 14, 15]# ,[ 16, 17, 18, 19]$ ,[ 20, 21, 22, 23]]# ,[[ -1, -2, -3, -4]# ,[ -5, -6, -7, -8]% ,[ -9, -10, -11, -12]]]Dsnoc @1 (enumFromN @[2,3,4] 0) (enumFromStepN @[2,4] @Int (-1) (-1))#Tensor'2'4'4 [[[ 0, 1, 2, 3]# ,[ 4, 5, 6, 7]# ,[ 8, 9, 10, 11]$ ,[ -1, -2, -3, -4]]# ,[[ 12, 13, 14, 15]# ,[ 16, 17, 18, 19]# ,[ 20, 21, 22, 23]% ,[ -5, -6, -7, -8]]]Dsnoc @2 (enumFromN @[2,3,4] 0) (enumFromStepN @[2,3] @Int (-1) (-1))(Tensor'2'3'5 [[[ 0, 1, 2, 3, -1]( ,[ 4, 5, 6, 7, -2]) ,[ 8, 9, 10, 11, -3]]( ,[[ 12, 13, 14, 15, -4]( ,[ 16, 17, 18, 19, -5]* ,[ 20, 21, 22, 23, -6]]]Append the second tensor dims1 to the first tensor dims0 along axis.Happend @0 (enumFromN @[2,3,4] 0) (enumFromStepN @[2,3,4] @Int (-1) (-1)) $Tensor'4'3'4 [[[ 0, 1, 2, 3]$ ,[ 4, 5, 6, 7]% ,[ 8, 9, 10, 11]]$ ,[[ 12, 13, 14, 15]$ ,[ 16, 17, 18, 19]% ,[ 20, 21, 22, 23]]$ ,[[ -1, -2, -3, -4]$ ,[ -5, -6, -7, -8]% ,[ -9, -10, -11, -12]]$ ,[[ -13, -14, -15, -16]$ ,[ -17, -18, -19, -20]& ,[ -21, -22, -23, -24]]]Happend @1 (enumFromN @[2,3,4] 0) (enumFromStepN @[2,3,4] @Int (-1) (-1)) $Tensor'2'6'4 [[[ 0, 1, 2, 3]$ ,[ 4, 5, 6, 7]$ ,[ 8, 9, 10, 11]$ ,[ -1, -2, -3, -4]$ ,[ -5, -6, -7, -8]% ,[ -9, -10, -11, -12]]$ ,[[ 12, 13, 14, 15]$ ,[ 16, 17, 18, 19]$ ,[ 20, 21, 22, 23]$ ,[ -13, -14, -15, -16]$ ,[ -17, -18, -19, -20]& ,[ -21, -22, -23, -24]]]Happend @2 (enumFromN @[2,3,4] 0) (enumFromStepN @[2,3,4] @Int (-1) (-1))8Tensor'2'3'8 [[[ 0, 1, 2, 3, -1, -2, -3, -4]8 ,[ 4, 5, 6, 7, -5, -6, -7, -8]9 ,[ 8, 9, 10, 11, -9, -10, -11, -12]]8 ,[[ 12, 13, 14, 15, -13, -14, -15, -16]8 ,[ 16, 17, 18, 19, -17, -18, -19, -20]: ,[ 20, 21, 22, 23, -21, -22, -23, -24]]]Pass a pointer to the tensor's data to the IO action. The data may not be modified through the 'Ptr. Pointer may not be used after action is complete.F9Calculate number of padding bytes to be inserted between a and b based on size of a and alignment of b Given: sizeOf a = 4 alignment b = 8 0 1 2 3 4 5 6 7 8 9 A B C D E F a a a a . . . . b b b b b b b b |<--->| 4 padding bytesG2Calculate offset difference between first byte of a and first byte of b based on size of a and alignment of b Given: sizeOf a = 4 alignment b = 8 0 1 2 3 4 5 6 7 8 9 A B C D E F a a a a . . . . b b b b b b b b |<----------->| 8 bytes offset differenceScalar is a degenerate tensor. The tensor.BFunction with number of params equal to number of tensor elements.Starting value.Starting value.Step.TGenerator function that takes index as type parameter will be called for each index. The tensor.New subtensor. The tensor.New elements of the subtensor. The tensor.The mapping function. The tensor. New slice. The tensor.New elements of the slice. The tensor.The mapping function.Subtensor to cons.Tensor to cons to.Tensor to snoc to.Subtensor to snoc.V^_`abcdefghijklmnopqrstuvwxyz{|}~HT}ihgfedcbkjt~{|uzyxwvsrqponmla`_^3I6J7K:LMH@5(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable None%V`09Generate instance for tensor and lenses for its elements.NCreate type-level list of Nat.Dimensions of the tensor.Type of elements.(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable None+,-068;<=>?FSTVhlConstraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Normalized vector.unwrap 4. Note: this does not give you original vector back. $unNormalizedVector . normalize /= idVector constraint. Type of vector data constructor.N-dimensional vector.,Alias for a conrete vector data constructor.!Get square of length of a vector.Get length of a vector. Normalize vector.Dot product of two vectors.8Cross product is only defined for 3-dimensional vectors.Generate instance of a vector.Size of the vector.Type of elements.O(C) 2017 Alexey Vagarenko BSD-style (see LICENSE) 'Alexey Vagarenko (vagarenko@gmail.com)  experimental  non-portable None&'+,-068;<=>?FQSTVh/Constraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Constraints for  function.Matrix constraint. Type of matrix data constructor. Matrix with m rows, n columns,Alias for a conrete matrix data constructor.Identity matrix of size m*mLens for the row number r of the matrix mxn.%matrix @2 @2 @Float 0 1 2 3 ^. row @0Tensor'2 [0.0,1.0]Cset (row @1) (vector @2 @Float 20 30) (matrix @2 @2 @Float 0 1 2 3)"Tensor'2'2 [[0.0,1.0],[20.0,30.0]]#List of elements of the row number r of the matrix mxn.,getRowElems @0 (matrix @2 @2 @Float 0 1 2 3) [0.0,1.0])Put elements of the list into row number r%. The list must have enough elements.5setRowElems @1 (matrix @2 @2 @Float 0 1 2 3) [20, 30]'Just Tensor'2'2 [[0.0,1.0],[20.0,30.0]]1setRowElems @1 (matrix @2 @2 @Float 0 1 2 3) [20]Nothing3Apply a function to all elements of the row number r.4mapRowElems @1 (matrix @2 @2 @Float 0 1 2 3) (* 100)$Tensor'2'2 [[0.0,1.0],[200.0,300.0]]Lens for the column number c of the matrix mxn.%matrix @2 @2 @Float 0 1 2 3 ^. col @0Tensor'2 [0.0,2.0]Cset (col @1) (vector @2 @Float 10 30) (matrix @2 @2 @Float 0 1 2 3)"Tensor'2'2 [[0.0,10.0],[2.0,30.0]]&List of elements of the column number c of the matrix mxn.,getColElems @0 (matrix @2 @2 @Float 0 1 2 3) [0.0,2.0],Put elements of the list into column number r%. The list must have enough elements.5setColElems @1 (matrix @2 @2 @Float 0 1 2 3) [10, 30]'Just Tensor'2'2 [[0.0,10.0],[2.0,30.0]]1setColElems @1 (matrix @2 @2 @Float 0 1 2 3) [10]Nothing6Apply a function to all elements of the column number c.4mapColElems @1 (matrix @2 @2 @Float 0 1 2 3) (* 100)$Tensor'2'2 [[0.0,100.0],[2.0,300.0]]PGet 1-st element of an index.QGet 0-th element of an index.Matrix multiplication.mMultiply two matrices, or matrix and vector. Matrices (or matrix and vector) must have compatible dimensions.-Shape of the result of matrix multiplication.Constraints for  function.Transpose a matrix.Multiply two matrices.Multiply vector and matrix.Multiply matrix and vector.RSign is positive for even n and negative for odd.Determinant of a matrix.Constraint for  function.*Minor matrix is a matrix made by deleting i -th row and j$-th column from given square matrix.Constraint for  function.Constraint for  function.)Minor is the determinant of minor matrix. @i @j is the  @i @j multiplied by (-1) ^ (i + j).#Constraint for ( function.$Constraint for ' function.%Constraint for & function.&AThe matrix formed by all of the cofactors of given square matrix.'OAdjugate matrix of given square matrix is the transpose of its cofactor matrix. +adjugateMatrix = transpose . cofactorMatrix(Inverse of the matrix.)Generate instance of a matrix. The matrix.New row elements. The matrix.The mapping function. The matrix.New column elements.&'()Number of rows.Number of columns.Type of elements.*#$%&'()*&%'$(#)"STUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyzR{|}~     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` abcdefghijk4lmnopqrstuvwxyz{|}~5      !"#$%&'()*+,-./01234567869:69;69<=>?@ABCDE34F34GHIJKLMHNOPHQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~,static-tensor-0.2.0.0-4LYZSU7cIXNFIrMbd1zb5cData.Function.NAryData.List.Unrolled Type.ListData.Tensor.StaticData.Tensor.Static.THData.Vector.StaticData.Matrix.Static TypeLits.ListMkCtx ApplyNAry applyNAryNAry$fApplyNAryntr$fApplyNAry0tr EnumFromStepN enumFromStepN EnumFromN enumFromN Replicate replicateSumFoldMapFoldl1foldl1FoldlfoldlFoldr1foldr1FoldrfoldrAllallMapmapFilterfilterZipWithzipWithUnzipunzipZip3zip3Zipzip ChunksCountChunksOfchunksOfTaketakeDropdropAppendappendsplitAtfoldMapsum $fAppendn $fAppend0$fDropn$fDrop0$fTaken$fTake0 $fChunksOfnc $fChunksOfn0 $fChunksOf0c $fChunksOf00$fZipn$fZip0$fZip3n$fZip30$fUnzipn$fUnzip0 $fZipWithn $fZipWith0 $fFiltern $fFilter0$fMapn$fMap0$fAlln$fAll0$fFoldrn$fFoldr0 $fFoldr1n $fFoldr11$fFoldln$fFoldl0 $fFoldl1n $fFoldl11 $fReplicaten $fReplicate0 $fEnumFromNn $fEnumFromN0$fEnumFromStepNn$fEnumFromStepN0 DemoteWith demoteWith KnownNatsnatsVal $fKnownNats: $fKnownNats[]$fDemoteWithkxkctxctx:$fDemoteWithkxkctxctxs[] MonoZipCtxMonoTraversableCtxMonoFoldableCtxMonoFunctorCtxDimsAfterAppend DimsAfterSnocSnocSubtensorDimsSnoc DimsAfterConsConsSubtensorDimsConsDimsAfterRemoveRemove MapSliceElems SetSliceElemsSetSlice GetSliceElemsGetSliceSlice ElemsInSlice SliceEndIndex TensorElem SubtensorCtxMapSubtensorElemsSetSubtensorElems SetSubtensorGetSubtensorElems GetSubtensorSubtensorStartIndex SubtensorDimsSubtensorsElemsNumbers Subtensor ToNestedList NestedListGenerateScaleDiffAdd ElemsNumberTensorConstructorIsTensorTensortensorunsafeFromListtoList NatsFromTo AllIndexes NormalizeDims FlattenIndex PositiveDims withTensor dimensions elemsNumbersubtensorsElemsNumbersadddiffscalefillzerogenerate toNestedList getSubtensorgetSubtensorElems setSubtensorsetSubtensorElemsmapSubtensorElems subtensor tensorElemslicegetSlice getSliceElemssetSlice setSliceElems mapSliceElemsremoveconssnocunsafeWithTensorPtr$fStorableTensor$fEachTensorTensorab $fShowTensor $fIsTensor[]e$fToNestedListWrk:e$fToNestedListWrk:e0$fToNestedListWrk[]e $fShowTensor0$fGetSliceElemsWrk:$fGetSliceElemsWrk:0$fGetSliceElemsWrk[]$fSetSliceElemsWrk:$fSetSliceElemsWrk:0$fSetSliceElemsWrk[] $fRemoveWrk: $fRemoveWrk:0 $fRemoveWrk[]$fMonoFunctorTensor$fMonoFoldableTensor$fMonoTraversableTensor$fMonoZipTensorgenTensorInstanceDot Normalize VectorLenVectorLenSquareNormalizedVectorunNormalizedVectorIsVectorVectorConstructorVectorvectorvectorLenSquare vectorLen normalizedotcrossgenVectorInstance$fGenericNormalizedVector$fShowNormalizedVector$fEqNormalizedVector MapColElems SetColElems GetColElemsCol MapRowElems SetRowElems GetRowElemsRowIdentityIsMatrixMatrixConstructorMatrixmatrixidentityrow getRowElems setRowElems mapRowElemscol getColElems setColElems mapColElems$fIdentityWrke:$fIdentityWrke:0 MatrixMultmultMatrixMultDims Transpose transpose+$fSuppressUnusedWarnings(->)TransposeGoSym3+$fSuppressUnusedWarnings(->)TransposeGoSym2+$fSuppressUnusedWarnings(->)TransposeGoSym1+$fSuppressUnusedWarnings(->)TransposeGoSym0$fMatrixMult::e,$fSuppressUnusedWarnings(->)MultMatMatGoSym4,$fSuppressUnusedWarnings(->)MultMatMatGoSym3,$fSuppressUnusedWarnings(->)MultMatMatGoSym2,$fSuppressUnusedWarnings(->)MultMatMatGoSym1,$fSuppressUnusedWarnings(->)MultMatMatGoSym0$fMatrixMult::e0,$fSuppressUnusedWarnings(->)MultVecMatGoSym4,$fSuppressUnusedWarnings(->)MultVecMatGoSym3,$fSuppressUnusedWarnings(->)MultVecMatGoSym2,$fSuppressUnusedWarnings(->)MultVecMatGoSym1,$fSuppressUnusedWarnings(->)MultVecMatGoSym0$fMatrixMult::e1,$fSuppressUnusedWarnings(->)MultMatVecGoSym4,$fSuppressUnusedWarnings(->)MultMatVecGoSym3,$fSuppressUnusedWarnings(->)MultMatVecGoSym2,$fSuppressUnusedWarnings(->)MultMatVecGoSym1,$fSuppressUnusedWarnings(->)MultMatVecGoSym0 Determinant determinant MinorMatrix minorMatrix-$fSuppressUnusedWarnings(->)MinorMatrixGoSym4-$fSuppressUnusedWarnings(->)MinorMatrixGoSym3-$fSuppressUnusedWarnings(->)MinorMatrixGoSym2-$fSuppressUnusedWarnings(->)MinorMatrixGoSym1-$fSuppressUnusedWarnings(->)MinorMatrixGoSym0$fDeterminant3e$fDeterminant2e$fSignn$fSign0CofactorMinorminorcofactor$fDeterminantne-$fSuppressUnusedWarnings(->)DeterminantGoSym2-$fSuppressUnusedWarnings(->)DeterminantGoSym1-$fSuppressUnusedWarnings(->)DeterminantGoSym0InverseAdjugateMatrixCofactorMatrixcofactorMatrixadjugateMatrixinversegenMatrixInstance0$fSuppressUnusedWarnings(->)CofactorMatrixGoSym20$fSuppressUnusedWarnings(->)CofactorMatrixGoSym10$fSuppressUnusedWarnings(->)CofactorMatrixGoSym0'singletons-2.3.1-2n8cWr9qXokGvK18YM7O1jData.SingletonsTyFunghc-prim GHC.TypesNat/mono-traversable-1.0.2.1-FG1FO89gyfZCcE9XAEJq1yData.ContainersMonoZipData.MonoTraversableMonoTraversable MonoFoldable MonoFunctor RemoveWrkRemoveSliceDimsRemoveSliceStartIndexSetSliceElemsWrkGetSliceElemsWrkElemsInSlice'' ElemsInSlice'ToNestedListWrkFillFloatDoublebase Data.Foldablelength IndexesRanges++SequenceData.TraversablesequencenatVal' GHC.TypeLitsnatValimpossible_notEnoughTensorElemspadding offsetDiffScalar removeWrksetSliceElemsWrkgetSliceElemsWrktoNestedListWrkD:R:Tensor[]e0natListTIndex1Index0Sign IdentityWrk identityWrkTransposeGoSym0TransposeGoSym0KindInferenceTransposeGoSym1TransposeGoSym1KindInferenceTransposeGoSym2TransposeGoSym2KindInferenceTransposeGoSym3TransposeGoSym3KindInferenceMultMatMatGoSym0MultMatMatGoSym0KindInferenceMultMatMatGoSym1MultMatMatGoSym1KindInferenceMultMatMatGoSym2MultMatMatGoSym2KindInferenceMultMatMatGoSym3MultMatMatGoSym3KindInferenceMultMatMatGoSym4MultMatMatGoSym4KindInferenceMultVecMatGoSym0MultVecMatGoSym0KindInferenceMultVecMatGoSym1MultVecMatGoSym1KindInferenceMultVecMatGoSym2MultVecMatGoSym2KindInferenceMultVecMatGoSym3MultVecMatGoSym3KindInferenceMultVecMatGoSym4MultVecMatGoSym4KindInferenceMultMatVecGoSym0MultMatVecGoSym0KindInferenceMultMatVecGoSym1MultMatVecGoSym1KindInferenceMultMatVecGoSym2MultMatVecGoSym2KindInferenceMultMatVecGoSym3MultMatVecGoSym3KindInferenceMultMatVecGoSym4MultMatVecGoSym4KindInferencesignMinorMatrixGoSym0MinorMatrixGoSym0KindInferenceMinorMatrixGoSym1MinorMatrixGoSym1KindInferenceMinorMatrixGoSym2MinorMatrixGoSym2KindInferenceMinorMatrixGoSym3MinorMatrixGoSym3KindInferenceMinorMatrixGoSym4MinorMatrixGoSym4KindInferenceDeterminantGoSym0DeterminantGoSym0KindInferenceDeterminantGoSym1DeterminantGoSym1KindInferenceDeterminantGoSym2DeterminantGoSym2KindInferenceCofactorMatrixGoSym0!CofactorMatrixGoSym0KindInferenceCofactorMatrixGoSym1!CofactorMatrixGoSym1KindInferenceCofactorMatrixGoSym2!CofactorMatrixGoSym2KindInference