{-# LANGUAGE DeriveGeneric      #-}
{-# LANGUAGE DeriveTraversable  #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE FlexibleInstances #-}
module Text.DocLayout.Attributed (Attributed(..), Attr(..), Link, fromList, singleton)
  where

import Data.String
import Text.DocLayout.ANSIFont (Font, baseFont)
import Data.Data (Data, Typeable)
import GHC.Generics
import Data.Sequence ((><))
import qualified Data.Sequence as S
import Data.Text (Text)

type Link = Maybe Text

-- | Font attributes.
data Attr a = Attr Link Font a
  deriving (Int -> Attr a -> ShowS
[Attr a] -> ShowS
Attr a -> String
(Int -> Attr a -> ShowS)
-> (Attr a -> String) -> ([Attr a] -> ShowS) -> Show (Attr a)
forall a. Show a => Int -> Attr a -> ShowS
forall a. Show a => [Attr a] -> ShowS
forall a. Show a => Attr a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Attr a -> ShowS
showsPrec :: Int -> Attr a -> ShowS
$cshow :: forall a. Show a => Attr a -> String
show :: Attr a -> String
$cshowList :: forall a. Show a => [Attr a] -> ShowS
showList :: [Attr a] -> ShowS
Show, ReadPrec [Attr a]
ReadPrec (Attr a)
Int -> ReadS (Attr a)
ReadS [Attr a]
(Int -> ReadS (Attr a))
-> ReadS [Attr a]
-> ReadPrec (Attr a)
-> ReadPrec [Attr a]
-> Read (Attr a)
forall a. Read a => ReadPrec [Attr a]
forall a. Read a => ReadPrec (Attr a)
forall a. Read a => Int -> ReadS (Attr a)
forall a. Read a => ReadS [Attr a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Attr a)
readsPrec :: Int -> ReadS (Attr a)
$creadList :: forall a. Read a => ReadS [Attr a]
readList :: ReadS [Attr a]
$creadPrec :: forall a. Read a => ReadPrec (Attr a)
readPrec :: ReadPrec (Attr a)
$creadListPrec :: forall a. Read a => ReadPrec [Attr a]
readListPrec :: ReadPrec [Attr a]
Read, Attr a -> Attr a -> Bool
(Attr a -> Attr a -> Bool)
-> (Attr a -> Attr a -> Bool) -> Eq (Attr a)
forall a. Eq a => Attr a -> Attr a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Attr a -> Attr a -> Bool
== :: Attr a -> Attr a -> Bool
$c/= :: forall a. Eq a => Attr a -> Attr a -> Bool
/= :: Attr a -> Attr a -> Bool
Eq, Eq (Attr a)
Eq (Attr a) =>
(Attr a -> Attr a -> Ordering)
-> (Attr a -> Attr a -> Bool)
-> (Attr a -> Attr a -> Bool)
-> (Attr a -> Attr a -> Bool)
-> (Attr a -> Attr a -> Bool)
-> (Attr a -> Attr a -> Attr a)
-> (Attr a -> Attr a -> Attr a)
-> Ord (Attr a)
Attr a -> Attr a -> Bool
Attr a -> Attr a -> Ordering
Attr a -> Attr a -> Attr a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Attr a)
forall a. Ord a => Attr a -> Attr a -> Bool
forall a. Ord a => Attr a -> Attr a -> Ordering
forall a. Ord a => Attr a -> Attr a -> Attr a
$ccompare :: forall a. Ord a => Attr a -> Attr a -> Ordering
compare :: Attr a -> Attr a -> Ordering
$c< :: forall a. Ord a => Attr a -> Attr a -> Bool
< :: Attr a -> Attr a -> Bool
$c<= :: forall a. Ord a => Attr a -> Attr a -> Bool
<= :: Attr a -> Attr a -> Bool
$c> :: forall a. Ord a => Attr a -> Attr a -> Bool
> :: Attr a -> Attr a -> Bool
$c>= :: forall a. Ord a => Attr a -> Attr a -> Bool
>= :: Attr a -> Attr a -> Bool
$cmax :: forall a. Ord a => Attr a -> Attr a -> Attr a
max :: Attr a -> Attr a -> Attr a
$cmin :: forall a. Ord a => Attr a -> Attr a -> Attr a
min :: Attr a -> Attr a -> Attr a
Ord, (forall a b. (a -> b) -> Attr a -> Attr b)
-> (forall a b. a -> Attr b -> Attr a) -> Functor Attr
forall a b. a -> Attr b -> Attr a
forall a b. (a -> b) -> Attr a -> Attr b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Attr a -> Attr b
fmap :: forall a b. (a -> b) -> Attr a -> Attr b
$c<$ :: forall a b. a -> Attr b -> Attr a
<$ :: forall a b. a -> Attr b -> Attr a
Functor, (forall m. Monoid m => Attr m -> m)
-> (forall m a. Monoid m => (a -> m) -> Attr a -> m)
-> (forall m a. Monoid m => (a -> m) -> Attr a -> m)
-> (forall a b. (a -> b -> b) -> b -> Attr a -> b)
-> (forall a b. (a -> b -> b) -> b -> Attr a -> b)
-> (forall b a. (b -> a -> b) -> b -> Attr a -> b)
-> (forall b a. (b -> a -> b) -> b -> Attr a -> b)
-> (forall a. (a -> a -> a) -> Attr a -> a)
-> (forall a. (a -> a -> a) -> Attr a -> a)
-> (forall a. Attr a -> [a])
-> (forall a. Attr a -> Bool)
-> (forall a. Attr a -> Int)
-> (forall a. Eq a => a -> Attr a -> Bool)
-> (forall a. Ord a => Attr a -> a)
-> (forall a. Ord a => Attr a -> a)
-> (forall a. Num a => Attr a -> a)
-> (forall a. Num a => Attr a -> a)
-> Foldable Attr
forall a. Eq a => a -> Attr a -> Bool
forall a. Num a => Attr a -> a
forall a. Ord a => Attr a -> a
forall m. Monoid m => Attr m -> m
forall a. Attr a -> Bool
forall a. Attr a -> Int
forall a. Attr a -> [a]
forall a. (a -> a -> a) -> Attr a -> a
forall m a. Monoid m => (a -> m) -> Attr a -> m
forall b a. (b -> a -> b) -> b -> Attr a -> b
forall a b. (a -> b -> b) -> b -> Attr a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => Attr m -> m
fold :: forall m. Monoid m => Attr m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Attr a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Attr a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Attr a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Attr a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> Attr a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Attr a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Attr a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Attr a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Attr a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Attr a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Attr a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Attr a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> Attr a -> a
foldr1 :: forall a. (a -> a -> a) -> Attr a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Attr a -> a
foldl1 :: forall a. (a -> a -> a) -> Attr a -> a
$ctoList :: forall a. Attr a -> [a]
toList :: forall a. Attr a -> [a]
$cnull :: forall a. Attr a -> Bool
null :: forall a. Attr a -> Bool
$clength :: forall a. Attr a -> Int
length :: forall a. Attr a -> Int
$celem :: forall a. Eq a => a -> Attr a -> Bool
elem :: forall a. Eq a => a -> Attr a -> Bool
$cmaximum :: forall a. Ord a => Attr a -> a
maximum :: forall a. Ord a => Attr a -> a
$cminimum :: forall a. Ord a => Attr a -> a
minimum :: forall a. Ord a => Attr a -> a
$csum :: forall a. Num a => Attr a -> a
sum :: forall a. Num a => Attr a -> a
$cproduct :: forall a. Num a => Attr a -> a
product :: forall a. Num a => Attr a -> a
Foldable, Functor Attr
Foldable Attr
(Functor Attr, Foldable Attr) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> Attr a -> f (Attr b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Attr (f a) -> f (Attr a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Attr a -> m (Attr b))
-> (forall (m :: * -> *) a. Monad m => Attr (m a) -> m (Attr a))
-> Traversable Attr
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a. Monad m => Attr (m a) -> m (Attr a)
forall (f :: * -> *) a. Applicative f => Attr (f a) -> f (Attr a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Attr a -> m (Attr b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Attr a -> f (Attr b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Attr a -> f (Attr b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Attr a -> f (Attr b)
$csequenceA :: forall (f :: * -> *) a. Applicative f => Attr (f a) -> f (Attr a)
sequenceA :: forall (f :: * -> *) a. Applicative f => Attr (f a) -> f (Attr a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Attr a -> m (Attr b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Attr a -> m (Attr b)
$csequence :: forall (m :: * -> *) a. Monad m => Attr (m a) -> m (Attr a)
sequence :: forall (m :: * -> *) a. Monad m => Attr (m a) -> m (Attr a)
Traversable,
    Typeable (Attr a)
Typeable (Attr a) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Attr a -> c (Attr a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Attr a))
-> (Attr a -> Constr)
-> (Attr a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Attr a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Attr a)))
-> ((forall b. Data b => b -> b) -> Attr a -> Attr a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Attr a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Attr a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Attr a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> Attr a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Attr a -> m (Attr a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Attr a -> m (Attr a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Attr a -> m (Attr a))
-> Data (Attr a)
Attr a -> Constr
Attr a -> DataType
(forall b. Data b => b -> b) -> Attr a -> Attr a
forall a. Data a => Typeable (Attr a)
forall a. Data a => Attr a -> Constr
forall a. Data a => Attr a -> DataType
forall a.
Data a =>
(forall b. Data b => b -> b) -> Attr a -> Attr a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Attr a -> u
forall a u. Data a => (forall d. Data d => d -> u) -> Attr a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attr a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attr a -> c (Attr a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Attr a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Attr a))
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Attr a -> u
forall u. (forall d. Data d => d -> u) -> Attr a -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attr a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attr a -> c (Attr a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Attr a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Attr a))
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attr a -> c (Attr a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attr a -> c (Attr a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attr a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attr a)
$ctoConstr :: forall a. Data a => Attr a -> Constr
toConstr :: Attr a -> Constr
$cdataTypeOf :: forall a. Data a => Attr a -> DataType
dataTypeOf :: Attr a -> DataType
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Attr a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Attr a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Attr a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Attr a))
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Attr a -> Attr a
gmapT :: (forall b. Data b => b -> b) -> Attr a -> Attr a
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Attr a -> r
$cgmapQ :: forall a u. Data a => (forall d. Data d => d -> u) -> Attr a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Attr a -> [u]
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Attr a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Attr a -> u
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Attr a -> m (Attr a)
Data, Typeable, (forall x. Attr a -> Rep (Attr a) x)
-> (forall x. Rep (Attr a) x -> Attr a) -> Generic (Attr a)
forall x. Rep (Attr a) x -> Attr a
forall x. Attr a -> Rep (Attr a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Attr a) x -> Attr a
forall a x. Attr a -> Rep (Attr a) x
$cfrom :: forall a x. Attr a -> Rep (Attr a) x
from :: forall x. Attr a -> Rep (Attr a) x
$cto :: forall a x. Rep (Attr a) x -> Attr a
to :: forall x. Rep (Attr a) x -> Attr a
Generic)

instance Semigroup a => Semigroup (Attr a) where
  <> :: Attr a -> Attr a -> Attr a
(<>) (Attr Link
l Font
f a
x) (Attr Link
_ Font
_ a
y) = Link -> Font -> a -> Attr a
forall a. Link -> Font -> a -> Attr a
Attr Link
l Font
f (a -> Attr a) -> a -> Attr a
forall a b. (a -> b) -> a -> b
$ a
x a -> a -> a
forall a. Semigroup a => a -> a -> a
<> a
y  -- This is arbitrary

instance (IsString a, Monoid a) => Monoid (Attr a) where
  mempty :: Attr a
mempty = Link -> Font -> a -> Attr a
forall a. Link -> Font -> a -> Attr a
Attr Link
forall a. Maybe a
Nothing Font
baseFont (String -> a
forall a. IsString a => String -> a
fromString String
"")

-- | A sequence of strings with font attributes.
newtype Attributed a = Attributed (S.Seq (Attr a))
  deriving (Int -> Attributed a -> ShowS
[Attributed a] -> ShowS
Attributed a -> String
(Int -> Attributed a -> ShowS)
-> (Attributed a -> String)
-> ([Attributed a] -> ShowS)
-> Show (Attributed a)
forall a. Show a => Int -> Attributed a -> ShowS
forall a. Show a => [Attributed a] -> ShowS
forall a. Show a => Attributed a -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall a. Show a => Int -> Attributed a -> ShowS
showsPrec :: Int -> Attributed a -> ShowS
$cshow :: forall a. Show a => Attributed a -> String
show :: Attributed a -> String
$cshowList :: forall a. Show a => [Attributed a] -> ShowS
showList :: [Attributed a] -> ShowS
Show, ReadPrec [Attributed a]
ReadPrec (Attributed a)
Int -> ReadS (Attributed a)
ReadS [Attributed a]
(Int -> ReadS (Attributed a))
-> ReadS [Attributed a]
-> ReadPrec (Attributed a)
-> ReadPrec [Attributed a]
-> Read (Attributed a)
forall a. Read a => ReadPrec [Attributed a]
forall a. Read a => ReadPrec (Attributed a)
forall a. Read a => Int -> ReadS (Attributed a)
forall a. Read a => ReadS [Attributed a]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: forall a. Read a => Int -> ReadS (Attributed a)
readsPrec :: Int -> ReadS (Attributed a)
$creadList :: forall a. Read a => ReadS [Attributed a]
readList :: ReadS [Attributed a]
$creadPrec :: forall a. Read a => ReadPrec (Attributed a)
readPrec :: ReadPrec (Attributed a)
$creadListPrec :: forall a. Read a => ReadPrec [Attributed a]
readListPrec :: ReadPrec [Attributed a]
Read, Attributed a -> Attributed a -> Bool
(Attributed a -> Attributed a -> Bool)
-> (Attributed a -> Attributed a -> Bool) -> Eq (Attributed a)
forall a. Eq a => Attributed a -> Attributed a -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall a. Eq a => Attributed a -> Attributed a -> Bool
== :: Attributed a -> Attributed a -> Bool
$c/= :: forall a. Eq a => Attributed a -> Attributed a -> Bool
/= :: Attributed a -> Attributed a -> Bool
Eq, Eq (Attributed a)
Eq (Attributed a) =>
(Attributed a -> Attributed a -> Ordering)
-> (Attributed a -> Attributed a -> Bool)
-> (Attributed a -> Attributed a -> Bool)
-> (Attributed a -> Attributed a -> Bool)
-> (Attributed a -> Attributed a -> Bool)
-> (Attributed a -> Attributed a -> Attributed a)
-> (Attributed a -> Attributed a -> Attributed a)
-> Ord (Attributed a)
Attributed a -> Attributed a -> Bool
Attributed a -> Attributed a -> Ordering
Attributed a -> Attributed a -> Attributed a
forall a.
Eq a =>
(a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
forall a. Ord a => Eq (Attributed a)
forall a. Ord a => Attributed a -> Attributed a -> Bool
forall a. Ord a => Attributed a -> Attributed a -> Ordering
forall a. Ord a => Attributed a -> Attributed a -> Attributed a
$ccompare :: forall a. Ord a => Attributed a -> Attributed a -> Ordering
compare :: Attributed a -> Attributed a -> Ordering
$c< :: forall a. Ord a => Attributed a -> Attributed a -> Bool
< :: Attributed a -> Attributed a -> Bool
$c<= :: forall a. Ord a => Attributed a -> Attributed a -> Bool
<= :: Attributed a -> Attributed a -> Bool
$c> :: forall a. Ord a => Attributed a -> Attributed a -> Bool
> :: Attributed a -> Attributed a -> Bool
$c>= :: forall a. Ord a => Attributed a -> Attributed a -> Bool
>= :: Attributed a -> Attributed a -> Bool
$cmax :: forall a. Ord a => Attributed a -> Attributed a -> Attributed a
max :: Attributed a -> Attributed a -> Attributed a
$cmin :: forall a. Ord a => Attributed a -> Attributed a -> Attributed a
min :: Attributed a -> Attributed a -> Attributed a
Ord, (forall a b. (a -> b) -> Attributed a -> Attributed b)
-> (forall a b. a -> Attributed b -> Attributed a)
-> Functor Attributed
forall a b. a -> Attributed b -> Attributed a
forall a b. (a -> b) -> Attributed a -> Attributed b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> Attributed a -> Attributed b
fmap :: forall a b. (a -> b) -> Attributed a -> Attributed b
$c<$ :: forall a b. a -> Attributed b -> Attributed a
<$ :: forall a b. a -> Attributed b -> Attributed a
Functor, (forall m. Monoid m => Attributed m -> m)
-> (forall m a. Monoid m => (a -> m) -> Attributed a -> m)
-> (forall m a. Monoid m => (a -> m) -> Attributed a -> m)
-> (forall a b. (a -> b -> b) -> b -> Attributed a -> b)
-> (forall a b. (a -> b -> b) -> b -> Attributed a -> b)
-> (forall b a. (b -> a -> b) -> b -> Attributed a -> b)
-> (forall b a. (b -> a -> b) -> b -> Attributed a -> b)
-> (forall a. (a -> a -> a) -> Attributed a -> a)
-> (forall a. (a -> a -> a) -> Attributed a -> a)
-> (forall a. Attributed a -> [a])
-> (forall a. Attributed a -> Bool)
-> (forall a. Attributed a -> Int)
-> (forall a. Eq a => a -> Attributed a -> Bool)
-> (forall a. Ord a => Attributed a -> a)
-> (forall a. Ord a => Attributed a -> a)
-> (forall a. Num a => Attributed a -> a)
-> (forall a. Num a => Attributed a -> a)
-> Foldable Attributed
forall a. Eq a => a -> Attributed a -> Bool
forall a. Num a => Attributed a -> a
forall a. Ord a => Attributed a -> a
forall m. Monoid m => Attributed m -> m
forall a. Attributed a -> Bool
forall a. Attributed a -> Int
forall a. Attributed a -> [a]
forall a. (a -> a -> a) -> Attributed a -> a
forall m a. Monoid m => (a -> m) -> Attributed a -> m
forall b a. (b -> a -> b) -> b -> Attributed a -> b
forall a b. (a -> b -> b) -> b -> Attributed a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => Attributed m -> m
fold :: forall m. Monoid m => Attributed m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> Attributed a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> Attributed a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> Attributed a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> Attributed a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> Attributed a -> b
foldr :: forall a b. (a -> b -> b) -> b -> Attributed a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> Attributed a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> Attributed a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> Attributed a -> b
foldl :: forall b a. (b -> a -> b) -> b -> Attributed a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> Attributed a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> Attributed a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> Attributed a -> a
foldr1 :: forall a. (a -> a -> a) -> Attributed a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> Attributed a -> a
foldl1 :: forall a. (a -> a -> a) -> Attributed a -> a
$ctoList :: forall a. Attributed a -> [a]
toList :: forall a. Attributed a -> [a]
$cnull :: forall a. Attributed a -> Bool
null :: forall a. Attributed a -> Bool
$clength :: forall a. Attributed a -> Int
length :: forall a. Attributed a -> Int
$celem :: forall a. Eq a => a -> Attributed a -> Bool
elem :: forall a. Eq a => a -> Attributed a -> Bool
$cmaximum :: forall a. Ord a => Attributed a -> a
maximum :: forall a. Ord a => Attributed a -> a
$cminimum :: forall a. Ord a => Attributed a -> a
minimum :: forall a. Ord a => Attributed a -> a
$csum :: forall a. Num a => Attributed a -> a
sum :: forall a. Num a => Attributed a -> a
$cproduct :: forall a. Num a => Attributed a -> a
product :: forall a. Num a => Attributed a -> a
Foldable, Functor Attributed
Foldable Attributed
(Functor Attributed, Foldable Attributed) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> Attributed a -> f (Attributed b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    Attributed (f a) -> f (Attributed a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> Attributed a -> m (Attributed b))
-> (forall (m :: * -> *) a.
    Monad m =>
    Attributed (m a) -> m (Attributed a))
-> Traversable Attributed
forall (t :: * -> *).
(Functor t, Foldable t) =>
(forall (f :: * -> *) a b.
 Applicative f =>
 (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
Attributed (m a) -> m (Attributed a)
forall (f :: * -> *) a.
Applicative f =>
Attributed (f a) -> f (Attributed a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Attributed a -> m (Attributed b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Attributed a -> f (Attributed b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Attributed a -> f (Attributed b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> Attributed a -> f (Attributed b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
Attributed (f a) -> f (Attributed a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
Attributed (f a) -> f (Attributed a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Attributed a -> m (Attributed b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> Attributed a -> m (Attributed b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
Attributed (m a) -> m (Attributed a)
sequence :: forall (m :: * -> *) a.
Monad m =>
Attributed (m a) -> m (Attributed a)
Traversable,
         Typeable (Attributed a)
Typeable (Attributed a) =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> Attributed a -> c (Attributed a))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (Attributed a))
-> (Attributed a -> Constr)
-> (Attributed a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (Attributed a)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (Attributed a)))
-> ((forall b. Data b => b -> b) -> Attributed a -> Attributed a)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Attributed a -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Attributed a -> r)
-> (forall u. (forall d. Data d => d -> u) -> Attributed a -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Attributed a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a))
-> Data (Attributed a)
Attributed a -> Constr
Attributed a -> DataType
(forall b. Data b => b -> b) -> Attributed a -> Attributed a
forall a. Data a => Typeable (Attributed a)
forall a. Data a => Attributed a -> Constr
forall a. Data a => Attributed a -> DataType
forall a.
Data a =>
(forall b. Data b => b -> b) -> Attributed a -> Attributed a
forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Attributed a -> u
forall a u.
Data a =>
(forall d. Data d => d -> u) -> Attributed a -> [u]
forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attributed a)
forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attributed a -> c (Attributed a)
forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Attributed a))
forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Attributed a))
forall a.
Typeable a =>
(forall (c :: * -> *).
 (forall d b. Data d => c (d -> b) -> d -> c b)
 -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Attributed a -> u
forall u. (forall d. Data d => d -> u) -> Attributed a -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attributed a)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attributed a -> c (Attributed a)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Attributed a))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Attributed a))
$cgfoldl :: forall a (c :: * -> *).
Data a =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attributed a -> c (Attributed a)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Attributed a -> c (Attributed a)
$cgunfold :: forall a (c :: * -> *).
Data a =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attributed a)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (Attributed a)
$ctoConstr :: forall a. Data a => Attributed a -> Constr
toConstr :: Attributed a -> Constr
$cdataTypeOf :: forall a. Data a => Attributed a -> DataType
dataTypeOf :: Attributed a -> DataType
$cdataCast1 :: forall a (t :: * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (Attributed a))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (Attributed a))
$cdataCast2 :: forall a (t :: * -> * -> *) (c :: * -> *).
(Data a, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Attributed a))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (Attributed a))
$cgmapT :: forall a.
Data a =>
(forall b. Data b => b -> b) -> Attributed a -> Attributed a
gmapT :: (forall b. Data b => b -> b) -> Attributed a -> Attributed a
$cgmapQl :: forall a r r'.
Data a =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
$cgmapQr :: forall a r r'.
Data a =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Attributed a -> r
$cgmapQ :: forall a u.
Data a =>
(forall d. Data d => d -> u) -> Attributed a -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> Attributed a -> [u]
$cgmapQi :: forall a u.
Data a =>
Int -> (forall d. Data d => d -> u) -> Attributed a -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Attributed a -> u
$cgmapM :: forall a (m :: * -> *).
(Data a, Monad m) =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
$cgmapMp :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
$cgmapMo :: forall a (m :: * -> *).
(Data a, MonadPlus m) =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Attributed a -> m (Attributed a)
Data, Typeable, (forall x. Attributed a -> Rep (Attributed a) x)
-> (forall x. Rep (Attributed a) x -> Attributed a)
-> Generic (Attributed a)
forall x. Rep (Attributed a) x -> Attributed a
forall x. Attributed a -> Rep (Attributed a) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall a x. Rep (Attributed a) x -> Attributed a
forall a x. Attributed a -> Rep (Attributed a) x
$cfrom :: forall a x. Attributed a -> Rep (Attributed a) x
from :: forall x. Attributed a -> Rep (Attributed a) x
$cto :: forall a x. Rep (Attributed a) x -> Attributed a
to :: forall x. Rep (Attributed a) x -> Attributed a
Generic)

