    {-# LANGUAGE CPP, FlexibleInstances, OverlappingInstances #-}
    {-# OPTIONS_GHC -fno-warn-orphans #-}
    {-# OPTIONS_HADDOCK not-home #-}

    module Text.StringTemplate.Instances() where
    import Text.StringTemplate.Classes

    import qualified Data.Map as M
    import Numeric
    import qualified Data.ByteString.Char8 as B
    import qualified Data.ByteString.Lazy.Char8 as LB
    import Data.Ratio
    import Data.Array
    import Data.Maybe
    import qualified Data.Foldable as F
    import Data.Time
    import Data.Void
    import qualified Data.Text as T
    import qualified Data.Text.Lazy as LT

    #if !MIN_VERSION_time(1,5,0)
    import System.Locale (defaultTimeLocale)
    #endif

    {--------------------------------------------------------------------
      Additional instances for items that may be set as StringTemplate
      attributes. The code should provide examples of how to proceed.
    --------------------------------------------------------------------}

    --Basics
    instance ToSElem () where
        toSElem :: forall b. Stringable b => () -> SElem b
    toSElem ()
    _ = String -> SElem b
    forall a. String -> SElem a
    STR String
    ""

    instance ToSElem Void where
        toSElem :: forall b. Stringable b => Void -> SElem b
    toSElem = Void -> SElem b
    forall a. Void -> a
    absurd

    instance ToSElem Char where
        toSElem :: forall b. Stringable b => Char -> SElem b
    toSElem = String -> SElem b
    forall a. String -> SElem a
    STR (String -> SElem b) -> (Char -> String) -> Char -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (Char -> String -> String
    forall a. a -> [a] -> [a]
    :[])
        toSElemList :: forall b. Stringable b => String -> SElem b
    toSElemList = String -> SElem b
    forall a. String -> SElem a
    STR

    instance ToSElem LB.ByteString where
        toSElem :: forall b. Stringable b => ByteString -> SElem b
    toSElem = ByteString -> SElem b
    forall a. ByteString -> SElem a
    BS

    instance ToSElem B.ByteString where
        toSElem :: forall b. Stringable b => ByteString -> SElem b
    toSElem = ByteString -> SElem b
    forall a. ByteString -> SElem a
    BS (ByteString -> SElem b)
    -> (ByteString -> ByteString) -> ByteString -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [ByteString] -> ByteString
    LB.fromChunks ([ByteString] -> ByteString)
    -> (ByteString -> [ByteString]) -> ByteString -> ByteString
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (ByteString -> [ByteString] -> [ByteString]
    forall a. a -> [a] -> [a]
    :[])

    instance ToSElem LT.Text where
        toSElem :: forall b. Stringable b => Text -> SElem b
    toSElem = Text -> SElem b
    forall a. Text -> SElem a
    TXT

    instance ToSElem T.Text where
        toSElem :: forall b. Stringable b => Text -> SElem b
    toSElem = Text -> SElem b
    forall a. Text -> SElem a
    TXT (Text -> SElem b) -> (Text -> Text) -> Text -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Text -> Text
    LT.fromStrict

    instance ToSElem Bool where
        toSElem :: forall b. Stringable b => Bool -> SElem b
    toSElem Bool
    True = String -> SElem b
    forall a. String -> SElem a
    STR String
    ""
        toSElem Bool
    _ = SElem b
    forall a. SElem a
    SNull

    instance (ToSElem a) => ToSElem (Maybe a) where
        toSElem :: forall b. Stringable b => Maybe a -> SElem b
    toSElem (Just a
    x) = a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    x
        toSElem Maybe a
    _ = SElem b
    forall a. SElem a
    SNull

    instance (ToSElem a) => ToSElem (M.Map String a) where
        toSElem :: forall b. Stringable b => Map String a -> SElem b
    toSElem = SMap b -> SElem b
    forall a. SMap a -> SElem a
    SM (SMap b -> SElem b)
    -> (Map String a -> SMap b) -> Map String a -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . (a -> SElem b) -> Map String a -> SMap b
    forall a b. (a -> b) -> Map String a -> Map String b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem

    instance (ToSElem a) => ToSElem [a] where
        toSElem :: forall b. Stringable b => [a] -> SElem b
    toSElem = [a] -> SElem b
    forall b. Stringable b => [a] -> SElem b
    forall a b. (ToSElem a, Stringable b) => [a] -> SElem b
    toSElemList

    instance (ToSElem a, Ix i) => ToSElem (Array i a) where
       toSElem :: forall b. Stringable b => Array i a -> SElem b
    toSElem = [a] -> SElem b
    forall b. Stringable b => [a] -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem ([a] -> SElem b) -> (Array i a -> [a]) -> Array i a -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Array i a -> [a]
    forall i e. Array i e -> [e]
    elems

    instance (ToSElem a, F.Foldable t) => ToSElem (t a) where
        toSElem :: forall b. Stringable b => t a -> SElem b
    toSElem = [a] -> SElem b
    forall b. Stringable b => [a] -> SElem b
    forall a b. (ToSElem a, Stringable b) => [a] -> SElem b
    toSElemList ([a] -> SElem b) -> (t a -> [a]) -> t a -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . t a -> [a]
    forall a. t a -> [a]
    forall (t :: * -> *) a. Foldable t => t a -> [a]
    F.toList

    --Numbers
    instance StringTemplateShows Float where
        stringTemplateShow :: Float -> String
    stringTemplateShow = (Float -> String -> String) -> String -> Float -> String
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Float -> String -> String
    forall a. RealFloat a => a -> String -> String
    showFloat String
    ""
        stringTemplateFormattedShow :: String -> Float -> String
    stringTemplateFormattedShow = ((Float -> String -> String) -> String -> Float -> String)
    -> String -> (Float -> String -> String) -> Float -> String
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip (Float -> String -> String) -> String -> Float -> String
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip [] ((Float -> String -> String) -> Float -> String)
    -> (String -> Float -> String -> String)
    -> String
    -> Float
    -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Maybe Int -> Float -> String -> String
    forall a. RealFloat a => Maybe Int -> a -> String -> String
    showGFloat (Maybe Int -> Float -> String -> String)
    -> (String -> Maybe Int) -> String -> Float -> String -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ((Int, String) -> Int) -> Maybe (Int, String) -> Maybe Int
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Int, String) -> Int
    forall a b. (a, b) -> a
    fst (Maybe (Int, String) -> Maybe Int)
    -> (String -> Maybe (Int, String)) -> String -> Maybe Int
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [(Int, String)] -> Maybe (Int, String)
    forall a. [a] -> Maybe a
    listToMaybe ([(Int, String)] -> Maybe (Int, String))
    -> (String -> [(Int, String)]) -> String -> Maybe (Int, String)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> [(Int, String)]
    forall a. Read a => ReadS a
    reads
    instance ToSElem Float where
        toSElem :: forall b. Stringable b => Float -> SElem b
    toSElem = Float -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance StringTemplateShows Double where
        stringTemplateShow :: Double -> String
    stringTemplateShow = (Double -> String -> String) -> String -> Double -> String
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip Double -> String -> String
    forall a. RealFloat a => a -> String -> String
    showFloat String
    ""
        stringTemplateFormattedShow :: String -> Double -> String
    stringTemplateFormattedShow = ((Double -> String -> String) -> String -> Double -> String)
    -> String -> (Double -> String -> String) -> Double -> String
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip (Double -> String -> String) -> String -> Double -> String
    forall a b c. (a -> b -> c) -> b -> a -> c
    flip [] ((Double -> String -> String) -> Double -> String)
    -> (String -> Double -> String -> String)
    -> String
    -> Double
    -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Maybe Int -> Double -> String -> String
    forall a. RealFloat a => Maybe Int -> a -> String -> String
    showGFloat (Maybe Int -> Double -> String -> String)
    -> (String -> Maybe Int) -> String -> Double -> String -> String
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . ((Int, String) -> Int) -> Maybe (Int, String) -> Maybe Int
    forall a b. (a -> b) -> Maybe a -> Maybe b
    forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
    fmap (Int, String) -> Int
    forall a b. (a, b) -> a
    fst (Maybe (Int, String) -> Maybe Int)
    -> (String -> Maybe (Int, String)) -> String -> Maybe Int
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [(Int, String)] -> Maybe (Int, String)
    forall a. [a] -> Maybe a
    listToMaybe ([(Int, String)] -> Maybe (Int, String))
    -> (String -> [(Int, String)]) -> String -> Maybe (Int, String)
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . String -> [(Int, String)]
    forall a. Read a => ReadS a
    reads
    instance ToSElem Double where
        toSElem :: forall b. Stringable b => Double -> SElem b
    toSElem = Double -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance ToSElem Int where
        toSElem :: forall b. Stringable b => Int -> SElem b
    toSElem = String -> SElem b
    forall a. String -> SElem a
    STR (String -> SElem b) -> (Int -> String) -> Int -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Int -> String
    forall a. Show a => a -> String
    show

    instance ToSElem Integer where
        toSElem :: forall b. Stringable b => Integer -> SElem b
    toSElem = String -> SElem b
    forall a. String -> SElem a
    STR (String -> SElem b) -> (Integer -> String) -> Integer -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Integer -> String
    forall a. Show a => a -> String
    show

    instance (Integral a, Show a) => ToSElem (Ratio a) where
        toSElem :: forall b. Stringable b => Ratio a -> SElem b
    toSElem = String -> SElem b
    forall a. String -> SElem a
    STR (String -> SElem b) -> (Ratio a -> String) -> Ratio a -> SElem b
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . Ratio a -> String
    forall a. Show a => a -> String
    show

    --Dates and Times

    instance StringTemplateShows Day where
        stringTemplateShow :: Day -> String
    stringTemplateShow = Day -> String
    forall a. Show a => a -> String
    show
        stringTemplateFormattedShow :: String -> Day -> String
    stringTemplateFormattedShow = TimeLocale -> String -> Day -> String
    forall t. FormatTime t => TimeLocale -> String -> t -> String
    formatTime TimeLocale
    defaultTimeLocale
    instance ToSElem Day where
        toSElem :: forall b. Stringable b => Day -> SElem b
    toSElem = Day -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance StringTemplateShows LocalTime where
        stringTemplateShow :: LocalTime -> String
    stringTemplateShow = LocalTime -> String
    forall a. Show a => a -> String
    show
        stringTemplateFormattedShow :: String -> LocalTime -> String
    stringTemplateFormattedShow = TimeLocale -> String -> LocalTime -> String
    forall t. FormatTime t => TimeLocale -> String -> t -> String
    formatTime TimeLocale
    defaultTimeLocale
    instance ToSElem LocalTime where
        toSElem :: forall b. Stringable b => LocalTime -> SElem b
    toSElem = LocalTime -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance StringTemplateShows TimeOfDay where
        stringTemplateShow :: TimeOfDay -> String
    stringTemplateShow = TimeOfDay -> String
    forall a. Show a => a -> String
    show
        stringTemplateFormattedShow :: String -> TimeOfDay -> String
    stringTemplateFormattedShow = TimeLocale -> String -> TimeOfDay -> String
    forall t. FormatTime t => TimeLocale -> String -> t -> String
    formatTime TimeLocale
    defaultTimeLocale
    instance ToSElem TimeOfDay where
        toSElem :: forall b. Stringable b => TimeOfDay -> SElem b
    toSElem = TimeOfDay -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance StringTemplateShows UTCTime where
        stringTemplateShow :: UTCTime -> String
    stringTemplateShow = UTCTime -> String
    forall a. Show a => a -> String
    show
        stringTemplateFormattedShow :: String -> UTCTime -> String
    stringTemplateFormattedShow = TimeLocale -> String -> UTCTime -> String
    forall t. FormatTime t => TimeLocale -> String -> t -> String
    formatTime TimeLocale
    defaultTimeLocale
    instance ToSElem UTCTime where
        toSElem :: forall b. Stringable b => UTCTime -> SElem b
    toSElem = UTCTime -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance StringTemplateShows TimeZone where
        stringTemplateShow :: TimeZone -> String
    stringTemplateShow = TimeZone -> String
    forall a. Show a => a -> String
    show
        stringTemplateFormattedShow :: String -> TimeZone -> String
    stringTemplateFormattedShow = TimeLocale -> String -> TimeZone -> String
    forall t. FormatTime t => TimeLocale -> String -> t -> String
    formatTime TimeLocale
    defaultTimeLocale
    instance ToSElem TimeZone where
        toSElem :: forall b. Stringable b => TimeZone -> SElem b
    toSElem = TimeZone -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    instance StringTemplateShows ZonedTime where
        stringTemplateShow :: ZonedTime -> String
    stringTemplateShow = ZonedTime -> String
    forall a. Show a => a -> String
    show
        stringTemplateFormattedShow :: String -> ZonedTime -> String
    stringTemplateFormattedShow = TimeLocale -> String -> ZonedTime -> String
    forall t. FormatTime t => TimeLocale -> String -> t -> String
    formatTime TimeLocale
    defaultTimeLocale
    instance ToSElem ZonedTime where
        toSElem :: forall b. Stringable b => ZonedTime -> SElem b
    toSElem = ZonedTime -> SElem b
    forall a b. (StringTemplateShows a, Stringable b) => a -> SElem b
    stShowsToSE

    t2map :: [SElem a] -> SElem a
    t2map :: forall a. [SElem a] -> SElem a
    t2map = SMap a -> SElem a
    forall a. SMap a -> SElem a
    SM (SMap a -> SElem a)
    -> ([SElem a] -> SMap a) -> [SElem a] -> SElem a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [(String, SElem a)] -> SMap a
    forall k a. Ord k => [(k, a)] -> Map k a
    M.fromList ([(String, SElem a)] -> SMap a)
    -> ([SElem a] -> [(String, SElem a)]) -> [SElem a] -> SMap a
    forall b c a. (b -> c) -> (a -> b) -> a -> c
    . [String] -> [SElem a] -> [(String, SElem a)]
    forall a b. [a] -> [b] -> [(a, b)]
    zip ((Int -> String) -> [Int] -> [String]
    forall a b. (a -> b) -> [a] -> [b]
    map Int -> String
    forall a. Show a => a -> String
    show [(Int
    0::Int)..])

    instance (ToSElem a, ToSElem b) => ToSElem (a, b) where
       toSElem :: forall b. Stringable b => (a, b) -> SElem b
    toSElem (a
    a,b
    b) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b]
    instance (ToSElem a, ToSElem b, ToSElem c) => ToSElem (a, b, c) where
       toSElem :: forall b. Stringable b => (a, b, c) -> SElem b
    toSElem (a
    a,b
    b,c
    c) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d) => ToSElem (a, b, c, d) where
       toSElem :: forall b. Stringable b => (a, b, c, d) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d, ToSElem e) => ToSElem (a, b, c, d, e) where
       toSElem :: forall b. Stringable b => (a, b, c, d, e) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d,e
    e) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d, e -> SElem b
    forall b. Stringable b => e -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem e
    e]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d, ToSElem e, ToSElem f) => ToSElem (a, b, c, d, e, f) where
       toSElem :: forall b. Stringable b => (a, b, c, d, e, f) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d,e
    e, f
    f) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d, e -> SElem b
    forall b. Stringable b => e -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem e
    e, f -> SElem b
    forall b. Stringable b => f -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem f
    f]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d, ToSElem e, ToSElem f, ToSElem g) => ToSElem (a, b, c, d, e, f, g) where
       toSElem :: forall b. Stringable b => (a, b, c, d, e, f, g) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d,e
    e,f
    f,g
    g) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d, e -> SElem b
    forall b. Stringable b => e -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem e
    e, f -> SElem b
    forall b. Stringable b => f -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem f
    f, g -> SElem b
    forall b. Stringable b => g -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem g
    g]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d, ToSElem e, ToSElem f, ToSElem g, ToSElem h) => ToSElem (a, b, c, d, e, f, g, h) where
       toSElem :: forall b. Stringable b => (a, b, c, d, e, f, g, h) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d,e
    e,f
    f,g
    g,h
    h) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d, e -> SElem b
    forall b. Stringable b => e -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem e
    e, f -> SElem b
    forall b. Stringable b => f -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem f
    f, g -> SElem b
    forall b. Stringable b => g -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem g
    g, h -> SElem b
    forall b. Stringable b => h -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem h
    h]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d, ToSElem e, ToSElem f, ToSElem g, ToSElem h, ToSElem i) => ToSElem (a, b, c, d, e, f, g, h, i) where
       toSElem :: forall b. Stringable b => (a, b, c, d, e, f, g, h, i) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d,e
    e,f
    f,g
    g,h
    h,i
    i) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d, e -> SElem b
    forall b. Stringable b => e -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem e
    e, f -> SElem b
    forall b. Stringable b => f -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem f
    f, g -> SElem b
    forall b. Stringable b => g -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem g
    g, h -> SElem b
    forall b. Stringable b => h -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem h
    h, i -> SElem b
    forall b. Stringable b => i -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem i
    i]
    instance (ToSElem a, ToSElem b, ToSElem c, ToSElem d, ToSElem e, ToSElem f, ToSElem g, ToSElem h, ToSElem i, ToSElem j) => ToSElem (a, b, c, d, e, f, g, h, i, j) where
       toSElem :: forall b. Stringable b => (a, b, c, d, e, f, g, h, i, j) -> SElem b
    toSElem (a
    a,b
    b,c
    c,d
    d,e
    e,f
    f,g
    g,h
    h,i
    i,j
    j) = [SElem b] -> SElem b
    forall a. [SElem a] -> SElem a
    t2map [a -> SElem b
    forall b. Stringable b => a -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem a
    a, b -> SElem b
    forall b. Stringable b => b -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem b
    b, c -> SElem b
    forall b. Stringable b => c -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem c
    c, d -> SElem b
    forall b. Stringable b => d -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem d
    d, e -> SElem b
    forall b. Stringable b => e -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem e
    e, f -> SElem b
    forall b. Stringable b => f -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem f
    f, g -> SElem b
    forall b. Stringable b => g -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem g
    g, h -> SElem b
    forall b. Stringable b => h -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem h
    h, i -> SElem b
    forall b. Stringable b => i -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem i
    i, j -> SElem b
    forall b. Stringable b => j -> SElem b
    forall a b. (ToSElem a, Stringable b) => a -> SElem b
    toSElem j
    j]