typed-encoding-0.2.1.0: Type safe string transformations

Safe HaskellSafe
LanguageHaskell2010

Data.TypedEncoding.Internal.Class.IsStringR

Description

This Module will be removed in 0.3.x.x in favor of Data.TypedEncoding.Internal.Class.Util.StringConstraints

Synopsis

Documentation

>>> :set -XScopedTypeVariables -XTypeApplications -XAllowAmbiguousTypes
>>> import Test.QuickCheck
>>> import Test.QuickCheck.Instances.Text()
>>> import Test.QuickCheck.Instances.ByteString()

class IsStringR a where Source #

This class will be removed in 0.3.x.x in favor of classes definined in Data.TypedEncoding.Internal.Class.Util.StringConstraints

Reverses IsString

laws:

 toString . fromString == id
 fromString . toString == id

Note: ByteString is not a valid instance, ByteString "r-ASCII", or "r-UTF8" would be needed. B.unpack $ B.pack "160688" == "176"

Methods

toString :: a -> String Source #

Instances
IsStringR Text Source #
prop_toStringFromString (Proxy :: Proxy TL.Text)
prop_fromStringToString @TL.Text
Instance details

Defined in Data.TypedEncoding.Internal.Class.IsStringR

Methods

toString :: Text -> String Source #

IsStringR Text Source #
prop_toStringFromString (Proxy :: Proxy T.Text)
prop_fromStringToString @T.Text
Instance details

Defined in Data.TypedEncoding.Internal.Class.IsStringR

Methods

toString :: Text -> String Source #

prop_fromStringToString :: forall s. (IsString s, IsStringR s, Eq s) => s -> Bool Source #