apiary-0.17.2: Simple and type safe web framework that can be automatically generate API documentation.

Safe HaskellNone
LanguageHaskell2010

Data.Apiary.Param

Synopsis

Documentation

jsToBool :: (IsString a, Eq a) => a -> Bool Source

readPathAs :: Path a => proxy a -> Text -> Maybe a Source

data Text Source

Instances

class Path a where Source

Methods

readPath :: Text -> Maybe a Source

pathRep :: proxy a -> TypeRep Source

Instances

Path Bool

javascript boolean. when "false", "0", "-0", "", "null", "undefined", "NaN" then False, else True. since 0.6.0.0.

Path Char 
Path Double 
Path Float 
Path Int 
Path Int8 
Path Int16 
Path Int32 
Path Int64 
Path Integer 
Path Word 
Path Word8 
Path Word16 
Path Word32 
Path Word64 
Path String 
Path ByteString 
Path ByteString 
Path Text 
Path Text 
Path Day

fuzzy date parse. three decimal split by 1 char. if year < 100 then + 2000. since 0.16.0.

example:

  • 2014-02-05
  • 14-2-5
  • 14.2.05

class Query a where Source

Minimal complete definition

readQuery, qTypeRep

Instances

Query Bool

javascript boolean. when "false", "0", "-0", "", "null", "undefined", "NaN" then False, else True. since 0.6.0.0.

Query Double 
Query Float 
Query Int 
Query Int8 
Query Int16 
Query Int32 
Query Int64 
Query Integer 
Query Word 
Query Word8 
Query Word16 
Query Word32 
Query Word64 
Query String 
Query ()

always success. for check existence.

Query ByteString 
Query ByteString 
Query Text 
Query Text 
Query Day

fuzzy date parse. three decimal split by 1 char. if year < 100 then + 2000. since 0.16.0.

example:

  • 2014-02-05
  • 14-2-5
  • 14.2.05
Query a => Query (Maybe a)

allow no parameter. but check parameter type.

pMaybe :: proxy a -> Proxy (Maybe a) Source

class ReqParam a where Source

Methods

reqParams :: proxy a -> Request -> [Param] -> [File] -> [(ByteString, Maybe a)] Source

reqParamRep :: proxy a -> QueryRep Source

Instances