linnet-0.4.0.0: Lightweight library for building HTTP API

Safe HaskellNone
LanguageHaskell2010

Linnet.Endpoints.Paths

Synopsis

Documentation

path :: forall a m. (DecodePath a, Applicative m, Typeable a) => Endpoint m a Source #

Endpoint that tries to decode head of the current path reminder into specific type. It consumes head of the reminder.

  • If path is empty, Endpoint is not matched
  • If decoding has failed, Endpoint is not matched

pathConst :: Applicative m => Text -> Endpoint m (HList '[]) Source #

Endpoint that matches only if the head of current path reminder is equal to some given constant value. It consumes head of the reminder.

  • If value matches the provided constant, saves the tail of the path as a reminder
  • Otherwise, resulting endpoint is not matched

p' :: Applicative m => Text -> Endpoint m (HList '[]) Source #

Short alias for pathConst

pathEmpty :: Applicative m => Endpoint m (HList '[]) Source #

Endpoint that matches only against empty path reminder

paths :: forall a m. (DecodePath a, Applicative m, Typeable a) => Endpoint m [a] Source #

Endpoint that consumes the rest of the path reminder and decode it using provided DecodePath for some type a

pathAny :: Applicative m => Endpoint m (HList '[]) Source #

Endpoint that matches any path and discards reminder