module TextShow.System.Console.Haskeline (
showbInterrupt
, showbPrefsPrec
, showbCompletionPrec
, showbHistory
) where
import System.Console.Haskeline (Interrupt, Prefs)
import System.Console.Haskeline.Completion (Completion)
import System.Console.Haskeline.History (History, historyLines)
import TextShow (TextShow(showb, showbPrec), Builder, FromStringShow(..))
import TextShow.TH (deriveTextShow)
import TextShow.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
$(deriveTextShow ''Interrupt)
instance TextShow Prefs where
showbPrec = showbPrefsPrec
INLINE_INST_FUN(showbPrec)
$(deriveTextShow ''Completion)
instance TextShow History where
showb = showbHistory
INLINE_INST_FUN(showb)