hw-playground-linear (empty) → 0.1.0.0
raw patch · 7 files changed
+132/−0 lines, 7 filesdep +basedep +hedgehogdep +hmatrixsetup-changed
Dependencies added: base, hedgehog, hmatrix, hmatrix-csv, hspec, hw-hspec-hedgehog, hw-playground-linear, text
Files
- LICENSE +30/−0
- README.md +2/−0
- Setup.hs +2/−0
- hw-playground-linear.cabal +68/−0
- src/HaskellWorks/Playground/Linear.hs +10/−0
- test/HaskellWorks/Playground/LinearSpec.hs +19/−0
- test/Spec.hs +1/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright John Ky (c) 2016-2019++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Author name here nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ README.md view
@@ -0,0 +1,2 @@+# rebounds+
+ Setup.hs view
@@ -0,0 +1,2 @@+import Distribution.Simple+main = defaultMain
+ hw-playground-linear.cabal view
@@ -0,0 +1,68 @@+cabal-version: 2.4++name: hw-playground-linear+version: 0.1.0.0+synopsis: Primitive functions and data types+description: Primitive functions and data types.+category: Data+stability: Experimental+homepage: http://github.com/haskell-works/hw-playground-linear#readme+bug-reports: https://github.com/haskell-works/hw-playground-linear/issues+author: John Ky+maintainer: newhoggy@gmail.com+copyright: 2016-2020 John Ky+license: BSD-3-Clause+license-file: LICENSE+tested-with: GHC == 8.10.2, GHC == 8.8.3, GHC == 8.6.5, GHC == 8.4.4+build-type: Simple+extra-source-files: README.md++source-repository head+ type: git+ location: https://github.com/haskell-works/hw-playground-linear++common base { build-depends: base >= 4.11 && < 5 }++common generic-lens { build-depends: generic-lens >= 1.2.0.1 && < 2.1 }+common hedgehog { build-depends: hedgehog >= 0.5 && < 1.1 }+common hmatrix { build-depends: hmatrix >= 0.20.0.0 && < 0.21 }+common hmatrix-csv { build-depends: hmatrix-csv >= 0.1.0.2 && < 0.2 }+common hspec { build-depends: hspec >= 2.4 && < 2.8 }+common hw-hspec-hedgehog { build-depends: hw-hspec-hedgehog >= 0.1 && < 0.2 }+common lens { build-depends: lens >= 4 && < 5 }+common optparse-applicative { build-depends: optparse-applicative >= 0.14 && < 0.17 }+common text { build-depends: text >= 1.2 && < 1.3 }++common config+ default-language: Haskell2010++common hw-playground-linear+ build-depends: hw-playground-linear++library+ import: base+ , config+ , hmatrix+ , hmatrix-csv+ , text+ exposed-modules: HaskellWorks.Playground.Linear+ other-modules: Paths_hw_playground_linear+ autogen-modules: Paths_hw_playground_linear+ hs-source-dirs: src++test-suite hw-playground-linear-test+ import: base+ , config+ , hedgehog+ , hspec+ , hw-hspec-hedgehog+ , hw-playground-linear+ type: exitcode-stdio-1.0+ main-is: Spec.hs+ other-modules: HaskellWorks.Playground.LinearSpec+ Paths_hw_playground_linear+ autogen-modules: Paths_hw_playground_linear+ build-depends: hw-playground-linear+ hs-source-dirs: test+ ghc-options: -threaded -rtsopts -with-rtsopts=-N+ build-tool-depends: hspec-discover:hspec-discover
+ src/HaskellWorks/Playground/Linear.hs view
@@ -0,0 +1,10 @@+module HaskellWorks.Playground.Linear where++import Numeric.LinearAlgebra+import Prelude hiding ((<>))++variance :: Matrix Double -> Matrix Double+variance m = x <> ((m - asRow rdMean) ** 2)+ where (rdMean, _) = meanCov m+ r = rows m+ x = konst (1 / fromIntegral r) (1, r)
+ test/HaskellWorks/Playground/LinearSpec.hs view
@@ -0,0 +1,19 @@+{-# OPTIONS_GHC -fno-warn-incomplete-patterns #-}+{-# LANGUAGE ScopedTypeVariables #-}++module HaskellWorks.Playground.LinearSpec (spec) where++import HaskellWorks.Hspec.Hedgehog+import Hedgehog+import Test.Hspec++import qualified Hedgehog.Gen as G+import qualified Hedgehog.Range as R++{-# ANN module ("HLint: Ignore Redundant do" :: String) #-}+{-# ANN module ("HLint: Ignore Reduce duplication" :: String) #-}++spec :: Spec+spec = describe "HaskellWorks.LinearSpec" $ do+ it "Stub" $ requireProperty $ do+ True === True
+ test/Spec.hs view
@@ -0,0 +1,1 @@+{-# OPTIONS_GHC -F -pgmF hspec-discover #-}