fromList :: [Attr a] -> Attributed a
fromList :: forall a. [Attr a] -> Attributed a
fromList = Seq (Attr a) -> Attributed a
forall a. Seq (Attr a) -> Attributed a
Attributed (Seq (Attr a) -> Attributed a)
-> ([Attr a] -> Seq (Attr a)) -> [Attr a] -> Attributed a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. [Attr a] -> Seq (Attr a)
forall a. [a] -> Seq a
S.fromList

singleton :: Attr a -> Attributed a
singleton :: forall a. Attr a -> Attributed a
singleton = Seq (Attr a) -> Attributed a
forall a. Seq (Attr a) -> Attributed a
Attributed (Seq (Attr a) -> Attributed a)
-> (Attr a -> Seq (Attr a)) -> Attr a -> Attributed a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Attr a -> Seq (Attr a)
forall a. a -> Seq a
S.singleton

instance IsString a => IsString (Attr a) where
  fromString :: String -> Attr a
fromString String
x = Link -> Font -> a -> Attr a
forall a. Link -> Font -> a -> Attr a
Attr Link
forall a. Maybe a
Nothing Font
baseFont (String -> a
forall a. IsString a => String -> a
fromString String
x)

instance IsString a => IsString (Attributed a) where
  fromString :: String -> Attributed a
