Permalink
Browse files

Merge branch 'master' into limited-composition

  • Loading branch information...
2 parents d8a3dbe + be17e94 commit 5b8513c3cc18acf1af9ba1b68f108431446133ee @kosmikus committed Aug 12, 2011
View
@@ -0,0 +1,2 @@
+dist/
+*~
View
@@ -21,6 +21,7 @@ import Generics.MultiRec.Fold (con, tag)
import Generics.MultiRec.FoldAlg as FA
import Generics.MultiRec.Eq
import Generics.MultiRec.Show as GS
+import Generics.MultiRec.Read as GR
-- | Example expression
@@ -122,3 +123,8 @@ testEq = (example == example, example == testRename)
testShow :: IO ()
testShow = putStrLn $ GS.show Expr example
+
+-- | Test for generic show, read and equality
+
+testReadShowEq :: Bool
+testReadShowEq = GR.read Expr (GS.show Expr example) == example
View
@@ -98,3 +98,10 @@ instance Fam AST where
to Var (R (R (Tag (K x)))) = x
+-- ** EqS instance
+
+instance EqS AST where
+ eqS Expr Expr = Just Refl
+ eqS Decl Decl = Just Refl
+ eqS Var Var = Just Refl
+ eqS _ _ = Nothing
View
@@ -1,5 +1,5 @@
name: multirec
-version: 0.4.1
+version: 0.5.1
license: BSD3
license-file: LICENSE
author: Alexey Rodriguez,
@@ -10,6 +10,7 @@ maintainer: generics@haskell.org
category: Generics
synopsis: Generic programming for families of recursive datatypes
homepage: http://www.cs.uu.nl/wiki/GenericProgramming/Multirec
+bug-reports: https://github.com/kosmikus/multirec/issues
description:
Many generic programs require information about the recursive positions
of a datatype. Examples include the generic fold, generic rewriting or
@@ -36,10 +37,26 @@ description:
stability: experimental
build-type: Simple
-cabal-version: >= 1.2.1
-tested-with: GHC == 6.8.3, GHC == 6.10.3, GHC == 6.12.1
-hs-source-dirs: src
-exposed-modules: Generics.MultiRec
+cabal-version: >= 1.6
+tested-with: GHC == 7.0.4
+extra-source-files: examples/AST.hs
+ examples/ASTUse.hs
+ examples/ASTTHUse.hs
+ examples/ASTExamples.hs
+ examples/Single.hs
+ examples/SingleUse.hs
+ examples/SingleTHUse.hs
+ examples/SingleExamples.hs
+ CREDITS
+
+source-repository head
+ type: git
+ location: https://github.com/kosmikus/multirec
+
+library
+ hs-source-dirs: src
+ -- ghc-options: -Wall -fno-warn-name-shadowing -fno-warn-unused-binds -fno-warn-unused-matches
+ exposed-modules: Generics.MultiRec
-- Base
Generics.MultiRec.Base
@@ -56,18 +73,10 @@ exposed-modules: Generics.MultiRec
Generics.MultiRec.FoldAlgK
Generics.MultiRec.Compos
Generics.MultiRec.Eq
+ Generics.MultiRec.Read
Generics.MultiRec.Show
-- Extra
Generics.MultiRec.TEq
-extra-source-files: examples/AST.hs
- examples/ASTUse.hs
- examples/ASTTHUse.hs
- examples/ASTExamples.hs
- examples/Single.hs
- examples/SingleUse.hs
- examples/SingleTHUse.hs
- examples/SingleExamples.hs
- CREDITS
-build-depends: base >= 3.0 && < 5, template-haskell >= 2.2 && < 2.5
+ build-depends: base >= 3.0 && < 5, template-haskell >= 2.2 && < 2.7
@@ -9,7 +9,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Base
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -4,7 +4,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Compos
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -8,7 +8,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.ConNames
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -23,7 +23,6 @@
module Generics.MultiRec.ConNames where
import Generics.MultiRec.Base
-import Generics.MultiRec.Constructor
class ConNames (f :: (* -> *) -> * -> *) where
hconNames :: f r ix -> [String]
@@ -3,7 +3,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Constructor
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -8,7 +8,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Eq
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -9,7 +9,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Fold
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -96,3 +96,4 @@ tag f (Tag x) = f x
con :: AlgPart a r ix -> AlgPart (C c a) r ix
con f (C x) = f x
+
@@ -11,7 +11,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.FoldAlg
--- Copyright : (c) 2009 Universiteit Utrecht
+-- Copyright : (c) 2009--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -11,7 +11,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.FoldAlgK
--- Copyright : (c) 2009 Universiteit Utrecht
+-- Copyright : (c) 2009--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -9,7 +9,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.FoldK
--- Copyright : (c) 2009 Universiteit Utrecht
+-- Copyright : (c) 2009--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -27,7 +27,6 @@ import Generics.MultiRec.Base
import Generics.MultiRec.HFunctor
import Control.Monad hiding (foldM)
-import Control.Applicative
-- * Generic fold and unfold
@@ -5,7 +5,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.HFix
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -7,7 +7,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.HFunctor
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -19,7 +19,6 @@
-----------------------------------------------------------------------------
module Generics.MultiRec.HFunctor where
-import Control.Monad (liftM, liftM2)
import Control.Applicative (Applicative(..), (<$>), (<*>), WrappedMonad(..))
import Data.Traversable (Traversable(..))
@@ -11,7 +11,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Read
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2009--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -156,6 +156,7 @@ readNoArgsCons p f name = parens $
guard (n==name)
return U
+appPrec :: Int
appPrec = 10
@@ -9,7 +9,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.Show
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -5,7 +5,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.TEq
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -5,7 +5,7 @@
-----------------------------------------------------------------------------
-- |
-- Module : Generics.MultiRec.TH
--- Copyright : (c) 2008--2009 Universiteit Utrecht
+-- Copyright : (c) 2008--2010 Universiteit Utrecht
-- License : BSD3
--
-- Maintainer : generics@haskell.org
@@ -30,7 +30,6 @@ module Generics.MultiRec.TH
) where
import Generics.MultiRec.Base
-import Generics.MultiRec.Constructor
import Language.Haskell.TH hiding (Fixity())
import Language.Haskell.TH.Syntax (Lift(..))
import Control.Monad

0 comments on commit 5b8513c

Please sign in to comment.