packages feed

simple-affine-space 0.1 → 0.1.1

raw patch · 4 files changed

+32/−3 lines, 4 files

Files

CHANGELOG view
@@ -1,3 +1,8 @@+2020-04-28 Ivan Perez <ivan.perez@keera.co.uk>+        * Document combination with other vector libraries (#13), by @walseb.+        * Remove unnecessary GHC extension (#10), by @turion.+        * Version bump (0.1.1) (#12).+ 2018-10-31 Ivan Perez <ivan.perez@keera.co.uk>         * Added basic travis setup.         * Added documentation (README), link to Yampa.
simple-affine-space.cabal view
@@ -1,5 +1,5 @@ name: simple-affine-space-version: 0.1+version: 0.1.1 cabal-version: >= 1.8 license: BSD3 license-file: LICENSE
src/Data/AffineSpace.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}+{-# LANGUAGE FunctionalDependencies, FlexibleInstances #-} ----------------------------------------------------------------------------------------- -- | -- Module      :  Data.AffineSpace
src/Data/VectorSpace.hs view
@@ -1,4 +1,4 @@-{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies, FlexibleInstances #-}+{-# LANGUAGE FunctionalDependencies, FlexibleInstances #-} ----------------------------------------------------------------------------------------- -- | -- Module      :  Data.VectorSpace@@ -10,6 +10,30 @@ -- Portability :  non-portable (GHC extensions) -- -- Vector space type relation and basic instances.+--+-- There can be other implementations of VectorSpace, for example you could+-- implement it with linear like this:+-- +-- @+-- {-# LANGUAGE FlexibleInstances     #-}+-- {-# LANGUAGE MultiParamTypeClasses #-}+-- +-- import FRP.Yampa+-- import Linear    as L+-- +-- instance (Eq a, Floating a) => VectorSpace (V2 a) a where+--   zeroVector = L.zero+--   (*^) = (L.*^)+--   (^/) = (L.^/)+--   negateVector = L.negated+--   (^+^) = (L.^+^)+--   (^-^) = (L.^-^)+--   dot = L.dot+-- @+-- +-- Using this you could benefit from more advanced vector operators and the+-- improved performance linear brings while keeping a simple type class+-- interface with few dependencies. -----------------------------------------------------------------------------------------  module Data.VectorSpace where