packages feed

fixed-storable-array 0.3.0.0 → 0.3.1.0

raw patch · 2 files changed

+13/−1 lines, 2 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

+ Foreign.Marshal.FixedStorableArray: instance (SingI Nat n, HasBounds [Nat] ((':) Nat n2 ns)) => HasBounds [Nat] ((':) Nat n ((':) Nat n2 ns))
+ Foreign.Marshal.FixedStorableArray: instance SingI Nat n => HasBounds [Nat] ((':) Nat n ('[] Nat))

Files

Foreign/Marshal/FixedStorableArray.hs view
@@ -1,6 +1,7 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE TypeFamilies #-}+{-# LANGUAGE TypeOperators #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE ScopedTypeVariables #-}@@ -301,3 +302,14 @@                  fromNat (Proxy :: Proxy k) - 1,                  fromNat (Proxy :: Proxy l) - 1,                  fromNat (Proxy :: Proxy m) - 1))++instance SingI n => HasBounds ('[n] :: [Nat]) where+    type Bound ('[n]) = Int+    bounds _ = (0, fromNat (Proxy :: Proxy n) - 1)++instance (SingI n, HasBounds (n2 ': ns)) =>+         HasBounds ((n ': n2 ': ns) :: [Nat]) where+    type Bound (n ': n2 ': ns) = (Int, Bound (n2 ': ns))+    bounds _ = ((0, b0), (fromNat (Proxy :: Proxy n) - 1, bn))+      where+        (b0, bn) = bounds (undefined :: FixedStorableArray (n2 ': ns) ())
fixed-storable-array.cabal view
@@ -1,5 +1,5 @@ name:                fixed-storable-array-version:             0.3.0.0+version:             0.3.1.0 synopsis:            Fixed-size wrapper for StorableArray, providing a                      Storable instance description:         Uses type-level numeric literals to wrap @StorableArray@