Hello community, here is the log from the commit of package ghc-hvect for openSUSE:Factory checked in at 2016-05-25 21:28:28 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/ghc-hvect (Old) and /work/SRC/openSUSE:Factory/.ghc-hvect.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "ghc-hvect" Changes: -------- --- /work/SRC/openSUSE:Factory/ghc-hvect/ghc-hvect.changes 2016-01-08 15:22:57.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.ghc-hvect.new/ghc-hvect.changes 2016-05-25 21:28:35.000000000 +0200 @@ -1,0 +2,6 @@ +Mon May 23 10:36:06 UTC 2016 - mimi...@gmail.com + +- update to 0.3.1.0 +* added type level MaybeToList + +------------------------------------------------------------------- Old: ---- hvect-0.3.0.0.tar.gz New: ---- hvect-0.3.1.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ ghc-hvect.spec ++++++ --- /var/tmp/diff_new_pack.x2HMl4/_old 2016-05-25 21:28:36.000000000 +0200 +++ /var/tmp/diff_new_pack.x2HMl4/_new 2016-05-25 21:28:36.000000000 +0200 @@ -20,7 +20,7 @@ %bcond_with tests Name: ghc-hvect -Version: 0.3.0.0 +Version: 0.3.1.0 Release: 0 Summary: Simple strict heterogeneous lists Group: System/Libraries ++++++ hvect-0.3.0.0.tar.gz -> hvect-0.3.1.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hvect-0.3.0.0/LICENSE new/hvect-0.3.1.0/LICENSE --- old/hvect-0.3.0.0/LICENSE 2015-08-23 19:52:10.000000000 +0200 +++ new/hvect-0.3.1.0/LICENSE 2016-05-22 12:54:12.000000000 +0200 @@ -1,5 +1,5 @@ Copyright (c) 2014 - 2015 Tim Baumann <t...@timbaumann.info> -Copyright (c) 2014 - 2015 Alexander Thiemann <m...@athiemann.net> +Copyright (c) 2014 - 2016 Alexander Thiemann <m...@athiemann.net> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hvect-0.3.0.0/README.md new/hvect-0.3.1.0/README.md --- old/hvect-0.3.0.0/README.md 2015-08-23 19:52:10.000000000 +0200 +++ new/hvect-0.3.1.0/README.md 2016-05-22 12:54:12.000000000 +0200 @@ -30,4 +30,4 @@ ### License Released under the MIT license. -(c) 2014 - 2015 Alexander Thiemann <m...@athiemann.net>, Tim Baumann <t...@timbaumann.info> +(c) 2014 - 2016 Alexander Thiemann <m...@athiemann.net>, Tim Baumann <t...@timbaumann.info> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hvect-0.3.0.0/hvect.cabal new/hvect-0.3.1.0/hvect.cabal --- old/hvect-0.3.0.0/hvect.cabal 2015-08-23 19:52:10.000000000 +0200 +++ new/hvect-0.3.1.0/hvect.cabal 2016-05-22 12:54:12.000000000 +0200 @@ -1,5 +1,5 @@ name: hvect -version: 0.3.0.0 +version: 0.3.1.0 synopsis: Simple strict heterogeneous lists description: Small, concise and simple implementation of heterogeneous lists with useful utility functions homepage: https://github.com/agrafix/hvect @@ -8,7 +8,7 @@ license-file: LICENSE author: Alexander Thiemann <m...@athiemann.net>, Tim Baumann <t...@timbaumann.info> maintainer: Alexander Thiemann <m...@athiemann.net> -copyright: (c) 2014 - 2015 Alexander Thiemann <m...@athiemann.net>, Tim Baumann <t...@timbaumann.info> +copyright: (c) 2014 - 2016 Alexander Thiemann <m...@athiemann.net>, Tim Baumann <t...@timbaumann.info> category: Data build-type: Simple cabal-version: >=1.10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hvect-0.3.0.0/src/Data/HVect.hs new/hvect-0.3.1.0/src/Data/HVect.hs --- old/hvect-0.3.0.0/src/Data/HVect.hs 2015-08-23 19:52:10.000000000 +0200 +++ new/hvect-0.3.1.0/src/Data/HVect.hs 2016-05-22 12:54:12.000000000 +0200 @@ -15,9 +15,10 @@ HVect (..) , empty, null, head, tail , singleton - , length, HVectLen (..) - , findFirst, InList (..), ListContains (..), NotInList(..) - , (!!), HVectIdx (..) + , length, HVectLen + , findFirst, InList, ListContains, NotInList + , MaybeToList + , (!!), HVectIdx , HVectElim , Append, (<++>) , ReverseLoop, Reverse, reverse @@ -31,7 +32,6 @@ , (:<) ) where -import Data.Proxy import Prelude hiding (reverse, uncurry, curry, head, null, (!!), length, tail) -- | Heterogeneous vector @@ -98,6 +98,10 @@ type ListContains n x ts = (SNatRep n, InList x ts ~ n, HVectIdx n ts ~ x) +type family MaybeToList (a :: Maybe *) :: [*] where + MaybeToList ('Just r) = '[r] + MaybeToList 'Nothing = '[] + -- | Find first element in 'HVect' of type x findFirst :: forall x ts n. (ListContains n x ts) => HVect ts -> x findFirst vect = idx !! vect @@ -116,14 +120,14 @@ null _ = False head :: HVect (t ': ts) -> t -head (a :&: as) = a +head (a :&: _) = a tail :: HVect (t ': ts) -> HVect ts -tail (a :&: as) = as +tail (_ :&: as) = as length :: HVect as -> SNat (HVectLen as) length HNil = SZero -length (a :&: as) = SSucc (length as) +length (_ :&: as) = SSucc (length as) sNatToInt :: SNat n -> Int sNatToInt SZero = 0 @@ -133,7 +137,7 @@ intToSNat 0 = AnySNat SZero intToSNat n = case intToSNat (n - 1) of - AnySNat n -> AnySNat (SSucc n) + AnySNat m -> AnySNat (SSucc m) data Nat where Zero :: Nat @@ -164,8 +168,9 @@ (Succ m) :- (Succ n) = m :- n (!!) :: SNat n -> HVect as -> HVectIdx n as -SZero !! (a :&: as) = a -(SSucc s) !! (a :&: as) = s !! as +SZero !! (a :&: _) = a +(SSucc s) !! (_ :&: as) = s !! as +_ !! _ = error "HVect !!: This should never happen" infixr 5 :&: infixr 5 <++> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/hvect-0.3.0.0/test/Data/HVectTest.hs new/hvect-0.3.1.0/test/Data/HVectTest.hs --- old/hvect-0.3.0.0/test/Data/HVectTest.hs 2015-08-23 19:52:10.000000000 +0200 +++ new/hvect-0.3.1.0/test/Data/HVectTest.hs 2016-05-22 12:54:12.000000000 +0200 @@ -1,4 +1,4 @@ -{-# OPTIONS_GHC -F -pgmF htfpp #-} +{-# OPTIONS_GHC -fno-warn-type-defaults -F -pgmF htfpp #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE DataKinds #-} module Data.HVectTest (htf_thisModulesTests) where