apiary-0.5.0.0: Simple web framework inspired by scotty.

Safe HaskellNone

Control.Monad.Apiary.Filter.Internal.Query

Synopsis

Documentation

query :: (Query a, Strategy w, Monad m) => ByteString -> Proxy (w a) -> ApiaryT (SNext w as a) m b -> ApiaryT as m bSource

low level query getter. since 0.5.0.0.

 query key (Proxy :: Proxy (fetcher type))

examples:

 query key (Proxy :: Proxy (First Int)) -- get first 'key' query parameter as Int.
 query key (Proxy :: Proxy (Option (Maybe Int)) -- get first 'key' query parameter as Int. allow without param or value.
 query key (Proxy :: Proxy (Many String) -- get all 'key' query parameter as String.

class Strategy w whereSource

Associated Types

type SNext w as a :: [*]Source

Methods

readStrategy :: Query a => ByteString -> Proxy (w a) -> Query -> SList as -> Maybe (SList (SNext w as a))Source

getQuery :: Query a => Proxy (w a) -> ByteString -> Query -> [Maybe a]Source

data Option a Source

get first matched key( [1,) params to Type.). since 0.5.0.0.

Instances

data First a Source

get first matched key ( [0,) params to Maybe Type.) since 0.5.0.0.

Instances

data One a Source

get key ( [1] param to Type.) since 0.5.0.0.

Instances

data Many a Source

get parameters ( [0,) params to [Type] ) since 0.5.0.0.

Instances

data Some a Source

get parameters ( [1,) params to [Type] ) since 0.5.0.0.

Instances

data Check a Source

type check ( [0,) params to No argument ) since 0.5.0.0.

Instances