{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_GHC -Wno-orphans #-}
module TextShow.System.Console.Haskeline () where
import System.Console.Haskeline (Interrupt, Prefs)
import System.Console.Haskeline.Completion (Completion)
import System.Console.Haskeline.History (History, historyLines)
import TextShow (TextShow(..), FromStringShow(..))
import TextShow.TH (deriveTextShow)
import TextShow.Utils (showbUnaryListWith)
$(deriveTextShow ''Interrupt)
instance TextShow Prefs where
showbPrec :: Int -> Prefs -> Builder
showbPrec Int
p = Int -> FromStringShow Prefs -> Builder
forall a. TextShow a => Int -> a -> Builder
showbPrec Int
p (FromStringShow Prefs -> Builder)
-> (Prefs -> FromStringShow Prefs) -> Prefs -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Prefs -> FromStringShow Prefs
forall a. a -> FromStringShow a
FromStringShow
{-# INLINE showbPrec #-}
$(deriveTextShow ''Completion)
instance TextShow History where
showb :: History -> Builder
showb = ([String] -> Builder) -> Int -> [String] -> Builder
forall a. ([a] -> Builder) -> Int -> [a] -> Builder
showbUnaryListWith [String] -> Builder
forall a. TextShow a => a -> Builder
showb Int
0 ([String] -> Builder)
-> (History -> [String]) -> History -> Builder
forall b c a. (b -> c) -> (a -> b) -> a -> c
. History -> [String]
historyLines
{-# INLINE showb #-}