function-combine 0.0.1 → 0.1.0
raw patch · 5 files changed
+21/−27 lines, 5 filesdep ~data-typePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: data-type
API changes (from Hackage documentation)
- Control.Combine: S :: n -> S n
- Control.Combine: Z :: Z
- Control.Combine: class Nat n
- Control.Combine: data S n
- Control.Combine: data Z
- Control.Combine: fromNat :: (Nat n, Enum e) => n -> e
- Control.Combine: instance Nat Z
- Control.Combine: instance Nat n => Nat (S n)
- Control.Combine: one :: S Z
- Control.Combine: three :: S (S (S Z))
- Control.Combine: two :: S (S Z)
- Control.Combine: zero :: Z
Files
- CHANGES +11/−0
- Control/Combine.hs +2/−22
- Control/Combine/SmallCheck.hs +2/−1
- Control/Combine/Test.hs +2/−1
- function-combine.cabal +4/−3
+ CHANGES view
@@ -0,0 +1,11 @@+== Version 0.1.0 == + +* Update data-type dependency version number + +* Use Data.Type.Nat instead of rolling our own + +== Version 0.0.1 == + +Initial version + +$Header: c:/Source/Haskell/Combine/RCS/CHANGES,v 1.1 2011/09/14 01:57:30 dosuser Exp dosuser $
Control/Combine.hs view
@@ -2,32 +2,12 @@ {-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-} {-# LANGUAGE FlexibleInstances #-} -- --- .$Header: c:/Source/Haskell/Combine/Control/RCS/Combine.hs,v 1.5 2009/12/09 00:54:03 dosuser Exp dosuser $ +-- .$Header: c:/Source/Haskell/Combine/Control/RCS/Combine.hs,v 1.7 2011/09/14 02:00:34 dosuser Exp dosuser $ module Control.Combine where import Data.Type.Apply import Data.Type.Eq - -data Z = Z -data S n = S n - -zero :: Z -zero = Z -one :: S Z -one = S Z -two :: S (S Z) -two = S one -three :: S (S (S Z)) -three = S two - -class Nat n where - fromNat :: Enum e => n -> e - -instance Nat Z where - fromNat _ = toEnum 0 - -instance forall n. Nat n => Nat (S n) where - fromNat _ = succ $ fromNat (undefined :: n) +import Data.Type.Nat class ComposeType n a b c | n a b -> c
Control/Combine/SmallCheck.hs view
@@ -1,9 +1,10 @@ module Control.Combine.SmallCheck where import Control.Combine as C +import Data.Type.Nat as N import Test.SmallCheck as SC -prop_rot2_works a b c = rot C.two (,,) a b c == (b, c, a) +prop_rot2_works a b c = rot N.two (,,) a b c == (b, c, a) where types = (a :: Bool, b :: Bool, c :: Bool) -- vim: expandtab:tabstop=4:shiftwidth=4
Control/Combine/Test.hs view
@@ -1,9 +1,10 @@ {-# LANGUAGE EmptyDataDecls, FlexibleContexts #-} -- -fallow-undecidable-instances --- .$Header: c:/Source/Haskell/Combine/Control/Combine/RCS/Test.hs,v 1.4 2009/12/09 00:55:34 dosuser Exp dosuser $ +-- .$Header: c:/Source/Haskell/Combine/Control/Combine/RCS/Test.hs,v 1.6 2011/09/14 02:00:57 dosuser Exp dosuser $ module Control.Combine.Test where import Data.Type.Eq +import Data.Type.Nat import Control.Combine hiding (C)
function-combine.cabal view
@@ -1,5 +1,5 @@ Name: function-combine -Version: 0.0.1 +Version: 0.1.0 Cabal-version: >= 1.2 Build-Type: Simple Synopsis: Combining functions @@ -13,12 +13,13 @@ Extra-source-files: Control/Combine/Test.hs , Control/Combine/SmallCheck.hs , .ghci + , CHANGES Tested-with: GHC==6.4.1, GHC==6.6.1, GHC==6.8.3, GHC==6.10.4, GHC==6.12.3 - , GHC==7.0.1 + , GHC==7.0.1, GHC==7.0.4 Library Exposed-Modules: Control.Combine if impl(ghc < 6.6.1) Extensions: UndecidableInstances Ghc-options: -fglasgow-exts - Build-Depends: base < 5, data-type < 0.1 + Build-Depends: base < 5, data-type < 0.2 -- vim: expandtab:tabstop=4:shiftwidth=4