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 Feb 28, 2019
1 parent 5a90137 commit e78d955
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,11,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,11,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 e78d955

Please sign in to comment.