fromString String
x = Seq (Attr a) -> Attributed a
forall a. Seq (Attr a) -> Attributed a
Attributed (Seq (Attr a) -> Attributed a) -> Seq (Attr a) -> Attributed a
forall a b. (a -> b) -> a -> b
$ Attr a -> Seq (Attr a)
forall a. a -> Seq a
S.singleton (Attr a -> Seq (Attr a)) -> Attr a -> Seq (Attr a)
forall a b. (a -> b) -> a -> b
$ Link -> Font -> a -> Attr a
forall a. Link -> Font -> a -> Attr a
Attr Link
forall a. Maybe a
Nothing Font
baseFont (String -> a
forall a. IsString a => String -> a
fromString String
x)

instance Semigroup a => Semigroup (Attributed a) where
  <> :: Attributed a -> Attributed a -> Attributed a
(<>) (Attributed Seq (Attr a)
a) (Attributed Seq (Attr a)
b) = Seq (Attr a) -> Attributed a
forall a. Seq (Attr a) -> Attributed a
Attributed (Seq (Attr a) -> Attributed a) -> Seq (Attr a) -> Attributed a
forall a b. (a -> b) -> a -> b
$ Seq (Attr a)
a Seq (Attr a) -> Seq (Attr a) -> Seq (Attr a)
forall a. Seq a -> Seq a -> Seq a
>< Seq (Attr a)
b

instance Monoid a => Monoid (Attributed a) where
  mempty :: Attributed a
mempty = Seq (Attr a) -> Attributed a
forall a. Seq (Attr a) -> Attributed a
Attributed Seq (Attr a)
forall a. Seq a
S.empty