diff --git a/Text/GrammarCombinators/Base/Grammar.hs b/Text/GrammarCombinators/Base/Grammar.hs
--- a/Text/GrammarCombinators/Base/Grammar.hs
+++ b/Text/GrammarCombinators/Base/Grammar.hs
@@ -19,6 +19,7 @@
 -}
 {-# LANGUAGE FlexibleContexts #-}
 {-# LANGUAGE FlexibleInstances #-}
+{-# LANGUAGE KindSignatures #-}
 {-# LANGUAGE RankNTypes #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 
@@ -27,15 +28,15 @@
 import Text.GrammarCombinators.Base.ProductionRule
 import Text.GrammarCombinators.Base.MultiRec
 
-type RegularRule phi r t v =
+type RegularRule (phi :: * -> *) (r :: * -> *) t v =
   forall p. (ProductionRule p, EpsProductionRule p, TokenProductionRule p t) =>
   p v
 
-type PenaltyRegularRule phi r t v =
+type PenaltyRegularRule (phi :: * -> *) (r :: * -> *) t v =
   forall p. (ProductionRule p, EpsProductionRule p, TokenProductionRule p t, PenaltyProductionRule p) =>
   p v
 
-type BiasedRegularRule phi r t v =
+type BiasedRegularRule (phi :: * -> *) (r :: * -> *) t v =
   forall p. (ProductionRule p, EpsProductionRule p, TokenProductionRule p t, BiasedProductionRule p) =>
   p v
 
@@ -83,7 +84,7 @@
   forall p. (ProductionRule p, LiftableProductionRule p, RecProductionRule p phi r, TokenProductionRule p t, LoopProductionRule p phi r) =>
   p v
 
-type GGrammar rt phi t r rr = 
+type GGrammar rt phi t (r :: * -> *) (rr :: * -> *) = 
   forall ix. phi ix -> rt phi r t (rr ix)
 type AGrammar rt phi t = forall r. GGrammar rt phi t r (PF phi r)
 type PGrammar rt phi t r = GGrammar rt phi t r r
diff --git a/Text/GrammarCombinators/Parser/Packrat.hs b/Text/GrammarCombinators/Parser/Packrat.hs
--- a/Text/GrammarCombinators/Parser/Packrat.hs
+++ b/Text/GrammarCombinators/Parser/Packrat.hs
@@ -66,7 +66,7 @@
   fromMemo (PRMemo (v, _, _)) (PackratDomainPrimToken) = v
   fromMemo (PRMemo (_, v, _)) (PackratDomainEndOfInput) = v
 
-data PackratValue phi t r ix where
+data PackratValue (phi :: * -> *) t r ix where
   PRPrimTokenValue :: ConcreteToken t -> PackratValue phi t r PRPrimTokenIx
   PREndOfInputValue :: PackratValue phi t r PREndOfInputIx
   PRBaseValue :: r ix -> PackratValue phi t r (PRBaseIx ix)
diff --git a/Text/GrammarCombinators/Utils/CalcFirst.hs b/Text/GrammarCombinators/Utils/CalcFirst.hs
--- a/Text/GrammarCombinators/Utils/CalcFirst.hs
+++ b/Text/GrammarCombinators/Utils/CalcFirst.hs
@@ -34,7 +34,7 @@
 
 import Text.GrammarCombinators.Base
 
-data (Token t) => FirstSet t = 
+data FirstSet t = 
   FS {
     firstSet :: Set t,
     canBeEmpty :: Bool, 
diff --git a/Text/GrammarCombinators/Utils/EnumerateGrammar.hs b/Text/GrammarCombinators/Utils/EnumerateGrammar.hs
--- a/Text/GrammarCombinators/Utils/EnumerateGrammar.hs
+++ b/Text/GrammarCombinators/Utils/EnumerateGrammar.hs
@@ -33,7 +33,7 @@
 
 type EnumerateParserInternalGrammar phi t = forall ix . phi ix -> Int -> [[ConcreteToken t]]
 
-newtype EnumerateProductionRule phi ixT r t v = IPP {
+newtype EnumerateProductionRule phi ixT (r :: * -> *) t v = IPP {
   printIPP :: EnumerateParserInternalGrammar phi t -> Int -> [[ConcreteToken t]]
   }
 
diff --git a/Text/GrammarCombinators/Utils/IsReachable.hs b/Text/GrammarCombinators/Utils/IsReachable.hs
--- a/Text/GrammarCombinators/Utils/IsReachable.hs
+++ b/Text/GrammarCombinators/Utils/IsReachable.hs
@@ -37,35 +37,33 @@
 import Control.Monad.State
 
 newtype SeenGram phi = MkSG { seenIdx :: forall ix. phi ix -> Bool }
-newtype Folder phi n = MkFF { foldIdxs :: (forall ix. phi ix -> n -> n) -> n -> n }
-newtype FoldReachableIntRule phi (r :: * -> *) t (rr :: * -> *) n v = MkFRIR {
-  foldRule :: State (SeenGram phi) (Folder phi n)
-  }
-combineFolders :: Folder phi n -> Folder phi n -> Folder phi n
-combineFolders a b = MkFF $ \f n -> foldIdxs a f $ foldIdxs b f n
-foldDeadEnd :: FoldReachableIntRule phi r t rr n v 
-foldDeadEnd = MkFRIR $ return $ MkFF $ \_ n -> n
-foldVia :: FoldReachableIntRule phi r t rr n v -> FoldReachableIntRule phi r t rr n v' -> FoldReachableIntRule phi r t rr n v''  
-foldVia ra rb = MkFRIR $ do fa <- foldRule ra
-                            fb <- foldRule rb
-                            return $ combineFolders fa fb
 setSeen :: (EqFam phi) => phi ix -> SeenGram phi -> SeenGram phi
 setSeen idx s = MkSG $ overrideIdxK (seenIdx s) idx True
+nothingSeen :: SeenGram phi
+nothingSeen = MkSG $ \_ -> False
+
+type Folder phi n = forall ix. phi ix -> n -> n
+
+newtype FoldReachableIntRule phi (r :: * -> *) t (rr :: * -> *) n v = MkFRIR {
+  foldRule :: Folder phi n -> n -> State (SeenGram phi) n
+  }
 putSeen :: (EqFam phi) => phi ix -> State (SeenGram phi) ()
 putSeen idx = modify $ setSeen idx
-noFold :: Folder phi n
-noFold = MkFF $ const id
-foldIdx :: phi ix -> Folder phi n
-foldIdx idx = MkFF $ \f n -> f idx n
+
+foldDeadEnd :: FoldReachableIntRule phi r t rr n v 
+foldDeadEnd = MkFRIR $ \_ n -> return n
+foldVia :: FoldReachableIntRule phi r t rr n v -> FoldReachableIntRule phi r t rr n v' -> FoldReachableIntRule phi r t rr n v''  
+foldVia ra rb = MkFRIR $ \f n -> do n' <- foldRule ra f n
+                                    foldRule rb f n'
 foldRef :: (EqFam phi) =>
            phi ix -> FoldReachableIntRule phi r t rr n (rr ix) -> 
            FoldReachableIntRule phi r t rr n v
-foldRef idx r = MkFRIR $ do s <- get
-                            if seenIdx s idx
-                              then return noFold
-                              else do putSeen idx
-                                      frec <- foldRule r 
-                                      return $ combineFolders frec $ foldIdx idx
+foldRef idx r = MkFRIR $ \f n -> do sg <- get
+                                    if seenIdx sg idx
+                                      then return n
+                                      else do putSeen idx
+                                              let n' = f idx n
+                                              foldRule r f n'
 
 instance ProductionRule (FoldReachableIntRule phi r t rr n) where
   ra >>> rb = foldVia ra rb
@@ -99,9 +97,6 @@
   manyRef' = foldRef 
   many1Ref' = foldRef 
 
-nothingSeen :: SeenGram phi
-nothingSeen = MkSG $ \_ -> False
-
 -- | Fold a given function over all non-terminals that are reachable 
 -- from a given non-terminal. This function is limited to proper
 -- reachable rules (see 'isReachableProper' for what that means).
@@ -109,8 +104,8 @@
                        GAnyExtendedContextFreeGrammar phi t r rr ->
                        phi ix ->
                        (forall ix'. phi ix' -> n -> n) -> n -> n
-foldReachableProper grammar idx =
-  foldIdxs $ evalState (foldRule (unfoldDepthFirstProper grammar idx)) nothingSeen
+foldReachableProper grammar idx f n =
+  evalState (foldRule (unfoldDepthFirstProper grammar idx) f n) nothingSeen
 
 -- | Fold a given function over all non-terminals that are reachable 
 -- from a given non-terminal. This function will at least fold over the
@@ -119,8 +114,8 @@
                  GAnyExtendedContextFreeGrammar phi t r rr ->
                  phi ix ->
                  (forall ix'. phi ix' -> n -> n) -> n -> n
-foldReachable grammar idx =
-  foldIdxs $ evalState (foldRule (unfoldDepthFirst grammar idx)) nothingSeen
+foldReachable grammar idx f n =
+  evalState (foldRule (unfoldDepthFirst grammar idx) f n) nothingSeen
 
 isReachable' :: forall phi r t rr ix ix'. (Domain phi) => 
                (forall n. 
diff --git a/Text/GrammarCombinators/Utils/ToGraph.hs b/Text/GrammarCombinators/Utils/ToGraph.hs
--- a/Text/GrammarCombinators/Utils/ToGraph.hs
+++ b/Text/GrammarCombinators/Utils/ToGraph.hs
@@ -36,6 +36,8 @@
 
 import Text.GrammarCombinators.Utils.IsReachable
 
+import Data.String (fromString)
+
 import Data.Graph.Inductive.Graph
 
 import Control.Monad.State
@@ -132,19 +134,20 @@
     (contexts, (_,nsn)) = flip runState (depth, sn) $ execWriterT $ processNTDef idx
   in (nsn, reverse contexts)
 
-graphvizParams :: GraphvizParams String String () String
+graphvizParams :: GraphvizParams Node String String () String
 graphvizParams = Params {
   isDirected = True, 
   globalAttributes = [], 
   clusterBy = N, 
-  clusterID = const Nothing,
+  clusterID = \_ -> undefined,
+  isDotCluster = \_ -> undefined,
   fmtCluster = const [],
-  fmtNode = \(_,n) -> [Label $ StrLabel n],
+  fmtNode = \(_,n) -> [toLabel n],
   fmtEdge = \(_,_,_) -> [] 
   }
 
 graphToGraphviz :: Gr String String -> DotGraph Node
-graphToGraphviz gr = setID (Str "Grammar") $ graphToDot graphvizParams (gr :: Gr String String)
+graphToGraphviz gr = setID (Str $ fromString "Grammar") $ graphToDot graphvizParams (gr :: Gr String String)
 
 grammarToContexts :: forall phi t r rr . (Token t, Domain phi) =>
                      (forall b. (forall ix. phi ix -> b -> b) -> b -> b) ->
@@ -171,5 +174,5 @@
                   gr String String
 reachableGrammarToGraph depth gram idx = grammarToGraph (foldReachable gram idx) depth gram
 
-showGraph :: (DotRepr dg n) => dg n -> IO ()
+showGraph :: (PrintDotRepr dg n) => dg n -> IO ()
 showGraph gr = runGraphvizCanvas' gr Xlib >> return ()
diff --git a/Text/GrammarCombinators/Utils/UnfoldDepthFirst.hs b/Text/GrammarCombinators/Utils/UnfoldDepthFirst.hs
--- a/Text/GrammarCombinators/Utils/UnfoldDepthFirst.hs
+++ b/Text/GrammarCombinators/Utils/UnfoldDepthFirst.hs
@@ -44,7 +44,7 @@
   foldReachableFromRule :: UDFGrammar p phi r t rr -> p v
   }
 
-type UDFGrammar p phi r t rr =
+type UDFGrammar p phi (r :: * -> *) t rr =
   forall ix. phi ix -> p (rr ix)
 
 instance (ProductionRule p) => ProductionRule (UnfoldDepthFirstRule p phi r t rr) where
diff --git a/changelog b/changelog
--- a/changelog
+++ b/changelog
@@ -1,5 +1,8 @@
 -*-change-log-*-
 
+0.2.7
+	Fix compilation with GHC 7.4 and recent versions of various
+	libraries.
 0.2.6
 	Fix the previous fix with GHC 7.
 0.2.5 Fix compatibility with non-backwards compatible UUParse 2.7.1.
diff --git a/grammar-combinators.cabal b/grammar-combinators.cabal
--- a/grammar-combinators.cabal
+++ b/grammar-combinators.cabal
@@ -1,5 +1,5 @@
 Name:                grammar-combinators
-Version:             0.2.6
+Version:             0.2.7
 Description:
     The grammar-combinators library is a novel parsing library using
     an explicit representation of recursion to provide various novel
@@ -28,7 +28,8 @@
                      MaybeT >= 0.1.2,
                      uu-parsinglib >= 2.5.1,
                      graphviz >= 2999.10,
-                     fgl >= 5.4.2.2
+                     fgl >= 5.4.2.2,
+                     text >= 0.11
   Exposed-modules:   Text.GrammarCombinators.Base.Domain
                      Text.GrammarCombinators.Base.Grammar
                      Text.GrammarCombinators.Base
