module Graphics.Gnuplot.Private.Terminal where

data T =
   Cons {
      T -> [String]
precommands :: [String],
      T -> [String]
options :: [String],
      T -> [String]
commands :: [String],
      T -> Bool
interactive :: Bool
   }

class C terminal where
   canonical :: terminal -> T

format :: T -> [String]
format :: T -> [String]
format (Cons [String]
pre [String]
opts [String]
cmds Bool
_ia) =
   [String]
pre [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++
   if [String] -> Bool
forall (t :: * -> *) a. Foldable t => t a -> Bool
null [String]
opts
     then [String]
cmds
     else ([String] -> String
unwords ([String] -> String) -> [String] -> String
forall a b. (a -> b) -> a -> b
$ String
"set" String -> [String] -> [String]
forall a. a -> [a] -> [a]
: String
"terminal" String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [String]
opts) String -> [String] -> [String]
forall a. a -> [a] -> [a]
: [String]
cmds