type-level-numbers 0.1.0.2 → 0.1.0.3
raw patch · 2 files changed
+27/−18 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- TypeLevel/Number/Nat.hs +5/−7
- type-level-numbers.cabal +22/−11
TypeLevel/Number/Nat.hs view
@@ -6,6 +6,7 @@ {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE ScopedTypeVariables #-}+{-# LANGUAGE TypeOperators #-} -- | -- Module : TypeLevel.Number.Nat -- Copyright : Alexey Khudyakov@@ -57,9 +58,6 @@ import Data.Word (Word8,Word16,Word32,Word64) import Data.Int (Int8, Int16, Int32, Int64 ) --import Language.Haskell.TH- import TypeLevel.Number.Classes import TypeLevel.Number.Nat.Types import TypeLevel.Number.Nat.TH@@ -86,10 +84,10 @@ instance Nat Z where toInt _ = 0 instance Nat (I Z) where toInt _ = 1-instance Nat (O n) => Nat (O (O n)) where toInt n = 0 + 2 * toInt (undefined :: (O n))-instance Nat (O n) => Nat (I (O n)) where toInt n = 1 + 2 * toInt (undefined :: (O n))-instance Nat (I n) => Nat (O (I n)) where toInt n = 0 + 2 * toInt (undefined :: (I n))-instance Nat (I n) => Nat (I (I n)) where toInt n = 1 + 2 * toInt (undefined :: (I n))+instance Nat (O n) => Nat (O (O n)) where toInt _ = 0 + 2 * toInt (undefined :: (O n))+instance Nat (O n) => Nat (I (O n)) where toInt _ = 1 + 2 * toInt (undefined :: (O n))+instance Nat (I n) => Nat (O (I n)) where toInt _ = 0 + 2 * toInt (undefined :: (I n))+instance Nat (I n) => Nat (I (I n)) where toInt _ = 1 + 2 * toInt (undefined :: (I n)) -- Error reporting. Stop for denormalized numbers class Number_Is_Denormalized a instance (Number_Is_Denormalized Z) => Nat (O Z) where
type-level-numbers.cabal view
@@ -1,13 +1,5 @@ Name: type-level-numbers-Version: 0.1.0.2-Cabal-Version: >= 1.6-License: BSD3-License-File: LICENSE-Author: Alexey Khudyakov <alexey.skladnoy@gmail.com>-Maintainer: Alexey Khudyakov <alexey.skladnoy@gmail.com>-Homepage: -Category: Type System-Build-Type: Simple+Version: 0.1.0.3 Synopsis: Type level numbers implemented using type families. Description:@@ -30,19 +22,38 @@ So far comparison of numbers, subtraction and multiplication of numbers are supported. .- Changes in 0.1.0.1:+ Changes in 0.1.0.3 .- * Workaround for GHC bug #4364 (Build failure on GHC7.0)+ * Fix build for GHC 7.4 . Changes in 0.1.0.2: . * Fix URL in cabal file+ .+ Changes in 0.1.0.1:+ .+ * Workaround for GHC bug #4364 (Build failure on GHC 7.0) +Cabal-Version: >= 1.6+License: BSD3+License-File: LICENSE+Bug-reports: https://github.com/bos/statistics/issues+Author: Alexey Khudyakov <alexey.skladnoy@gmail.com>+Maintainer: Alexey Khudyakov <alexey.skladnoy@gmail.com>+Homepage: +Category: Type System+Build-Type: Simple+ source-repository head type: hg location: http://bitbucket.org/Shimuuar/type-level-numbers+source-repository head+ type: git+ location: https://github.com/Shimuuar/type-level-numbers + Library+ ghc-options: -Wall -fno-warn-orphans Build-Depends: base >=3 && <5, template-haskell > 2.0 Exposed-modules: TypeLevel.Number.Classes