diff --git a/HCodecs.cabal b/HCodecs.cabal
--- a/HCodecs.cabal
+++ b/HCodecs.cabal
@@ -1,30 +1,42 @@
 name: HCodecs
-version: 0.5
+version: 0.5.1
 cabal-Version: >= 1.8
 license: BSD3
 license-file: LICENSE
 copyright: (c) 2007-2014 George Giorgidze
 author: George Giorgidze
 maintainer: George Giorgidze (giorgidze@gmail.com)
+          , Pavel Krajcevski (krajcevski@gmail.com)
 homepage: http://www-db.informatik.uni-tuebingen.de/team/giorgidze
 category: Codec
 stability: experimental
 synopsis: A library to read, write and manipulate MIDI, WAVE, and SoundFont2 files.
 description:
-  The library provides functions to read, write and manipulate MIDI, WAVE and SoundFont2 multimedia files. It is written entirely in Haskell (without any FFI). It uses efficient  parsing and building combinators for binary data stored in ByteStrings (based on the one in 'binary' package).
+  The library provides functions to read, write and manipulate MIDI, WAVE and
+  SoundFont2 multimedia files. It is written entirely in Haskell (without any
+  FFI). It uses efficient  parsing and building combinators for binary data
+  stored in ByteStrings (based on the one in 'binary' package).
   .
-  Correctness of significant parts of the library has been validated with QuickCheck and Haskell Program Coverage (HPC) tool-kits.
+  Correctness of significant parts of the library has been validated with
+  QuickCheck and Haskell Program Coverage (HPC) tool-kits.
 
 build-type: Simple
 
 source-repository head
   type:     git
-  location: https://github.com/giorgidze/HCodecs.git
+  location: https://github.com/Mokosha/HCodecs.git
 
 library
   hs-source-dirs: src
   ghc-options: -O3 -Wall
-  build-depends: base < 5, bytestring, random, array >= 0.4, QuickCheck >= 2.0
+  build-depends:
+      base             <  5
+    , bytestring
+    , random
+    , semigroups
+    , array            >= 0.4
+    , QuickCheck       >= 2.0
+
   exposed-modules:
     Codec.Midi
     Codec.Wav
@@ -39,5 +51,12 @@
   type: exitcode-stdio-1.0
   hs-source-dirs: src
   ghc-options: -O3 -Wall
-  build-depends: base < 5, bytestring, random, array >= 0.4, QuickCheck >= 2.0
+  build-depends:
+      base < 5
+    , bytestring
+    , random
+    , semigroups
+    , array >= 0.4
+    , QuickCheck >= 2.0
+
   main-is: Codec/Internal/TestSuite.hs
diff --git a/src/Codec/ByteString/Builder.hs b/src/Codec/ByteString/Builder.hs
--- a/src/Codec/ByteString/Builder.hs
+++ b/src/Codec/ByteString/Builder.hs
@@ -71,12 +71,12 @@
 import Foreign.Ptr              (Ptr, plusPtr)
 import Foreign.ForeignPtr       (ForeignPtr, withForeignPtr)
 import System.IO.Unsafe         (unsafePerformIO)
-import Data.ByteString.Internal (inlinePerformIO,c2w)
+import Data.ByteString.Internal (c2w)
 
 import Data.Bits
 import Data.Word
 import Data.Int
-import Data.Monoid
+import Data.Semigroup
 
 ------------------------------------------------------------------------
 
@@ -96,9 +96,12 @@
         runBuilder :: (Buffer -> [S.ByteString]) -> Buffer -> [S.ByteString]
     }
 
+instance Semigroup Builder where
+    (<>) = append
+
 instance Monoid Builder where
     mempty  = empty
-    mappend = append
+    mappend = (<>)
 
 ------------------------------------------------------------------------
 
@@ -188,7 +191,7 @@
 
 -- | Sequence an IO operation on the buffer
 unsafeLiftIO :: (Buffer -> IO Buffer) -> Builder
-unsafeLiftIO f =  Builder $ \ k buf -> inlinePerformIO $ do
+unsafeLiftIO f =  Builder $ \ k buf -> unsafePerformIO $ do
     buf' <- f buf
     return (k buf')
 
diff --git a/src/Codec/ByteString/Parser.hs b/src/Codec/ByteString/Parser.hs
--- a/src/Codec/ByteString/Parser.hs
+++ b/src/Codec/ByteString/Parser.hs
@@ -120,6 +120,8 @@
 import Data.Bits
 import Data.Maybe
 
+import System.IO.Unsafe        (unsafePerformIO)
+
 -- | The parse state
 data S = S {-# UNPACK #-} !B.ByteString  -- current chunk
            L.ByteString                  -- the rest of the input
@@ -375,7 +377,7 @@
 getPtr :: Storable a => Int -> Parser a
 getPtr n = do
     (fp,o,_) <- readN n B.toForeignPtr
-    return . B.inlinePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
+    return . unsafePerformIO $ withForeignPtr fp $ \p -> peek (castPtr $ p `plusPtr` o)
 
 ------------------------------------------------------------------------
 
diff --git a/src/Codec/Midi.hs b/src/Codec/Midi.hs
--- a/src/Codec/Midi.hs
+++ b/src/Codec/Midi.hs
@@ -74,7 +74,7 @@
 import Data.Bits
 import Data.Maybe
 import Data.List
-import Data.Monoid
+import Data.Monoid (mempty, mconcat, mappend)
 import Control.Applicative
 import Control.Monad
 
@@ -120,13 +120,13 @@
 type Ticks = Int -- 0 - (2^28 - 1)
 type Time = Double
 
-type Channel = Int -- 0 - 15
-type Key = Int -- 0 - 127
-type Velocity = Int	-- 0 - 127
+type Channel = Int  -- 0 - 15
+type Key = Int      -- 0 - 127
+type Velocity = Int -- 0 - 127
 type Pressure = Int -- 0 - 127
-type Preset = Int	-- 0 - 127
+type Preset = Int   -- 0 - 127
 type Bank = Int
-type PitchWheel = Int	-- 0 - (2^14 - 1)
+type PitchWheel = Int -- 0 - (2^14 - 1)
 type Tempo = Int -- microseconds per beat  1 - (2^24 - 1)
 
 data Message =
diff --git a/src/Codec/SoundFont.hs b/src/Codec/SoundFont.hs
--- a/src/Codec/SoundFont.hs
+++ b/src/Codec/SoundFont.hs
@@ -50,7 +50,7 @@
 import Data.List
 
 import Test.QuickCheck
-import Data.Monoid
+import Data.Monoid (mconcat)
 import Control.Applicative
 import Control.Monad
 
diff --git a/src/Codec/Wav.hs b/src/Codec/Wav.hs
--- a/src/Codec/Wav.hs
+++ b/src/Codec/Wav.hs
@@ -29,11 +29,10 @@
 import Data.Word
 import Data.Int
 import qualified Data.ByteString.Lazy as L
-import Data.Monoid
+import Data.Monoid (mconcat)
 import Data.Array.Unboxed
 import Data.Array.IO
 import Data.Bits
-
 
 import Control.Monad
 import Control.Applicative
diff --git a/src/Data/Audio.hs b/src/Data/Audio.hs
--- a/src/Data/Audio.hs
+++ b/src/Data/Audio.hs
@@ -42,7 +42,7 @@
 import Data.Array.Unboxed
 import Data.Word
 import Data.Int
-import Data.Monoid
+import Data.Monoid (mconcat)
 
 type Sample = Double
 type SampleData a = UArray Int a
