{-# LANGUAGE FlexibleContexts #-}

-- | Monomorphic conversion functions that are useful when you wish to
-- be explicit about the conversion without writing a type signature
-- or when 'Data.String.Conversions.cs' is ambiguous due to
-- polymorphic inputs or outputs.
--
-- All functions in this module have 'Data.String.Conversions.cs' as
-- their implementation.
module Data.String.Conversions.Monomorphic (
    -- * From a polymorphic input to a monomorphic output
    toString,
    toStrictByteString,
    toSBS,
    toLazyByteString,
    toLBS,
    toStrictText,
    toST,
    toLazyText,
    toLT,

    -- * From a monomorphic input to a polymorphic output

    fromString,
    fromStrictByteString,
    fromSBS,
    fromLazyByteString,
    fromLBS,
    fromStrictText,
    fromST,
    fromLazyText,
    fromLT
  ) where

import Prelude (String)

import Data.String.Conversions

-- to a monomorphic type

toString :: ConvertibleStrings a String => a -> String
toString :: a -> String
toString = a -> String
forall a b. ConvertibleStrings a b => a -> b
cs

toStrictByteString :: ConvertibleStrings a StrictByteString => a -> StrictByteString
toStrictByteString :: a -> StrictByteString
toStrictByteString = a -> StrictByteString
forall a b. ConvertibleStrings a b => a -> b
cs

toSBS :: ConvertibleStrings a SBS => a -> SBS
toSBS :: a -> StrictByteString
toSBS = a -> StrictByteString
forall a b. ConvertibleStrings a b => a -> b
cs

toLazyByteString :: ConvertibleStrings a LazyByteString => a -> LazyByteString
toLazyByteString :: a -> LazyByteString
toLazyByteString = a -> LazyByteString
forall a b. ConvertibleStrings a b => a -> b
cs

toLBS :: ConvertibleStrings a LBS => a -> LBS
toLBS :: a -> LazyByteString
toLBS = a -> LazyByteString
forall a b. ConvertibleStrings a b => a -> b
cs

toStrictText :: ConvertibleStrings a StrictText => a -> StrictText
toStrictText :: a -> StrictText
toStrictText = a -> StrictText
forall a b. ConvertibleStrings a b => a -> b
cs

toST :: ConvertibleStrings a ST => a -> ST
toST :: a -> StrictText
toST = a -> StrictText
forall a b. ConvertibleStrings a b => a -> b
cs

toLazyText :: ConvertibleStrings a LazyText => a -> LazyText
toLazyText :: a -> LazyText
toLazyText = a -> LazyText
forall a b. ConvertibleStrings a b => a -> b
cs

toLT :: ConvertibleStrings a LT => a -> LT
toLT :: a -> LazyText
toLT = a -> LazyText
forall a b. ConvertibleStrings a b => a -> b
cs

-- from a monomorphic type

fromString :: ConvertibleStrings String a => String -> a
fromString :: String -> a
fromString = String -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromStrictByteString :: ConvertibleStrings StrictByteString a => StrictByteString -> a
fromStrictByteString :: StrictByteString -> a
fromStrictByteString = StrictByteString -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromSBS :: ConvertibleStrings SBS a => SBS -> a
fromSBS :: StrictByteString -> a
fromSBS = StrictByteString -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromLazyByteString :: ConvertibleStrings LazyByteString a => LazyByteString -> a
fromLazyByteString :: LazyByteString -> a
fromLazyByteString = LazyByteString -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromLBS :: ConvertibleStrings LBS a => LBS -> a
fromLBS :: LazyByteString -> a
fromLBS = LazyByteString -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromStrictText :: ConvertibleStrings StrictText a => StrictText -> a
fromStrictText :: StrictText -> a
fromStrictText = StrictText -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromST :: ConvertibleStrings ST a => ST -> a
fromST :: StrictText -> a
fromST = StrictText -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromLazyText :: ConvertibleStrings LazyText a => LazyText -> a
fromLazyText :: LazyText -> a
fromLazyText = LazyText -> a
forall a b. ConvertibleStrings a b => a -> b
cs

fromLT :: ConvertibleStrings LT a => LT -> a
fromLT :: LazyText -> a
fromLT = LazyText -> a
forall a b. ConvertibleStrings a b => a -> b
cs