diff --git a/library/PostgreSQL/Binary/Decoder.hs b/library/PostgreSQL/Binary/Decoder.hs
--- a/library/PostgreSQL/Binary/Decoder.hs
+++ b/library/PostgreSQL/Binary/Decoder.hs
@@ -3,6 +3,7 @@
   Decoder,
   run,
   -- * Primitive
+  fn,
   int,
   float4,
   float8,
@@ -102,6 +103,13 @@
 
 -- * Primitive
 -------------------------
+
+-- |
+-- Lifts a custom decoder implementation.
+{-# INLINE fn #-}
+fn :: (ByteString -> Either Text a) -> Decoder a
+fn fn =
+  BinaryParser.remainders >>= either BinaryParser.failure return . fn
 
 {-# INLINE int #-}
 int :: (Integral a, Bits a) => Decoder a
diff --git a/postgresql-binary.cabal b/postgresql-binary.cabal
--- a/postgresql-binary.cabal
+++ b/postgresql-binary.cabal
@@ -1,7 +1,7 @@
 name:
   postgresql-binary
 version:
-  0.7.5.1
+  0.7.6
 synopsis:
   Encoders and decoders for the PostgreSQL's binary format
 description:
