We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2cd298f + 1dba941 commit f2c343bCopy full SHA for f2c343b
templates/wrappers.hs
@@ -6,6 +6,9 @@
6
7
#if defined(ALEX_MONAD) || defined(ALEX_MONAD_BYTESTRING)
8
import Control.Applicative as App (Applicative (..))
9
+#if __GLASGOW_HASKELL__ >= 800
10
+import qualified Control.Monad.Fail as Fail
11
+#endif
12
#endif
13
14
import Data.Word (Word8)
@@ -225,6 +228,14 @@ instance Monad Alex where
225
228
Left msg -> Left msg
226
229
Right (s',a) -> unAlex (k a) s'
227
230
return = App.pure
231
+#if __GLASGOW_HASKELL__ < 800
232
+ fail = alexError
233
+#else
234
+ fail = Fail.fail
235
+
236
+instance Fail.MonadFail Alex where
237
238
239
240
alexGetInput :: Alex AlexInput
241
alexGetInput
0 commit comments