diff --git a/Data/ASN1/Parse.hs b/Data/ASN1/Parse.hs
--- a/Data/ASN1/Parse.hs
+++ b/Data/ASN1/Parse.hs
@@ -7,6 +7,7 @@
 --
 -- A parser combinator for ASN1 Stream.
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
+{-# LANGUAGE CPP #-}
 module Data.ASN1.Parse
     ( ParseASN1
     -- * run
@@ -30,6 +31,9 @@
 import Control.Applicative
 import Control.Arrow (first)
 import Control.Monad (liftM2)
+#if MIN_VERSION_base(4,9,0)
+import Control.Monad.Fail
+#endif
 
 newtype ParseASN1 a = P { runP :: [ASN1] -> Either String (a, [ASN1]) }
 
@@ -50,6 +54,16 @@
         case runP m1 s of
             Left err      -> Left err
             Right (a, s2) -> runP (m2 a) s2
+instance Alternative ParseASN1 where
+    empty = P $ \_ -> Left "empty Alternative"
+    (<|>) m1 m2 = P $ \s ->
+        case runP m1 s of
+            Left _        -> runP m2 s
+            Right (a, s2) -> Right (a, s2)
+#if MIN_VERSION_base(4,9,0)
+instance MonadFail ParseASN1 where
+    fail = throwParseError
+#endif
 
 get :: ParseASN1 [ASN1]
 get = P $ \stream -> Right (stream, stream)
diff --git a/asn1-parse.cabal b/asn1-parse.cabal
--- a/asn1-parse.cabal
+++ b/asn1-parse.cabal
@@ -1,5 +1,5 @@
 Name:                asn1-parse
-Version:             0.9.4
+Version:             0.9.5
 Description:         Simple monadic parser for ASN1 stream types, when ASN1 pattern matching is not convenient.
 License:             BSD3
 License-file:        LICENSE
@@ -24,3 +24,4 @@
 source-repository head
   type:     git
   location: https://github.com/vincenthz/hs-asn1
+  subdir:   parse
