{-# LANGUAGE DeriveFunctor #-}

module Language.Haskell.PrintfArg (
  PrintfArg (..),
  adjustment,
  signed,
  spaced,
  prefixed,
) where

import qualified Parser.Types as P

data PrintfArg v = PrintfArg
  { forall v. PrintfArg v -> FlagSet
flagSet :: P.FlagSet
  , forall v. PrintfArg v -> Maybe Int
width :: Maybe Int
  , forall v. PrintfArg v -> Maybe Int
prec :: Maybe Int
  , forall v. PrintfArg v -> Maybe LengthSpecifier
lengthSpec :: Maybe P.LengthSpecifier
  , forall v. PrintfArg v -> Char
fieldSpec :: Char
  , forall v. PrintfArg v -> v
value :: v
  }
  deriving (Int -> PrintfArg v -> ShowS
forall v. Show v => Int -> PrintfArg v -> ShowS
forall v. Show v => [PrintfArg v] -> ShowS
forall v. Show v => PrintfArg v -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrintfArg v] -> ShowS
$cshowList :: forall v. Show v => [PrintfArg v] -> ShowS
show :: PrintfArg v -> String
$cshow :: forall v. Show v => PrintfArg v -> String
showsPrec :: Int -> PrintfArg v -> ShowS
$cshowsPrec :: forall v. Show v => Int -> PrintfArg v -> ShowS
Show, forall a b. a -> PrintfArg b -> PrintfArg a
forall a b. (a -> b) -> PrintfArg a -> PrintfArg b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: forall a b. a -> PrintfArg b -> PrintfArg a
$c<$ :: forall a b. a -> PrintfArg b -> PrintfArg a
fmap :: forall a b. (a -> b) -> PrintfArg a -> PrintfArg b
$cfmap :: forall a b. (a -> b) -> PrintfArg a -> PrintfArg b
Functor)

adjustment :: PrintfArg v -> Maybe P.Adjustment
adjustment :: forall v. PrintfArg v -> Maybe Adjustment
adjustment = FlagSet -> Maybe Adjustment
P.adjustment forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall v. PrintfArg v -> FlagSet
flagSet

signed, spaced, prefixed :: PrintfArg v -> Bool
signed :: forall v. PrintfArg v -> Bool
signed = FlagSet -> Bool
P.signed forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall v. PrintfArg v -> FlagSet
flagSet
spaced :: forall v. PrintfArg v -> Bool
spaced = FlagSet -> Bool
P.spaced forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall v. PrintfArg v -> FlagSet
flagSet
prefixed :: forall v. PrintfArg v -> Bool
prefixed = FlagSet -> Bool
P.prefixed forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall v. PrintfArg v -> FlagSet
flagSet