packages feed

numhask-array 0.6.0 → 0.7.0

raw patch · 8 files changed

+31/−113 lines, 8 filesdep −hedgehogdep −numhask-hedgehogdep −numhask-preludedep ~hmatrixdep ~numhask

Dependencies removed: hedgehog, numhask-hedgehog, numhask-prelude, protolude

Dependency ranges changed: hmatrix, numhask

Files

numhask-array.cabal view
@@ -1,6 +1,6 @@-cabal-version: 3.0-name: numhask-array-version: 0.6.0+cabal-version: 2.4+name:          numhask-array+version:       0.7.0 synopsis:   n-dimensional arrays description:@@ -22,12 +22,12 @@ license-file:   LICENSE tested-with:-  GHC==8.8.3+  GHC==8.10.1 build-type:   Simple extra-source-files:-    readme.md-    stack.yaml+  readme.md+  stack.yaml source-repository head   type:     git@@ -48,15 +48,13 @@     -Wincomplete-uni-patterns     -Wredundant-constraints   build-depends:-      base >=4.11 && <5-    , adjunctions >=4.0 && <5-    , deepseq >=1.4.2.0 && <2-    , distributive >=0.4 && <0.7-    , numhask >= 0.3.1 && <0.6-    , numhask-prelude >=0.3 && <0.6-    , protolude >=0.2 && <0.4-    , vector >=0.10 && <0.13-    , hmatrix+    base >=4.11 && <5,+    adjunctions >=4.0 && <5,+    deepseq >=1.4.2.0 && <2,+    distributive >=0.4 && <0.7,+    numhask >= 0.6 && <0.7,+    vector >=0.10 && <0.13,+    hmatrix >= 0.18   exposed-modules:     NumHask.Array     NumHask.Array.HMatrix@@ -77,10 +75,8 @@     OverloadedStrings     UnicodeSyntax   build-depends:-      base >=4.11 && <5-    , doctest >=0.13 && <0.17-    , numhask-array-    , numhask-prelude >=0.3 && <0.6-    , numhask-hedgehog >=0.3 && <0.5-    , hedgehog >=0.5 && <1.1+    base >=4.11 && <5,+    doctest >=0.13 && <0.17,+    numhask-array,+    numhask >=0.6 && <0.7,   default-language: Haskell2010
src/NumHask/Array.hs view
@@ -1,19 +1,17 @@ {-# OPTIONS_GHC -Wall #-}  -- | Numbers that can be indexed into with an Int list.------ module NumHask.Array   ( -- * Imports     --     -- $imports-    --     module NumHask.Array.Shape,     module NumHask.Array.Fixed,-  ) where+  )+where -import NumHask.Array.Shape import NumHask.Array.Fixed+import NumHask.Array.Shape  -- $imports --@@ -31,4 +29,3 @@ -- -- > import NumHask.Array.Shape -- > import qualified NumHask.Array.HMatrix as H---
src/NumHask/Array/Dynamic.hs view
@@ -4,13 +4,13 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE NoStarIsType #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-} 
src/NumHask/Array/Fixed.hs view
@@ -5,14 +5,14 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE NoStarIsType #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} {-# OPTIONS_GHC -fno-warn-unused-imports #-} @@ -127,7 +127,6 @@   ) =>   Representable (Array s)   where-   type Rep (Array s) = [Int]    tabulate f =@@ -149,7 +148,6 @@   ) =>   Additive (Array s a)   where-   (+) = liftR2 (+)    zero = pureRep zero@@ -165,26 +163,9 @@ type instance Actor (Array s a) = a  instance-  ( Multiplicative a,-    HasShape s-  ) =>-  HadamardMultiplication (Array s) a-  where-  (.*.) = liftR2 (*)--instance-  ( Divisive a,-    HasShape s-  ) =>-  HadamardDivision (Array s) a-  where-  (./.) = liftR2 (/)--instance   (HasShape s, Multiplicative a) =>   MultiplicativeAction (Array s a)   where-   (.*) r s = fmap (* s) r   {-# INLINE (.*) #-} @@ -198,7 +179,6 @@   (/\) = liftR2 (/\)  instance (HasShape s, Subtractive a, Epsilon a) => Epsilon (Array s a) where-   epsilon = singleton epsilon    nearZero (Array a) = all nearZero a@@ -208,7 +188,6 @@   ) =>   IsList (Array s a)   where-   type Item (Array s a) = a    fromList l =@@ -882,7 +861,6 @@   ) =>   Multiplicative (Matrix m m a)   where-   (*) = mmult    one = ident
src/NumHask/Array/HMatrix.hs view
@@ -5,14 +5,14 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE GeneralizedNewtypeDeriving #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TypeOperators #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE NoStarIsType #-} {-# OPTIONS_GHC -Wno-redundant-constraints #-} {-# OPTIONS_GHC -fno-warn-incomplete-uni-patterns #-} @@ -120,7 +120,6 @@   ) =>   Additive (Array s a)   where-   (+) (Array x1) (Array x2) = Array $ H.add x1 x2    zero = Array $ H.konst zero (n, m)@@ -137,7 +136,6 @@   ) =>   Multiplicative (Array s a)   where-   (*) (Array x1) (Array x2) = Array $ H.liftMatrix2 (Prelude.*) x1 x2    one = Array $ H.konst one (n, m)@@ -157,7 +155,6 @@   ) =>   MultiplicativeAction (Array s a)   where-   (.*) (Array r) s = Array $ H.cmap (* s) r   {-# INLINE (.*) #-} @@ -173,7 +170,6 @@   ) =>   IsList (Array s a)   where-   type Item (Array s a) = a    fromList l =@@ -664,7 +660,6 @@   ) =>   Multiplicative (Matrix m m a)   where-   (*) = mmult    one = ident
src/NumHask/Array/Shape.hs view
@@ -4,8 +4,6 @@ {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE MultiParamTypeClasses #-}-{-# LANGUAGE NoImplicitPrelude #-}-{-# LANGUAGE NoStarIsType #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -14,6 +12,8 @@ {-# LANGUAGE TypeInType #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE UndecidableInstances #-}+{-# LANGUAGE NoImplicitPrelude #-}+{-# LANGUAGE NoStarIsType #-} {-# OPTIONS_GHC -Wall #-}  -- | Functions for manipulating shape. The module tends to supply equivalent functionality at type-level and value-level with functions of the same name (except for capitalization).
stack.yaml view
@@ -1,11 +1,8 @@-resolver: lts-15.13+resolver: nightly-2020-06-25  packages:   - .  extra-deps:-  - numhask-0.5.0-  - numhask-prelude-0.5.0-  - numhask-hedgehog-0.4.0-  - numhask-space-0.4.0-  - protolude-0.3.0+  - numhask-0.6.0+
test/test.hs view
@@ -2,28 +2,13 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeApplications #-}-{-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wall #-}  module Main where -import qualified Hedgehog as H-import NumHask.Array.Fixed-import NumHask.Array.Shape-import NumHask.Hedgehog import NumHask.Prelude as P import Test.DocTest -genAIntegral :: forall a m r. (HasShape r, H.MonadGen m, Additive a, Bounded a, ToInteger a, FromInteger a) => m (Array (r :: [Nat]) a)-genAIntegral = fromList <$> replicateM (fromIntegral n) integral_-  where-    n = product $ shapeVal $ toShape @r--genARational :: forall a m r. (H.MonadGen m, HasShape r, Field a, ToRatio a Integer, FromRatio a Integer) => m (Array (r :: [Nat]) a)-genARational = fromList <$> replicateM (fromIntegral n) negUniform-  where-    n = product $ shapeVal $ toShape @r- main :: IO () main = do   putStrLn ("NumHask.Array.Fixed DocTest turned on" :: Text)@@ -32,33 +17,3 @@   doctest ["src/NumHask/Array/Shape.hs"]   putStrLn ("NumHask.Array.Dynamic DocTest turned on" :: Text)   doctest ["src/NumHask/Array/Dynamic.hs"]-  bVInt <--    assertProps-      "Vector Int 6"-      100-      (genAIntegral :: H.Gen (Vector 6 Int))-      numhaskProps-  bMInt <--    assertProps-      "Matrix '[3,4] Int"-      100-      (genAIntegral :: H.Gen (Array '[3, 4] Int))-      numhaskProps-  unless-    (bVInt && bMInt)-    exitFailure--numhaskProps ::-  forall a.-  ( Show a,-    Eq a,-    Subtractive a-  ) =>-  H.Gen a ->-  [(H.PropertyName, H.Property)]-numhaskProps g =-  mconcat $-    (\x -> x g)-      <$> [ isAdditive,-            isSubtractive-          ]