@@ -117,17 +117,25 @@ instance Functor Result where
117117instance Monad IResult where
118118 return = ISuccess
119119 {-# INLINE return #-}
120+
120121 ISuccess a >>= k = k a
121122 IError path err >>= _ = IError path err
122123 {-# INLINE (>>=) #-}
123124
125+ fail err = IError [] err
126+ {-# INLINE fail #-}
127+
124128instance Monad Result where
125129 return = Success
126130 {-# INLINE return #-}
131+
127132 Success a >>= k = k a
128133 Error err >>= _ = Error err
129134 {-# INLINE (>>=) #-}
130135
136+ fail err = Error err
137+ {-# INLINE fail #-}
138+
131139instance Applicative IResult where
132140 pure = return
133141 {-# INLINE pure #-}