module Text.Show.Text.System.Console.Haskeline (
showbInterrupt
, showbPrefsPrec
, showbCompletionPrec
, showbHistory
) where
import Prelude hiding (Show)
import System.Console.Haskeline (Interrupt, Prefs)
import System.Console.Haskeline.Completion (Completion)
import System.Console.Haskeline.History (History, historyLines)
import Text.Show.Text (Show(showb, showbPrec), Builder, FromStringShow(..))
import Text.Show.Text.TH (deriveShow)
import Text.Show.Text.Utils (showbUnaryListWith)
#include "inline.h"
showbInterrupt :: Interrupt -> Builder
showbInterrupt = showb
showbPrefsPrec :: Int -> Prefs -> Builder
showbPrefsPrec p = showbPrec p . FromStringShow
showbCompletionPrec :: Int -> Completion -> Builder
showbCompletionPrec = showbPrec
showbHistory :: History -> Builder
showbHistory = showbUnaryListWith showb 0 . historyLines
$(deriveShow ''Interrupt)
instance Show Prefs where
showbPrec = showbPrefsPrec
INLINE_INST_FUN(showbPrec)
$(deriveShow ''Completion)
instance Show History where
showb = showbHistory
INLINE_INST_FUN(showb)