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

Safe HaskellSafe-Inferred
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
>>> fromText ("true"::Text) :: Maybe Bool
Just True
>>> fromText ("false"::Text) :: Maybe Bool
Just False
>>> fromText ("anything else"::Text) :: Maybe Bool
Nothing
FromText Double 
FromText Float 
FromText Int 
FromText Int8 
FromText Int16 
FromText Int32 
FromText Int64 
FromText Integer 
FromText Word 
FromText Word8 
FromText Word16 
FromText Word32 
FromText Word64 
FromText String 
FromText Text 

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