vinyl 0.4.1 → 0.4.2
raw patch · 5 files changed
+24/−10 lines, 5 filesdep ~basedep ~singletonsdep ~template-haskell
Dependency ranges changed: base, singletons, template-haskell, vinyl
Files
- Data/Vinyl/Core.hs +1/−1
- Data/Vinyl/TH.hs +7/−1
- Data/Vinyl/Universe/Field.hs +7/−0
- benchmarks/StorableBench.hs +4/−3
- vinyl.cabal +5/−5
Data/Vinyl/Core.hs view
@@ -21,7 +21,7 @@ -- | A record is parameterized by a universe @u@, list of rows @rs@, a large -- elimination @el@, and a type constructor @f@ to be applied to the -- interpretation @el r@ of each of those @r@.-data Rec :: (TyFun u * -> *) -> (* -> *) -> [u] -> * where+data Rec (el :: TyFun u * -> *) (f :: * -> *) (rrs :: [u]) where RNil :: Rec el f '[] (:&) :: !(f (el $ r)) -> !(Rec el f rs) -> Rec el f (r ': rs) infixr :&
Data/Vinyl/TH.hs view
@@ -1,3 +1,4 @@+{-# LANGUAGE CPP #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} {-# LANGUAGE QuasiQuotes #-}@@ -50,4 +51,9 @@ elu' <- conT elu u' <- asType u t' <- asType t- return $ TySynInstD ''App (TySynEqn [elu',u'] t')+ return $ TySynInstD ''App+#if __GLASGOW_HASKELL__ > 707+ (TySynEqn [elu',u'] t')+#else+ [elu',u'] t'+#endif
Data/Vinyl/Universe/Field.hs view
@@ -1,3 +1,5 @@+{-# LANGUAGE FlexibleContexts #-}+{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE PolyKinds #-}@@ -11,8 +13,13 @@ data (sy :: k) ::: (t :: *) +#if __GLASGOW_HASKELL__ > 707 data SField :: * -> * where SField :: KnownSymbol sy => SField (sy ::: t)+#else+data SField :: * -> * where+ SField :: SingE (Kind :: Symbol) str => SField (sy ::: t)+#endif data ElField :: (TyFun * *) -> * where ElField :: ElField el
benchmarks/StorableBench.hs view
@@ -14,6 +14,7 @@ import qualified Data.Vector.Storable as V import qualified Data.Vector.Storable.Mutable as VM import Data.Vinyl+import Data.Vinyl.Universe.Field import Foreign.Ptr (castPtr) import Foreign.Storable (Storable(..)) import Linear (V2, V3, _y)@@ -27,11 +28,11 @@ randVecStd :: (Storable a, Variate a) => Int -> IO (V.Vector a) randVecStd = withSystemRandom . randVec -vNorm :: "normal" ::: V3 a-vNorm = Field+vNorm :: SField ("normal" ::: V3 a)+vNorm = SField type MyFields a = [ "pos" ::: V3 a, "tex" ::: V2 a, "normal" ::: V3 a ]-type MyVertex a = PlainRec (MyFields a)+type MyVertex a = PlainRec ElField (MyFields a) doubleNviL :: V.Vector (MyVertex Float) -> V.Vector (MyVertex Float) doubleNviL = V.map (rLens vNorm . _y *~ (2::Float))
vinyl.cabal view
@@ -1,11 +1,11 @@ name: vinyl-version: 0.4.1+version: 0.4.2 synopsis: Extensible Records -- description: license: MIT license-file: LICENSE author: Jonathan Sterling-maintainer: jon@jonmsterling.com+maintainer: jonsterling@me.com -- copyright: category: Records stability: Experimental@@ -36,7 +36,7 @@ , Data.Vinyl.Universe.Const , Data.Vinyl.Universe.Field , Data.Vinyl.TH- build-depends: base >=4.6 && <= 5, ghc-prim, template-haskell == 2.9.0.0+ build-depends: base >=4.6 && <= 5, ghc-prim, template-haskell >= 2.7.0.0 default-language: Haskell2010 ghc-options: -fwarn-dodgy-exports -fwarn-dodgy-imports -fwarn-unused-matches -fwarn-unused-imports -fwarn-unused-binds -fwarn-incomplete-record-updates -fwarn-missing-signatures -fwarn-name-shadowing -fwarn-orphans -fwarn-overlapping-patterns -fwarn-tabs -fwarn-type-defaults @@ -44,7 +44,7 @@ type: exitcode-stdio-1.0 hs-source-dirs: benchmarks main-is: StorableBench.hs- build-depends: base >= 4.6 && <= 5, vector, criterion, vinyl == 0.4, mwc-random, lens, linear+ build-depends: base >= 4.6 && <= 5, vector, criterion, vinyl == 0.4.2, mwc-random, lens, linear ghc-options: -O2 -fllvm default-language: Haskell2010 @@ -52,5 +52,5 @@ type: exitcode-stdio-1.0 hs-source-dirs: tests main-is: Intro.lhs- build-depends: base >= 4.6 && <= 5, lens, vinyl == 0.4, doctest >= 0.8, singletons == 1.0+ build-depends: base >= 4.6 && <= 5, lens, vinyl == 0.4.2, doctest >= 0.8, singletons >= 0.10 default-language: Haskell2010