servant-0.4.4.6: A family of combinators for defining webservices APIs

Safe HaskellSafe
LanguageHaskell2010

Servant.Common.Text

Synopsis

Documentation

class FromText a where Source

For getting values from url captures and query string parameters Instances should obey: > fromText (toText a) == Just a

Methods

fromText :: Text -> Maybe a Source

Instances

FromText Bool Source
>>> fromText ("true"::Text) :: Maybe Bool
Just True
>>> fromText ("false"::Text) :: Maybe Bool
Just False
>>> fromText ("anything else"::Text) :: Maybe Bool
Nothing
FromText Double Source 
FromText Float Source 
FromText Int Source 
FromText Int8 Source 
FromText Int16 Source 
FromText Int32 Source 
FromText Int64 Source 
FromText Integer Source 
FromText Word Source 
FromText Word8 Source 
FromText Word16 Source 
FromText Word32 Source 
FromText Word64 Source 
FromText String Source 
FromText Text Source 

class ToText a where Source

For putting values in paths and query string parameters Instances should obey: > fromText (toText a) == Just a

Methods

toText :: a -> Text Source