indexed-list-literals 0.1.0.1 → 0.2.0.0
raw patch · 4 files changed
+11/−12 lines, 4 filesdep +Onlydep −OneTupledep ~basePVP ok
version bump matches the API change (PVP)
Dependencies added: Only
Dependencies removed: OneTuple
Dependency ranges changed: base
API changes (from Hackage documentation)
- Data.IndexedListLiterals: instance Data.IndexedListLiterals.IndexedListLiterals (Data.Tuple.OneTuple.OneTuple a) 1 a
+ Data.IndexedListLiterals: instance Data.IndexedListLiterals.IndexedListLiterals (Data.Tuple.Only.Only a) 1 a
Files
- ChangeLog.md +0/−1
- indexed-list-literals.cabal +5/−5
- src/Data/IndexedListLiterals.hs +4/−4
- test/Docs.hs +2/−2
ChangeLog.md view
@@ -1,1 +0,0 @@-Changed GHC.TypeNats to GHC.TypeLits to allow older versions of GHC to build the package
indexed-list-literals.cabal view
@@ -2,7 +2,7 @@ -- further documentation, see http://haskell.org/cabal/users-guide/ name: indexed-list-literals-version: 0.1.0.1+version: 0.2.0.0 synopsis: Type safe indexed list literals homepage: https://github.com/davidm-d/indexed-list-literals license: BSD3@@ -24,7 +24,7 @@ > x = vector $ ZeroTuple @Double > > y :: Vector 1 Double- > y = vector (OneTuple 1)+ > y = vector (Only 1) > > z :: Vector 2 String > z = vector ("Hello", "World")@@ -38,7 +38,7 @@ > a = matrix $ ZeroTuple @(ZeroTuple Bool) > > b :: Matrix 1 2 String- > b = matrix $ OneTuple ("Hello","World")+ > b = matrix $ Only ("Hello","World") > > c :: Matrix 4 5 Double > c = matrix ((1,2,3,0,0)@@ -59,8 +59,8 @@ exposed-modules: Data.IndexedListLiterals -- other-modules: -- other-extensions: - build-depends: base >=4.9 && <= 4.11- , OneTuple >= 0.2.1+ build-depends: base >=4.9 && < 4.12+ , Only >= 0.1 && < 0.2 hs-source-dirs: src default-language: Haskell2010
src/Data/IndexedListLiterals.hs view
@@ -9,13 +9,13 @@ module Data.IndexedListLiterals ( IndexedListLiterals(..) , ILL- , module Data.Tuple.OneTuple+ , module Data.Tuple.Only , ZeroTuple(..) ) where import GHC.TypeLits import Data.Kind-import Data.Tuple.OneTuple+import Data.Tuple.Only -- import Control.Monad -- | An alias for IndexedListLiterals@@ -29,8 +29,8 @@ instance IndexedListLiterals (ZeroTuple a) 0 a where toList ZeroTuple = [] -instance IndexedListLiterals (OneTuple a) 1 a where- toList (OneTuple a) = [a]+instance IndexedListLiterals (Only a) 1 a where+ toList (Only a) = [a] -- | Intuitively the zero tuple is () or Void but this breaks the Functional Dependency "input -> output length" stopping reliable inference, so this constructor is used to preserve type information data ZeroTuple a = ZeroTuple
test/Docs.hs view
@@ -18,7 +18,7 @@ x = vector $ ZeroTuple @Double y :: Vector 1 Double-y = vector (OneTuple 1)+y = vector (Only 1) z :: Vector 2 String z = vector ("Hello", "World")@@ -30,7 +30,7 @@ a = matrix $ ZeroTuple @(ZeroTuple Bool) b :: Matrix 1 2 String-b = matrix $ OneTuple ("Hello","World")+b = matrix $ Only ("Hello","World") c :: Matrix 4 5 Double c = matrix ((1,2,3,0,0)