packages feed

regular 0.2.4 → 0.3.0

raw patch · 5 files changed

+7/−102 lines, 5 filesdep ~template-haskell

Dependency ranges changed: template-haskell

Files

examples/Test.hs view
@@ -70,6 +70,3 @@  -- Testing conNames ex9 = conNames (undefined :: Logic)---- Testing deep seq-ex10 = gdseq (Not (T :->: (error "deep seq works"))) ()
regular.cabal view
@@ -1,5 +1,5 @@ name:                   regular-version:                0.2.4+version:                0.3.0 synopsis:               Generic programming library for regular datatypes. description: @@ -21,7 +21,7 @@   \[1] <http://hackage.haskell.org/package/multirec>  category:               Generics-copyright:              (c) 2009 Universiteit Utrecht+copyright:              (c) 2010 Universiteit Utrecht license:                BSD3 license-file:           LICENSE author:                 Jose Pedro Magalhaes@@ -29,7 +29,7 @@ stability:              experimental build-type:             Custom cabal-version:          >= 1.2.1-tested-with:            GHC == 6.10.1+tested-with:            GHC == 6.10.4, GHC == 6.12.1, GHC == 7.0.0.20100925 extra-source-files:     examples/Test.hs                         ChangeLog                         CREDITS@@ -50,13 +50,12 @@                         Generics.Regular.Functions.GMap                         Generics.Regular.Functions.LR                         Generics.Regular.Functions.Read-                        Generics.Regular.Functions.Seq                         Generics.Regular.Functions.Show                         Generics.Regular.Functions.Zip                            build-depends:        base >= 4.0 && < 5   if impl(ghc >= 6.12)-    build-depends:      template-haskell >=2.4 && <2.5+    build-depends:      template-haskell >=2.4 && <2.6     cpp-options:          -DTH_TYVARBNDR   else     build-depends:      template-haskell >= 2.2 && < 2.4
src/Generics/Regular/Functions.hs view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Generics.Regular.Functions--- Copyright   :  (c) 2008 Universiteit Utrecht+-- Copyright   :  (c) 2010 Universiteit Utrecht -- License     :  BSD3 -- -- Maintainer  :  generics@haskell.org@@ -38,9 +38,6 @@     -- * Generating values that are different on top-level     module Generics.Regular.Functions.LR,     -    -- * Deep seq-    module Generics.Regular.Functions.Seq,-         -- * Zipping     module Generics.Regular.Functions.Zip @@ -51,5 +48,4 @@ import Generics.Regular.Functions.Fold import Generics.Regular.Functions.GMap import Generics.Regular.Functions.LR-import Generics.Regular.Functions.Seq import Generics.Regular.Functions.Zip
src/Generics/Regular/Functions/Read.hs view
@@ -6,7 +6,7 @@ ----------------------------------------------------------------------------- -- | -- Module      :  Generics.Regular.Functions.Read--- Copyright   :  (c) 2008 Universiteit Utrecht+-- Copyright   :  (c) 2010 Universiteit Utrecht -- License     :  BSD3 -- -- Maintainer  :  generics@haskell.org@@ -106,7 +106,7 @@                  in  readCons (readPrefixCons f True True name)  -- 2 arguments or more-instance (Constructor c, CountAtoms (f :*: g), Read f, Read g) +instance (Constructor c, CountAtoms f, CountAtoms g, Read f, Read g)           => Read (C c (f:*:g)) where    hreader f _ = let constr = undefined :: C c (f:*:g) r                      name   = conName constr
− src/Generics/Regular/Functions/Seq.hs
@@ -1,87 +0,0 @@-{-# LANGUAGE TypeOperators            #-}-{-# LANGUAGE FlexibleContexts         #-}-{-# LANGUAGE FlexibleInstances        #-}---------------------------------------------------------------------------------- |--- Module      :  Generics.Regular.Functions.Seq--- Copyright   :  (c) 2009 Universiteit Utrecht--- License     :  BSD3------ Maintainer  :  generics@haskell.org--- Stability   :  experimental--- Portability :  non-portable------ Summary: Deep generic seq. Used to fully evaluate a term.--------------------------------------------------------------------------------module Generics.Regular.Functions.Seq (--    DeepSeq (..), Seq(..), gdseq-    -  ) where--import Data.List-import Generics.Regular.Base---- | The class for generic deep seq.-class Seq f where-  gseq :: (a -> b -> b) -> f a -> b -> b--instance Seq I where-  gseq f (I x) = f x---- | For constants we rely on the |DeepSeq| class.-instance (DeepSeq a) => Seq (K a) where-  gseq _ (K x) = dseq x-  -instance Seq U where-  gseq _ U = id--instance (Seq f, Seq g) => Seq (f :+: g) where-  gseq f (L x) = gseq f x-  gseq f (R y) = gseq f y--instance (Seq f, Seq g) => Seq (f :*: g) where-  gseq f (x :*: y) = gseq f x . gseq f y--instance Seq f => Seq (C c f) where-  gseq f (C x) = gseq f x--instance Seq f => Seq (S s f) where-  gseq f (S x) = gseq f x---- | Deep, generic version of seq.--gdseq :: (Regular a, Seq (PF a)) => a -> b -> b-gdseq p = gseq gdseq (from p)---- | A general class for expressing deep seq. It is used in the 'K' case for--- the generic seq.------ We do not give an instance of the form--- @instance (Regular a, Seq (PF a)) => DeepSeq a where dseq = gdseq@--- because this requires undecidable instances. However, any type for which--- there is a generic instance can be given a trivial instance of 'DeepSeq' by--- using 'gdseq'.-class DeepSeq a where-  dseq   :: a -> b -> b-  dseq = seq--instance DeepSeq Int-instance DeepSeq Integer-instance DeepSeq Char-instance DeepSeq Float-instance DeepSeq Double-instance DeepSeq ()--instance DeepSeq a => DeepSeq [a] where-  dseq xs b = foldl' (flip dseq) b xs--instance DeepSeq a => DeepSeq (Maybe a) where-  dseq Nothing  b = b-  dseq (Just a) b = dseq a b--instance (DeepSeq a, DeepSeq b) => DeepSeq (Either a b) where-  dseq (Left  x) b = dseq x b-  dseq (Right x) b = dseq x b