@@ -1,10 +1,16 @@
11-- Copyright Corey O'Connor
22-- General philosophy is: MonadIO is for equations exposed to clients.
3+{-# LANGUAGE CPP #-}
34{-# LANGUAGE BangPatterns #-}
45{-# LANGUAGE RankNTypes #-}
56{-# LANGUAGE ExistentialQuantification #-}
67{-# LANGUAGE GADTs #-}
78{-# LANGUAGE FlexibleContexts #-}
9+
10+#ifndef MIN_VERSION_base
11+#defined MIN_VERSION_base(x,y,z) 1
12+#endif
13+
814module Graphics.Vty.Output.Interface
915where
1016
@@ -23,15 +29,18 @@ import Control.Monad.Trans
2329
2430import qualified Data.ByteString as BS
2531import Data.IORef
26−import Data.Monoid (mempty, mappend)
2732import qualified Data.Text.Encoding as T
2833import qualified Data.Text.Lazy as TL
2934import qualified Data.Vector as Vector
3035
36+#if !(MIN_VERSION_base(4,8,0))
37+import Data.Monoid (mempty, mappend)
38+#endif
39+
3140data Output = Output
3241 { -- | Text identifier for the output device. Used for debugging.
3342 terminalID :: String
34− , releaseTerminal :: MonadIO m => m ()
43+ , releaseTerminal :: forall m. MonadIO m => m ()
3544 -- | Clear the display and initialize the terminal to some initial display state.
3645 --
3746 -- The expectation of a program is that the display starts in some initial state.
@@ -46,12 +55,12 @@ data Output = Output
4655 --
4756 -- - The previous state cannot be determined
4857 -- - When exclusive access to a display is released the display returns to the previous state.
49− , reserveDisplay :: MonadIO m => m ()
58+ , reserveDisplay :: forall m. MonadIO m => m ()
5059 -- | Return the display to the state before `reserveDisplay`
5160 -- If no previous state then set the display state to the initial state.
52− , releaseDisplay :: MonadIO m => m ()
61+ , releaseDisplay :: forall m. MonadIO m => m ()
5362 -- | Returns the current display bounds.
54− , displayBounds :: MonadIO m => m DisplayRegion
63+ , displayBounds :: forall m. MonadIO m => m DisplayRegion
5564 -- | Output the byte string to the terminal device.
5665 , outputByteBuffer :: BS.ByteString -> IO ()
5766 -- | Maximum number of colors supported by the context.
@@ -62,7 +71,7 @@ data Output = Output
6271 -- | Acquire display access to the given region of the display.
6372 -- Currently all regions have the upper left corner of (0,0) and the lower right corner at
6473 -- (max displayWidth providedWidth, max displayHeight providedHeight)
65− , mkDisplayContext :: MonadIO m => Output -> DisplayRegion -> m DisplayContext
74+ , mkDisplayContext :: forall m. MonadIO m => Output -> DisplayRegion -> m DisplayContext
6675 }
6776
6877displayContext :: MonadIO m => Output -> DisplayRegion -> m DisplayContext