-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Formatted JSON generator for API server inspired by normalizr. -- -- Please see README.md @package refty @version 0.2.0.0 -- | Reference + Entity = Refty ♡ -- -- Formatted JSON generator for API server inspired by normalizr. module Refty -- | Key of JSON. type Key = Text -- | Identifier getter of entity. type Identifier a b = a -> b -- | Single or multiple entity. data Entity a SingleEntity :: a -> Entity a ListEntity :: [a] -> Entity a -- | Basic entity information. data Resource a b Resource :: Key -> (Identifier a b) -> (Entity a) -> Resource a b -- | Reference information of entity. data Reference a b SelfRef :: Key -> Reference a b HasOneRef :: Key -> (Identifier a b) -> Reference a b HasManyRef :: Key -> (Identifier a b) -> Reference a b -- | Information builder related entity. data Builder Builder :: (Resource a b) -> [Reference a b] -> Builder -- | JSON presenter. newtype Refty Refty :: [Builder] -> Refty -- | Constructor function for Entity. singleEntity :: (ToJSON a) => a -> Entity a -- | Constructor function for Entity. listEntity :: (ToJSON a) => [a] -> Entity a -- | Constructor function for Resource. resource :: (ToJSON a, ToJSON b, ToJSONKey b, Ord b) => Key -> Identifier a b -> Entity a -> Resource a b -- | Constructor function for Reference. selfRef :: (ToJSON a, ToJSON b, ToJSONKey b, Ord b) => Key -> Reference a b -- | Constructor function for Reference. hasOneRef :: (ToJSON a, ToJSON b, ToJSONKey b, Ord b) => Key -> Identifier a b -> Reference a b -- | Constructor function for Reference. hasManyRef :: (ToJSON a, ToJSON b, ToJSONKey b, Ord b) => Key -> Identifier a b -> Reference a b -- | Constructor function for Builder. builder :: (ToJSON a, ToJSON b, ToJSONKey b, Ord b) => Resource a b -> [Reference a b] -> Builder -- | Constructor function for Refty. refty :: [Builder] -> Refty instance Data.Aeson.Types.ToJSON.ToJSON Refty.Refty