servant-serialization-0.3
Safe HaskellSafe-Inferred
LanguageHaskell2010

Servant.API.ContentTypes.ShowRead

Synopsis

Documentation

data ShowRead Source #

Content-type for instances of the Show and Read classes encoded as UTF-8 data. This is probably slow.

Instances

Instances details
Accept ShowRead Source #

Mime-type using the phrases "haskell" and "showread".

Instance details

Defined in Servant.API.ContentTypes.ShowRead

Show a => MimeRender ShowRead a Source # 
Instance details

Defined in Servant.API.ContentTypes.ShowRead

Read a => MimeUnrender ShowRead a Source #

Decode UTF-8 data and then with Read instance.

>>> mimeUnrender (Proxy :: Proxy ShowRead) "1e5" :: Either String Double
Right 100000.0
>>> mimeUnrender (Proxy :: Proxy ShowRead) "hello" :: Either String Double
Left "Prelude.read: no parse"
>>> mimeUnrender (Proxy :: Proxy ShowRead) "hello\xc3\x28" :: Either String Double
Left "Data.Text.Internal.Encoding.streamDecodeUtf8With: Invalid UTF-8 stream: invalid byte-value: 195"
Instance details

Defined in Servant.API.ContentTypes.ShowRead

>>> :set -XOverloadedStrings