Skip to content

Commit

Permalink
MonadFail instance for GHC 8.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mtolly committed Nov 30, 2018
1 parent 5a90137 commit d0a0ba2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Graphics/PDF/Draw.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ import Data.Maybe
#if !MIN_VERSION_base(4,8,0)
import Data.Monoid
#endif
#if MIN_VERSION_base(4,9,0)
import qualified Control.Monad.Fail as Fail
#endif

import qualified Data.Map.Strict as M
import qualified Data.IntMap as IM
Expand Down Expand Up @@ -186,6 +189,11 @@ instance Monad Draw where
unDraw (f a) env
return x = Draw $ \_env -> return x

#if MIN_VERSION_base(4,9,0)
instance Fail.MonadFail Draw where
fail s = Draw $ \_ -> Fail.fail s
#endif

instance MonadReader DrawEnvironment Draw where
ask = Draw $ \env -> return (drawEnvironment env)
local f m = Draw $ \env -> let drawenv' = f (drawEnvironment env)
Expand Down

0 comments on commit d0a0ba2

Please sign in to comment.