module Text.Layout.Table.Primitives.AlignSpec.Internal
( AlignSpec(..)
, noAlign
, occSpecAlign
, predAlign
, charAlign
) where
import Data.Default.Class
import Text.Layout.Table.Primitives.Occurence
data AlignSpec
= AlignOcc OccSpec
| NoAlign
instance Default AlignSpec where
def = noAlign
noAlign :: AlignSpec
noAlign = NoAlign
occSpecAlign :: OccSpec -> AlignSpec
occSpecAlign = AlignOcc
predAlign :: (Char -> Bool) -> AlignSpec
predAlign = occSpecAlign . predOccSpec
charAlign :: Char -> AlignSpec
charAlign = predAlign . (==)