diff --git a/changelog.md b/changelog.md
--- a/changelog.md
+++ b/changelog.md
@@ -1,5 +1,9 @@
 # Changelog
 
+## 0.1.5.5
+
+- [compatibility] GHC 7.10 compatibility: sortOn has become more strict, addition of a sortOnLazy
+
 ## 0.1.5.4 - 20150416
 
 - [build] changelog.md included in cabal dist
diff --git a/src/UHC/Util/AssocL.hs b/src/UHC/Util/AssocL.hs
--- a/src/UHC/Util/AssocL.hs
+++ b/src/UHC/Util/AssocL.hs
@@ -1,12 +1,12 @@
 module UHC.Util.AssocL
-	( Assoc, AssocL
-	, assocLMapElt, assocLMapKey
-	, assocLElts, assocLKeys
-	, assocLGroupSort
-	, assocLMapUnzip
-	, ppAssocL, ppAssocL', ppAssocLV
-	, ppCurlysAssocL
-	)
+    ( Assoc, AssocL
+    , assocLMapElt, assocLMapKey
+    , assocLElts, assocLKeys
+    , assocLGroupSort
+    , assocLMapUnzip
+    , ppAssocL, ppAssocL', ppAssocLV
+    , ppCurlysAssocL
+    )
   where
 import UHC.Util.Pretty
 import UHC.Util.Utils
diff --git a/src/UHC/Util/CompileRun.hs b/src/UHC/Util/CompileRun.hs
--- a/src/UHC/Util/CompileRun.hs
+++ b/src/UHC/Util/CompileRun.hs
@@ -82,31 +82,31 @@
 
 -- | Conversion from string to module name
 class CompileModName n where
-  mkCMNm      	:: String -> n
+  mkCMNm        :: String -> n
 
 -- | State of a compile unit
 class CompileUnitState s where
-  cusDefault  		:: s
-  cusUnk      		:: s
-  cusIsUnk      	:: s -> Bool
-  cusIsImpKnown		:: s -> Bool
+  cusDefault        :: s
+  cusUnk            :: s
+  cusIsUnk          :: s -> Bool
+  cusIsImpKnown     :: s -> Bool
 
 -- | Per compile unit
 class CompileUnit u n l s | u -> n l s where
-  cuDefault 		:: u
-  cuFPath   		:: u -> FPath
-  cuUpdFPath    	:: FPath -> u -> u
-  cuLocation		:: u -> l
-  cuUpdLocation 	:: l -> u -> u
-  cuKey     		:: u -> n
-  cuUpdKey      	:: n -> u -> u
-  cuState   		:: u -> s
-  cuUpdState    	:: s -> u -> u
-  cuImports     	:: u -> [n]
-  cuParticipation 	:: u -> [CompileParticipation]
+  cuDefault         :: u
+  cuFPath           :: u -> FPath
+  cuUpdFPath        :: FPath -> u -> u
+  cuLocation        :: u -> l
+  cuUpdLocation     :: l -> u -> u
+  cuKey             :: u -> n
+  cuUpdKey          :: n -> u -> u
+  cuState           :: u -> s
+  cuUpdState        :: s -> u -> u
+  cuImports         :: u -> [n]
+  cuParticipation   :: u -> [CompileParticipation]
 
   -- defaults
-  cuParticipation _	=  []
+  cuParticipation _ =  []
 
 -- | Error reporting
 class FPathError e => CompileRunError e p | e -> p where
@@ -188,7 +188,7 @@
 -- Locatable
 -------------------------------------------------------------------------
 
-class FileLocatable x loc | loc -> x where		-- funcdep has unlogical direction, but well...
+class FileLocatable x loc | loc -> x where      -- funcdep has unlogical direction, but well...
   fileLocation   :: x -> loc
   noFileLocation :: loc
 
@@ -197,14 +197,14 @@
 -------------------------------------------------------------------------
 
 data CompileRunState err
-  = CRSOk									-- continue
-  | CRSFail									-- fail and stop
-  | CRSFailMsg String						-- fail with a message and stop
-  | CRSStopSeq								-- stop current cpSeq
-  | CRSStopAllSeq							-- stop current cpSeq, but also the surrounding ones
-  | CRSStop									-- stop completely
-  | CRSFailErrL String [err] (Maybe Int)	-- fail with errors and stop
-  | CRSErrInfoL String Bool [err]			-- just errors, continue
+  = CRSOk                                   -- continue
+  | CRSFail                                 -- fail and stop
+  | CRSFailMsg String                       -- fail with a message and stop
+  | CRSStopSeq                              -- stop current cpSeq
+  | CRSStopAllSeq                           -- stop current cpSeq, but also the surrounding ones
+  | CRSStop                                 -- stop completely
+  | CRSFailErrL String [err] (Maybe Int)    -- fail with errors and stop
+  | CRSErrInfoL String Bool [err]           -- just errors, continue
 
 data CompileRun nm unit info err
   = CompileRun
