{-# 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 :: forall a. ConvertibleStrings a String => a -> String
toString = a -> String
forall a b. ConvertibleStrings a b => a -> b
cs

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

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

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

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

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

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

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

toLT :: ConvertibleStrings a LT => a -> LT
toLT :: forall a. ConvertibleStrings a LazyText => 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 :: forall a. ConvertibleStrings String a => String -> a
fromString = String -> a
forall a b. ConvertibleStrings a b => a -> b
cs

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

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

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

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

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

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

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

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