@@ -1,6 +1,6 @@
1-- Copyright 2009-2010 Corey O'Connor
1-- Copyright 2009-2010 Corey O'Connor
2+{-# LANGUAGE RankNTypes #-}
2{-# LANGUAGE ScopedTypeVariables #-}
3{-# LANGUAGE ScopedTypeVariables #-}
3−{-# LANGUAGE Rank2Types #-}
4{-# LANGUAGE ExistentialQuantification #-}
4{-# LANGUAGE ExistentialQuantification #-}
5{-# LANGUAGE GADTs #-}
5{-# LANGUAGE GADTs #-}
6{-# LANGUAGE FlexibleContexts #-}
6{-# LANGUAGE FlexibleContexts #-}
@@ -98,7 +98,7 @@ instance Terminal TerminalHandle where
98 output_handle (TerminalHandle t _) = output_handle t
98 output_handle (TerminalHandle t _) = output_handle t
100data DisplayHandle where
100data DisplayHandle where
101− DisplayHandle :: DisplayTerminal d => d -> TerminalHandle -> DisplayState -> DisplayHandle
101+ DisplayHandle :: forall d . DisplayTerminal d => d -> TerminalHandle -> DisplayState -> DisplayHandle
103-- | Acquire display access to the given region of the display.
103-- | Acquire display access to the given region of the display.
104-- Currently all regions have the upper left corner of (0,0) and the lower right corner at
104-- Currently all regions have the upper left corner of (0,0) and the lower right corner at
@@ -106,8 +106,7 @@ data DisplayHandle where
106display_context :: MonadIO m => TerminalHandle -> DisplayRegion -> m DisplayHandle
106display_context :: MonadIO m => TerminalHandle -> DisplayRegion -> m DisplayHandle
107display_context t b = do
107display_context t b = do
108 s <- initial_display_state
108 s <- initial_display_state
109− let c d = DisplayHandle d t s
109+ display_terminal_instance t b (\ d -> DisplayHandle d t s)
110− display_terminal_instance t b c
112data DisplayState = DisplayState
111data DisplayState = DisplayState
113 { previous_output_ref :: IORef (Maybe SpanOpSequence)
112 { previous_output_ref :: IORef (Maybe SpanOpSequence)