Fix for Generic Haskell, part 1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
This is not the complete fix, other fixes are needed. See http://stackoverflow.com/questions/5739254/how-to-install-generic-haskell.
Index: gh-1.80/src/views/GenericViews.lhs
===================================================================
--- gh-1.80.orig/src/views/GenericViews.lhs
+++ gh-1.80/src/views/GenericViews.lhs
@@ -33,6 +33,7 @@
 > import qualified DescriptorTypes as DE
 > import qualified ListName as LN
 > import qualified Data.Map as M
+> import qualified Data.Maybe as Mb
 > import BuildSyntax
 > import AbstractSyntax
 > import GenericViewsNames
@@ -50,7 +51,7 @@
 A function that given a view generates the representation
 declarations for a given data type declaration.
 
-> processDecl :: Monad m => ViewName -> DeclProcessor (m (ReprDeclarations,ProcDeclarations))
+> processDecl :: ViewName -> DeclProcessor (Maybe (ReprDeclarations,ProcDeclarations))
 > processDecl v decl kind kinds dependencies
 >     = do 
 >       f <- M.lookup v viewReprs
@@ -94,15 +95,15 @@ TODO: add reporting for debugging and ha
 >     process :: ProcDeclaration -> [(ReprDeclarations,ProcDeclarations)]
 >     process (decl,AllViews,kind)
 >         = [ds|v<-viewListInternal
->              ,ds<-processDecl v decl kind kinds dependencies]
+>              ,ds<-Mb.maybeToList $ processDecl v decl kind kinds dependencies]
 >     process (decl,OneView vn,kind)
 >         = [ds|v<-viewListInternal
 >              ,v==vn
->              ,ds<-processDecl v decl kind kinds dependencies]
+>              ,ds<-Mb.maybeToList $ processDecl v decl kind kinds dependencies]
 >     process (decl,AllExcept vn,kind)
 >         = [ds|v<-viewListInternal
 >              ,v/=vn
->              ,ds<-processDecl v decl kind kinds dependencies]
+>              ,ds<-Mb.maybeToList $ processDecl v decl kind kinds dependencies]
 >
 >     getKinds :: ReprDeclarationsAbs () () -> ReprDeclarationsAbs KSubst ()
 >     getKinds (dcls1,dcls2,dcls3,dcls4,_,exps,rqs,_)