diff --git a/csound-expression-dynamic.cabal b/csound-expression-dynamic.cabal
--- a/csound-expression-dynamic.cabal
+++ b/csound-expression-dynamic.cabal
@@ -1,6 +1,6 @@
 Name:          csound-expression-dynamic
-Version:       0.3.3
-Cabal-Version: >= 1.6
+Version:       0.3.4
+Cabal-Version: >= 1.10
 License:       BSD3
 License-file:  LICENSE
 Author:	       Anton Kholomiov
@@ -25,8 +25,10 @@
   Ghc-Options:    -Wall
   Build-Depends:
         base >= 4, base < 5, data-default, containers, array, transformers >= 0.3, wl-pprint >= 1.2.1,
-        Boolean >= 0.1.0, data-fix, data-fix-cse >= 0.0.2, hashable
+        Boolean >= 0.1.0, data-fix >= 0.3.0, data-fix-cse >= 0.0.3, hashable,
+        deriving-compat
   Hs-Source-Dirs:      src/
+  default-language: Haskell2010
   Exposed-Modules:
     Csound.Dynamic
 
diff --git a/src/Csound/Dynamic/Build.hs b/src/Csound/Dynamic/Build.hs
--- a/src/Csound/Dynamic/Build.hs
+++ b/src/Csound/Dynamic/Build.hs
@@ -14,7 +14,7 @@
     numExp1, numExp2,
     tfm, tfmNoInlineArgs, pn, withInits,
     double, int, str, verbatim, instrIdE,
-    inlineVar,
+    inlineVar, gInit, gInitDouble,
 
     -- ** Opcodes constructors
     Spec1, spec1, opcs, opcsNoInlineArgs, opr1, opr1k, infOpr, oprBy,
diff --git a/src/Csound/Dynamic/Build/Numeric.hs b/src/Csound/Dynamic/Build/Numeric.hs
--- a/src/Csound/Dynamic/Build/Numeric.hs
+++ b/src/Csound/Dynamic/Build/Numeric.hs
@@ -172,3 +172,4 @@
 fracE   = unOpt (snd . (properFraction :: (Double -> (Int, Double)))) (opr1 "frac")
 intE    = doubleToInt truncate (opr1 "int")
 
+
diff --git a/src/Csound/Dynamic/Tfm/Liveness.hs b/src/Csound/Dynamic/Tfm/Liveness.hs
--- a/src/Csound/Dynamic/Tfm/Liveness.hs
+++ b/src/Csound/Dynamic/Tfm/Liveness.hs
@@ -22,8 +22,8 @@
 
 liveness :: Traversable f => Int -> Dag f -> Dag f
 liveness lastFreshId as = runST $ do
-	st <- initSt lastFreshId $ analyse lastFreshId as
-	evalStateT (mapM substExp $ countLines $ as) st
+  st <- initSt lastFreshId $ analyse lastFreshId as
+  evalStateT (mapM substExp $ countLines $ as) st
 
 type LineNumber = Int
 
@@ -47,15 +47,15 @@
 allocId :: IdList -> (Int, IdList)
 allocId (IdList is lastId) = (head is, IdList (tail is) (max (head is) lastId))
 
-freeId :: Int -> IdList -> IdList 
+freeId :: Int -> IdList -> IdList
 freeId  n (IdList is lastId) = IdList (insertSorted n is) lastId1
-	where lastId1 = if (n == lastId) then (lastId - 1) else lastId
+  where lastId1 = if (n == lastId) then (lastId - 1) else lastId
 
 insertSorted :: Int -> [Int] -> [Int]
-insertSorted n (a:as) 
-	| n < a  = n : a : as
-	| n == a = a : as
-	| otherwise = a : insertSorted n as 
+insertSorted n (a:as)
+  | n < a  = n : a : as
+  | n == a = a : as
+  | otherwise = a : insertSorted n as
 insertSorted n [] = [n]
 
 -----------------------------------------------
@@ -65,7 +65,7 @@
 type LivenessTable = A.UArray Int Int
 type SubstTable s  = StArr s
 