@@ -220,23 +220,23 @@
   strMsg = CRSFailMsg
   
 instance Show (CompileRunState err) where
-  show CRSOk				= "CRSOk"
-  show CRSFail				= "CRSFail"
-  show (CRSFailMsg s)		= "CRSFail: " ++ s
-  show CRSStopSeq			= "CRSStopSeq"
-  show CRSStopAllSeq		= "CRSStopAllSeq"
-  show CRSStop				= "CRSStop"
-  show (CRSFailErrL _ _ _)	= "CRSFailErrL"
-  show (CRSErrInfoL _ _ _)	= "CRSErrInfoL"
+  show CRSOk                = "CRSOk"
+  show CRSFail              = "CRSFail"
+  show (CRSFailMsg s)       = "CRSFail: " ++ s
+  show CRSStopSeq           = "CRSStopSeq"
+  show CRSStopAllSeq        = "CRSStopAllSeq"
+  show CRSStop              = "CRSStop"
+  show (CRSFailErrL _ _ _)  = "CRSFailErrL"
+  show (CRSErrInfoL _ _ _)  = "CRSErrInfoL"
 
 mkEmptyCompileRun :: n -> i -> CompileRun n u i e
 mkEmptyCompileRun nm info
   = CompileRun
-      { crCUCache		= Map.empty
-      , crCompileOrder	= []
+      { crCUCache       = Map.empty
+      , crCompileOrder  = []
       , crTopModNm      = nm
-      , crState			= CRSOk
-      , crStateInfo		= info
+      , crState         = CRSOk
+      , crStateInfo     = info
       }
 
 -------------------------------------------------------------------------
@@ -549,9 +549,9 @@
 -- | recursively extract imported modules, providing a way to import + do the import
 cpImportGatherFromModsWithImp
   :: (Show n, Ord n, {- CompileRunner s n p l u i e m, -} CompileUnit u n l s, CompileRunError e p, CompileUnitState s)
-     => (u -> [n])														-- get imports
-     -> (Maybe prev -> n -> CompilePhase n u i e (x,Maybe prev))		-- extract imports from 1 module
-     -> [n]																-- to be imported modules
+     => (u -> [n])                                                      -- get imports
+     -> (Maybe prev -> n -> CompilePhase n u i e (x,Maybe prev))        -- extract imports from 1 module
+     -> [n]                                                             -- to be imported modules
      -> CompilePhase n u i e ()
 cpImportGatherFromModsWithImp getImports imp1Mod modNmL
   = do { cr <- get
@@ -576,8 +576,8 @@
 -- | recursively extract imported modules
 cpImportGatherFromMods
   :: (Show n, Ord n, CompileUnit u n l s, CompileRunError e p, CompileUnitState s)
-     => (Maybe prev -> n -> CompilePhase n u i e (x,Maybe prev))		-- extract imports from 1 module
-     -> [n]																-- to be imported modules
+     => (Maybe prev -> n -> CompilePhase n u i e (x,Maybe prev))        -- extract imports from 1 module
+     -> [n]                                                             -- to be imported modules
      -> CompilePhase n u i e ()
 cpImportGatherFromMods = cpImportGatherFromModsWithImp cuImports
 
diff --git a/src/UHC/Util/CompileRun2.hs b/src/UHC/Util/CompileRun2.hs
--- a/src/UHC/Util/CompileRun2.hs
+++ b/src/UHC/Util/CompileRun2.hs
@@ -92,31 +92,31 @@
 
 -- | Conversion from string to module name
 class CompileModName n where
-  mkCMNm      	:: String -> n
+  mkCMNm        :: String -> n
 
 -- | State of a compile unit
 class CompileUnitState s where
-  cusDefault  		:: s
-  cusUnk      		:: s
-  cusIsUnk      	:: s -> Bool
-  cusIsImpKnown		:: s -> Bool
+  cusDefault        :: s
+  cusUnk            :: s
+  cusIsUnk          :: s -> Bool
+  cusIsImpKnown     :: s -> Bool
 
 -- | Per compile unit
 class CompileUnit u n l s | u -> n l s where
-  cuDefault 		:: u
-  cuFPath   		:: u -> FPath
-  cuUpdFPath    	:: FPath -> u -> u
-  cuLocation		:: u -> l
-  cuUpdLocation 	:: l -> u -> u
-  cuKey     		:: u -> n
-  cuUpdKey      	:: n -> u -> u
-  cuState   		:: u -> s
-  cuUpdState    	:: s -> u -> u
-  cuImports     	:: u -> [n]
-  cuParticipation 	:: u -> [CompileParticipation]
+  cuDefault         :: u
+  cuFPath           :: u -> FPath
+  cuUpdFPath        :: FPath -> u -> u
+  cuLocation        :: u -> l
+  cuUpdLocation     :: l -> u -> u
+  cuKey             :: u -> n
+  cuUpdKey          :: n -> u -> u
+  cuState           :: u -> s
+  cuUpdState        :: s -> u -> u
+  cuImports         :: u -> [n]
+  cuParticipation   :: u -> [CompileParticipation]
 
   -- defaults
-  cuParticipation _	=  []
+  cuParticipation _ =  []
 
 -- | Error reporting
 class {- FPathError e => -} CompileRunError e p | e -> p where
@@ -160,7 +160,7 @@
 -- Locatable
 -------------------------------------------------------------------------
 
-class FileLocatable x loc | loc -> x where		-- funcdep has unlogical direction, but well...
+class FileLocatable x loc | loc -> x where      -- funcdep has unlogical direction, but well...
   fileLocation   :: x -> loc
   noFileLocation :: loc
 
@@ -169,14 +169,14 @@
 -------------------------------------------------------------------------
 
 data CompileRunState err
-  = CRSOk									-- continue
-  | CRSFail									-- fail and stop
-  | CRSFailMsg String						-- fail with a message and stop
-  | CRSStopSeq								-- stop current cpSeq
-  | CRSStopAllSeq							-- stop current cpSeq, but also the surrounding ones
-  | CRSStop									-- stop completely
-  | CRSFailErrL String [err] (Maybe Int)	-- fail with errors and stop
-  | CRSErrInfoL String Bool [err]			-- just errors, continue
+  = CRSOk                                   -- continue
+  | CRSFail                                 -- fail and stop
+  | CRSFailMsg String                       -- fail with a message and stop
+  | CRSStopSeq                              -- stop current cpSeq
+  | CRSStopAllSeq                           -- stop current cpSeq, but also the surrounding ones
+  | CRSStop                                 -- stop completely
+  | CRSFailErrL String [err] (Maybe Int)    -- fail with errors and stop
+  | CRSErrInfoL String Bool [err]           -- just errors, continue
 
 data CompileRun nm unit info err
   = CompileRun
@@ -196,23 +196,23 @@
 -- instance Monad m => MonadError (CompileRunState err) m 
   
 instance Show (CompileRunState err) where
-  show CRSOk				= "CRSOk"
-  show CRSFail				= "CRSFail"
-  show (CRSFailMsg s)		= "CRSFail: " ++ s
-  show CRSStopSeq			= "CRSStopSeq"
-  show CRSStopAllSeq		= "CRSStopAllSeq"
-  show CRSStop				= "CRSStop"
-  show (CRSFailErrL _ _ _)	= "CRSFailErrL"
-  show (CRSErrInfoL _ _ _)	= "CRSErrInfoL"
+  show CRSOk                = "CRSOk"
+  show CRSFail              = "CRSFail"
+  show (CRSFailMsg s)       = "CRSFail: " ++ s
+  show CRSStopSeq           = "CRSStopSeq"
+  show CRSStopAllSeq        = "CRSStopAllSeq"
+  show CRSStop              = "CRSStop"
+  show (CRSFailErrL _ _ _)  = "CRSFailErrL"
+  show (CRSErrInfoL _ _ _)  = "CRSErrInfoL"
 
 mkEmptyCompileRun :: n -> i -> CompileRun n u i e
 mkEmptyCompileRun nm info
   = CompileRun
-      { _crCUCache			= Map.empty
-      , _crCompileOrder		= []
-      , _crTopModNm      	= nm
-      , _crState			= CRSOk
-      , _crStateInfo		= info
+      { _crCUCache          = Map.empty
+      , _crCompileOrder     = []
+      , _crTopModNm         = nm
+      , _crState            = CRSOk
+      , _crStateInfo        = info
       }
 
 -------------------------------------------------------------------------
@@ -479,9 +479,9 @@
 -- | recursively extract imported modules, providing a way to import + do the import
 cpImportGatherFromModsWithImp
   :: (Show n, Ord n, CompileRunner s n p l u i e m)
-     => (u -> [n])														-- get imports
-     -> (Maybe prev -> n -> CompilePhaseT n u i e m (x,Maybe prev))		-- extract imports from 1 module
-     -> [n]																-- to be imported modules
+     => (u -> [n])                                                      -- get imports
+     -> (Maybe prev -> n -> CompilePhaseT n u i e m (x,Maybe prev))     -- extract imports from 1 module
+     -> [n]                                                             -- to be imported modules
      -> CompilePhaseT n u i e m ()
 cpImportGatherFromModsWithImp getImports imp1Mod modNmL
   = do { cr <- get
@@ -506,8 +506,8 @@
 -- | recursively extract imported modules
 cpImportGatherFromMods
   :: (Show n, Ord n, CompileRunner s n p l u i e m)
-     => (Maybe prev -> n -> CompilePhaseT n u i e m (x,Maybe prev))		-- extract imports from 1 module
-     -> [n]																-- to be imported modules
+     => (Maybe prev -> n -> CompilePhaseT n u i e m (x,Maybe prev))     -- extract imports from 1 module
+     -> [n]                                                             -- to be imported modules
      -> CompilePhaseT n u i e m ()
 cpImportGatherFromMods = cpImportGatherFromModsWithImp cuImports
 
diff --git a/src/UHC/Util/ParseUtils.hs b/src/UHC/Util/ParseUtils.hs
--- a/src/UHC/Util/ParseUtils.hs
+++ b/src/UHC/Util/ParseUtils.hs
@@ -45,14 +45,16 @@
 -------------------------------------------------------------------------
 
 type LayoutParser tok ep
-  = (IsParser (OffsideParser i o tok p) tok,InputState i tok p, OutputState o, Position p)
+  = forall i o p .
+    (IsParser (OffsideParser i o tok p) tok,InputState i tok p, OutputState o, Position p)
        => OffsideParser i o tok p ep
 
 type LayoutParser2 tok ep
-  = (IsParser (OffsideParser i o tok p) tok,InputState i tok p, OutputState o, Position p)
+  = forall i o p .
+    (IsParser (OffsideParser i o tok p) tok,InputState i tok p, OutputState o, Position p)
        => OffsideParser i o tok p ep -> OffsideParser i o tok p ep
 
-type PlainParser tok gp = IsParser p tok => p gp
+type PlainParser tok gp = forall p . IsParser p tok => p gp
 
 -------------------------------------------------------------------------
 -- Parsing utils
diff --git a/src/UHC/Util/PrettySimple.hs b/src/UHC/Util/PrettySimple.hs
--- a/src/UHC/Util/PrettySimple.hs
+++ b/src/UHC/Util/PrettySimple.hs
@@ -35,17 +35,17 @@
 
 -- | Cached info about combi of sub Docs
 data Cached = Cached
-    { cchEmp :: !Bool		-- ^ is it empty
-    , cchSng :: !Bool		-- ^ is it a single line
+    { cchEmp :: !Bool       -- ^ is it empty
+    , cchSng :: !Bool       -- ^ is it a single line
     }
 
 -- | Doc structure
 data Doc
   = Emp
-  | Str			!String					-- basic string
-  | Hor			!Cached !Doc  !Doc		-- horizontal positioning
-  | Ver			!Cached !Doc  !Doc		-- vertical positioning
-  | Ind			!Int !Doc				-- indent
+  | Str         !String                 -- basic string
+  | Hor         !Cached !Doc  !Doc      -- horizontal positioning
+  | Ver         !Cached !Doc  !Doc      -- vertical positioning
+  | Ind         !Int !Doc               -- indent
 
 type PP_Doc = Doc
 
@@ -70,7 +70,7 @@
 
 -- | PP vertically above
 (>-<) :: (PP a, PP b) => a -> b -> PP_Doc
-l >-< r = cached mkcch Ver l r -- pp l `Ver` pp r	-- pp l <$$> pp r
+l >-< r = cached mkcch Ver l r -- pp l `Ver` pp r   -- pp l <$$> pp r
   where mkcch l r = Cached (empl && empr) sng
           where empl = isEmpty l
                 empr = isEmpty r
diff --git a/src/UHC/Util/RelMap.hs b/src/UHC/Util/RelMap.hs
--- a/src/UHC/Util/RelMap.hs
+++ b/src/UHC/Util/RelMap.hs
@@ -45,8 +45,8 @@
 -- | Relation, represented as 2 maps from domain to range and the inverse, thus allowing faster lookup at the expense of some set like operations more expensive.
 data Rel a b
   = Rel
-     { relDomMp :: RelMap a b		-- ^ from domain to range
-     , relRngMp :: RelMap b a		-- ^ from range to domain
+     { relDomMp :: RelMap a b       -- ^ from domain to range
+     , relRngMp :: RelMap b a       -- ^ from range to domain
      }
 
 -- | As assocation list
diff --git a/src/UHC/Util/ScanUtils.hs b/src/UHC/Util/ScanUtils.hs
--- a/src/UHC/Util/ScanUtils.hs
+++ b/src/UHC/Util/ScanUtils.hs
@@ -127,8 +127,8 @@
         ,   scoOffsideClose     ::  !String                 -- offside close symbol
         ,   scoLitmode          ::  !Bool                   -- do literal scanning
         ,   scoVerbOpenClose    ::  ![(String,String)]      -- open/close pairs used for verbatim text
-        ,   scoAllowQualified   ::  !Bool  					-- allow qualified variations, i.e. prefixing with "XXX."
-        ,   scoAllowFloat       ::  !Bool  					-- allow float notation, i.e. numbers with dots inside
+        ,   scoAllowQualified   ::  !Bool                   -- allow qualified variations, i.e. prefixing with "XXX."
+        ,   scoAllowFloat       ::  !Bool                   -- allow float notation, i.e. numbers with dots inside
         }
 
 defaultScanOpts :: ScanOpts
@@ -151,7 +151,7 @@
         ,   scoOffsideClose     =   ""
         ,   scoLitmode          =   False
         ,   scoVerbOpenClose    =   []
-        ,   scoAllowQualified   =	True
+        ,   scoAllowQualified   =   True
         ,   scoAllowFloat       =   True
         }
 
diff --git a/src/UHC/Util/ScopeMapGam.hs b/src/UHC/Util/ScopeMapGam.hs
--- a/src/UHC/Util/ScopeMapGam.hs
+++ b/src/UHC/Util/ScopeMapGam.hs
@@ -46,9 +46,9 @@
     , sgamToAssocDupL, sgamFromAssocDupL
     , sgamNoDups
 
-	-- * Re-exports
-	, MetaLev
-	, metaLevVal
+    -- * Re-exports
+    , MetaLev
+    , metaLevVal
     )
   where
 
@@ -68,12 +68,12 @@
 
 -- Scope Gam, a Gam with entries having a level in a scope, and the Gam a scope
 
-type Scp = [Int]									-- ^ a stack of scope idents defines what's in scope
+type Scp = [Int]                                    -- ^ a stack of scope idents defines what's in scope
 
 data SGamElt v
   = SGamElt
-      { sgeScpId	:: !Int							-- ^ scope ident
-      , sgeVal		:: v							-- ^ the value
+      { sgeScpId    :: !Int                         -- ^ scope ident
+      , sgeVal      :: v                            -- ^ the value
       }
   deriving (Typeable, Data)
 
@@ -84,9 +84,9 @@
 
 data SGam k v
   = SGam
-      { sgScpId		:: !Int							-- ^ current scope, increment with each change in scope
-      , sgScp		:: !Scp							-- ^ scope stack
-      , sgMap		:: SMap k v						-- ^ map holding the values
+      { sgScpId     :: !Int                         -- ^ current scope, increment with each change in scope
+      , sgScp       :: !Scp                         -- ^ scope stack
+      , sgMap       :: SMap k v                     -- ^ map holding the values
       }
   deriving (Typeable, Data)
 
diff --git a/src/UHC/Util/Serialize.hs b/src/UHC/Util/Serialize.hs
--- a/src/UHC/Util/Serialize.hs
+++ b/src/UHC/Util/Serialize.hs
@@ -70,20 +70,20 @@
 {-# LANGUAGE FlexibleContexts #-}
 
 module UHC.Util.Serialize
-	( SPut
-	, SGet
-	, Serialize (..)
-	, sputPlain, sgetPlain
-	, sputUnshared, sputShared
-	, sgetShared
-	, sputWord8, sgetWord8
-	, sputWord16, sgetWord16
-	, sputEnum8, sgetEnum8
-	, runSPut, runSGet
-	, serialize, unserialize
-	, putSPutFile, getSGetFile
-	, putSerializeFile, getSerializeFile
-	)
+    ( SPut
+    , SGet
+    , Serialize (..)
+    , sputPlain, sgetPlain
+    , sputUnshared, sputShared
+    , sgetShared
+    , sputWord8, sgetWord8
+    , sputWord16, sgetWord16
+    , sputEnum8, sgetEnum8
+    , runSPut, runSGet
+    , serialize, unserialize
+    , putSPutFile, getSGetFile
+    , putSerializeFile, getSerializeFile
+    )
   where
 import qualified UHC.Util.Binary as Bn
 import qualified Data.ByteString.Lazy as L
@@ -110,7 +110,7 @@
 -}
 data SCmd
   = SCmd_Unshared
-  | SCmd_ShareDef   | SCmd_ShareRef			--
+  | SCmd_ShareDef   | SCmd_ShareRef         --
   | SCmd_ShareDef16 | SCmd_ShareRef16
   | SCmd_ShareDef8  | SCmd_ShareRef8
   deriving (Enum)
diff --git a/src/UHC/Util/Time.hs b/src/UHC/Util/Time.hs
--- a/src/UHC/Util/Time.hs
+++ b/src/UHC/Util/Time.hs
@@ -2,12 +2,12 @@
 
 module UHC.Util.Time
   ( module Data.Time.Compat,
-	module Data.Time,
-	module Data.Time.Clock,
-	ClockTime,
-	diffClockTimes,
-	noTimeDiff,
-	getClockTime
+    module Data.Time,
+    module Data.Time.Clock,
+    ClockTime,
+    diffClockTimes,
+    noTimeDiff,
+    getClockTime
   )
   where
 
diff --git a/src/UHC/Util/Utils.hs b/src/UHC/Util/Utils.hs
--- a/src/UHC/Util/Utils.hs
+++ b/src/UHC/Util/Utils.hs
@@ -37,6 +37,7 @@
   , panic
   
   , isSortedByOn
+  , sortOnLazy
   , sortOn
   , sortByOn
   , groupOn
@@ -172,16 +173,16 @@
 spanOnRest :: ([a] -> Bool) -> [a] -> ([a],[a])
 spanOnRest p []       = ([],[])
 spanOnRest p xs@(x:xs')
-	 | p xs      = (x:ys, zs)
-	 | otherwise = ([],xs)
-					   where (ys,zs) = spanOnRest p xs'
+     | p xs      = (x:ys, zs)
+     | otherwise = ([],xs)
+                       where (ys,zs) = spanOnRest p xs'
 
 -------------------------------------------------------------------------
 -- Tupling, untupling
 -------------------------------------------------------------------------
 
-tup123to1  (a,_,_) = a			-- aka fst3
-tup123to2  (_,a,_) = a			-- aka snd3
+tup123to1  (a,_,_) = a          -- aka fst3
+tup123to2  (_,a,_) = a          -- aka snd3
 tup123to12 (a,b,_) = (a,b)
 tup123to23 (_,a,b) = (a,b)
 tup12to123 c (a,b) = (a,b,c)
@@ -249,10 +250,18 @@
   where isSrt (x1:tl@(x2:_)) = cmp (sel x1) (sel x2) /= GT && isSrt tl
         isSrt _              = True
 
+-- | A slightly more lazy version of Data.List.sortOn.
+-- See also https://github.com/UU-ComputerScience/uhc-util/issues/5 .
+sortOnLazy :: Ord b => (a -> b) -> [a] -> [a]
+sortOnLazy = sortByOn compare
+{-# INLINE sortOnLazy #-}
+
 #if __GLASGOW_HASKELL__ >= 710
 #else
+-- | The original Data.List.sortOn.
+-- See also https://github.com/UU-ComputerScience/uhc-util/issues/5 .
 sortOn :: Ord b => (a -> b) -> [a] -> [a]
-sortOn = sortByOn compare
+sortOn = sortOnLazy
 {-# INLINE sortOn #-}
 #endif
 
diff --git a/src/UHC/Util/VarLookup.hs b/src/UHC/Util/VarLookup.hs
--- a/src/UHC/Util/VarLookup.hs
+++ b/src/UHC/Util/VarLookup.hs
@@ -9,16 +9,16 @@
 #endif
 
 module UHC.Util.VarLookup
-	( VarLookup (..)
-	, varlookupMap
-	, VarLookupFix, varlookupFix
-	, varlookupFixDel
-	, VarLookupCmb (..)
-	, VarLookupBase (..)
-	, VarLookupCmbFix, varlookupcmbFix
-	
-	, MetaLev
-	, metaLevVal
+    ( VarLookup (..)
+    , varlookupMap
+    , VarLookupFix, varlookupFix
+    , varlookupFixDel
+    , VarLookupCmb (..)
+    , VarLookupBase (..)
+    , VarLookupCmbFix, varlookupcmbFix
+    
+    , MetaLev
+    , metaLevVal
     )
   where
 
diff --git a/src/UHC/Util/VarMp.hs b/src/UHC/Util/VarMp.hs
--- a/src/UHC/Util/VarMp.hs
+++ b/src/UHC/Util/VarMp.hs
@@ -21,65 +21,65 @@
 {-# LANGUAGE OverlappingInstances #-}
 
 module UHC.Util.VarMp
-	( VarMp'(..)
-	-- , VarMp
-	, ppVarMpV
-	-- , vmiMbTy
-	-- , tyAsVarMp', tyAsVarMp
-	-- , varmpFilterTy
-	, varmpFilter
-	, varmpDel, (|\>)
-	, varmpAlter
-	, varmpUnion, varmpUnions
-	--, varmpTyLookupCyc
-	--, varmpTyLookupCyc2
-	, module UHC.Util.VarLookup
-	-- , VarMpInfo (..)
-	, mkVarMp
-	, emptyVarMp, varmpIsEmpty
-	, varmpShiftMetaLev, varmpIncMetaLev, varmpDecMetaLev
-	, varmpSelectMetaLev
-	, varmpKeys, varmpKeysSet
-	, varmpMetaLevSingleton, varmpSingleton
-	, assocMetaLevLToVarMp, assocLToVarMp
-	-- , assocMetaLevTyLToVarMp, assocTyLToVarMp, varmpToAssocTyL
-	, varmpToAssocL
-	, varmpPlus
-	, varmpUnionWith
-	-- , instToL1VarMp
-	-- , varmpMetaLevTyUnit, varmpTyUnit
-	-- , tyRestrictKiVarMp
-	, varmpLookup
-	-- , varmpTyLookup
-	, ppVarMp
-	, varmpAsMap
-	, varmpMapMaybe, varmpMap
-	, varmpInsertWith
-	, VarMpStk'
-	, emptyVarMpStk, varmpstkUnit
-	, varmpstkPushEmpty, varmpstkPop
-	, varmpstkToAssocL, varmpstkKeysSet
-	, varmpstkUnions
-	, varmpSize
-	-- , vmiMbImpls, vmiMbScope, vmiMbPred, vmiMbAssNm
-	-- , varmpTailAddOcc
-	-- , varmpMapThr
-	-- , varmpMapThrTy
-	-- , varmpImplsUnit, assocImplsLToVarMp, varmpScopeUnit, varmpPredUnit, varmpAssNmUnit
-	-- , varmpImplsLookup, varmpScopeLookup, varmpPredLookup
-	-- , varmpImplsLookupImplsCyc, varmpImplsLookupCyc, varmpScopeLookupScopeCyc, varmpAssNmLookupAssNmCyc
-	-- , varmpPredLookup2, varmpScopeLookup2, varmpAssNmLookup2, varmpImplsLookupCyc2
-	-- , vmiMbLabel, vmiMbOffset
-	-- , varmpLabelUnit, varmpOffsetUnit
-	-- , varmpLabelLookup, varmpOffsetLookup
-	-- , varmpLabelLookupCyc, varmpLabelLookupLabelCyc
-	-- , vmiMbPredSeq
-	-- , varmpPredSeqUnit
-	-- , varmpPredSeqLookup
-	, varmpToMap
-	-- , varmpinfoMkVar
-	-- , ppVarMpInfoCfgTy, ppVarMpInfoDt
-	)
+    ( VarMp'(..)
+    -- , VarMp
+    , ppVarMpV
+    -- , vmiMbTy
+    -- , tyAsVarMp', tyAsVarMp
+    -- , varmpFilterTy
+    , varmpFilter
+    , varmpDel, (|\>)
+    , varmpAlter
+    , varmpUnion, varmpUnions
+    --, varmpTyLookupCyc
+    --, varmpTyLookupCyc2
+    , module UHC.Util.VarLookup
+    -- , VarMpInfo (..)
+    , mkVarMp
+    , emptyVarMp, varmpIsEmpty
+    , varmpShiftMetaLev, varmpIncMetaLev, varmpDecMetaLev
+    , varmpSelectMetaLev
+    , varmpKeys, varmpKeysSet
+    , varmpMetaLevSingleton, varmpSingleton
+    , assocMetaLevLToVarMp, assocLToVarMp
+    -- , assocMetaLevTyLToVarMp, assocTyLToVarMp, varmpToAssocTyL
+    , varmpToAssocL
+    , varmpPlus
+    , varmpUnionWith
+    -- , instToL1VarMp
+    -- , varmpMetaLevTyUnit, varmpTyUnit
+    -- , tyRestrictKiVarMp
+    , varmpLookup
+    -- , varmpTyLookup
+    , ppVarMp
+    , varmpAsMap
+    , varmpMapMaybe, varmpMap
+    , varmpInsertWith
+    , VarMpStk'
+    , emptyVarMpStk, varmpstkUnit
+    , varmpstkPushEmpty, varmpstkPop
+    , varmpstkToAssocL, varmpstkKeysSet
+    , varmpstkUnions
+    , varmpSize
+    -- , vmiMbImpls, vmiMbScope, vmiMbPred, vmiMbAssNm
+    -- , varmpTailAddOcc
+    -- , varmpMapThr
+    -- , varmpMapThrTy
+    -- , varmpImplsUnit, assocImplsLToVarMp, varmpScopeUnit, varmpPredUnit, varmpAssNmUnit
+    -- , varmpImplsLookup, varmpScopeLookup, varmpPredLookup
+    -- , varmpImplsLookupImplsCyc, varmpImplsLookupCyc, varmpScopeLookupScopeCyc, varmpAssNmLookupAssNmCyc
+    -- , varmpPredLookup2, varmpScopeLookup2, varmpAssNmLookup2, varmpImplsLookupCyc2
+    -- , vmiMbLabel, vmiMbOffset
+    -- , varmpLabelUnit, varmpOffsetUnit
+    -- , varmpLabelLookup, varmpOffsetLookup
+    -- , varmpLabelLookupCyc, varmpLabelLookupLabelCyc
+    -- , vmiMbPredSeq
+    -- , varmpPredSeqUnit
+    -- , varmpPredSeqLookup
+    , varmpToMap
+    -- , varmpinfoMkVar
+    -- , ppVarMpInfoCfgTy, ppVarMpInfoDt
+    )
   where
 
 import Data.List
@@ -108,8 +108,8 @@
 
 data VarMp' k v
   = VarMp
-      { varmpMetaLev 	:: !MetaLev				-- ^ the base meta level
-      , varmpMpL 		:: [Map.Map k v]		-- ^ for each level a map, starting at the base meta level
+      { varmpMetaLev    :: !MetaLev             -- ^ the base meta level
+      , varmpMpL        :: [Map.Map k v]        -- ^ for each level a map, starting at the base meta level
       }
   deriving ( Eq, Ord
            , Typeable, Data
@@ -351,7 +351,7 @@
   = case i of
       VMITy       t -> mkTyVar v
       VMIImpls    i -> mkImplsVar v
-      _             -> mkTyVar v					-- rest incomplete
+      _             -> mkTyVar v                    -- rest incomplete
 
 varmpMetaLevTyUnit :: Ord k => MetaLev -> k -> Ty -> VarMp' k VarMpInfo
 varmpMetaLevTyUnit mlev v t = varmpMetaLevSingleton mlev v (VMITy t)
@@ -530,7 +530,7 @@
   = case i of
       VMITy       t -> ppTyWithCfg    c t
       VMIImpls    i -> ppImplsWithCfg c i
-      VMIScope    s -> pp s						-- rest incomplete
+      VMIScope    s -> pp s                     -- rest incomplete
       VMIPred     p -> pp p
       VMILabel    x -> pp x
       VMIOffset   x -> pp x
diff --git a/uhc-util.cabal b/uhc-util.cabal
--- a/uhc-util.cabal
+++ b/uhc-util.cabal
@@ -1,5 +1,5 @@
 Name:				uhc-util
-Version:			0.1.5.4
+Version:			0.1.5.5
 cabal-version:      >= 1.6
 License:			BSD3
 Copyright:			Utrecht University, Department of Information and Computing Sciences, Software Technology group