-data Registers s = Registers 
+data Registers s = Registers
 	{ registers 	:: M.Map Rate IdList
 	, livenessTable :: LivenessTable
 	, substTable 	:: SubstTable s
@@ -92,7 +92,7 @@
 
 saveSubst :: Int -> Int -> Memory s ()
 saveSubst from to = do
-	tab <- fmap substTable get 
+	tab <- fmap substTable get
 	lift $ A.writeArray tab from to
 
 substLhs :: Var -> Memory s Var
@@ -110,20 +110,20 @@
 	return v1
 
 allocAndSkipInits :: Var -> Memory s Var
-allocAndSkipInits v 
+allocAndSkipInits v
     | isInit r  = return v
     | otherwise = alloc r
-    where 
+    where
         r = varType v
         isInit x = x == Ir || x == Sr
 
 alloc :: Rate -> Memory s Var
-alloc rate = state $ \mem -> 
+alloc rate = state $ \mem ->
 	let (i, mem1) = allocRegister rate mem
 	in  (D.Var i rate, mem1)
-	where 
+	where
 		allocRegister :: Rate -> Registers s -> (Int, Registers s)
-		allocRegister r mem = (i, onRegs (M.update (const $ Just is) r) mem) 
+		allocRegister r mem = (i, onRegs (M.update (const $ Just is) r) mem)
 			where (i, is) = allocId $ registers mem M.! r
 
 free :: Var -> Memory s ()
@@ -141,7 +141,7 @@
 	arr <- A.newArray (0, lastFreshId) 0
 	mapM_ (go arr) $ countLines as
 	return arr
-	where 
+	where
 		go :: Traversable f => StArr s -> (LineNumber, Exp f) -> ST s ()
 		go arr (lineNum, (_, rhs)) =  mapM (countVar arr lineNum) rhs >> return ()
 
diff --git a/src/Csound/Dynamic/Types/Dep.hs b/src/Csound/Dynamic/Types/Dep.hs
--- a/src/Csound/Dynamic/Types/Dep.hs
+++ b/src/Csound/Dynamic/Types/Dep.hs
@@ -77,9 +77,6 @@
 depends :: E -> E -> E
 depends a1 a2 = noRate $ Seq (toPrimOr a1) (toPrimOr a2)
 
-end :: Monad m => E -> DepT m ()
-end a = depT_ $ noRate $ Ends (toPrimOr a)
-
 depT :: Monad m => E -> DepT m E
 depT a = DepT $ do
     s <- get
@@ -100,9 +97,6 @@
 
 stmtOnlyT :: Monad m => Exp E -> DepT m ()
 stmtOnlyT stmt = depT_ $ noRate stmt
-
-emptyE :: E
-emptyE = noRate $ EmptyExp
 
 -- local variables
 
diff --git a/src/Csound/Dynamic/Types/Exp.hs b/src/Csound/Dynamic/Types/Exp.hs
--- a/src/Csound/Dynamic/Types/Exp.hs
+++ b/src/Csound/Dynamic/Types/Exp.hs
@@ -34,6 +34,8 @@
 import Data.Maybe(isNothing)
 import qualified Data.IntMap as IM
 import Data.Fix
+import Data.Eq.Deriving
+import Data.Ord.Deriving
 
 import qualified Csound.Dynamic.Tfm.DeduceTypes as R(Var(..))
 
@@ -63,9 +65,6 @@
 -- | The inner representation of csound expressions.
 type E = Fix RatedExp
 
-instance Hashable E where
-    hashWithSalt s x = s `hashWithSalt` cata hash x
-
 data RatedExp a = RatedExp
     { ratedExpRate      :: Maybe Rate
         -- ^ Rate (can be undefined or Nothing,
@@ -387,6 +386,18 @@
 instance Hashable a => Hashable (PrimOr a)
 instance Hashable a => Hashable (RatedExp a)
 instance Hashable InstrId
+
+$(deriveEq1 ''PrimOr)
+$(deriveEq1 ''PreInline)
+$(deriveEq1 ''Inline)
+$(deriveEq1 ''MainExp)
+$(deriveEq1 ''RatedExp)
+
+$(deriveOrd1 ''PrimOr)
+$(deriveOrd1 ''PreInline)
+$(deriveOrd1 ''Inline)
+$(deriveOrd1 ''MainExp)
+$(deriveOrd1 ''RatedExp)
 
 --------------------------------------------------------------
 -- comments
