Fix GenerateList to let the API be nested

This commit is contained in:
Freezeboy 2015-08-05 21:01:33 +02:00
parent 3dc304b8d7
commit b769ddc32b

View file

@ -156,8 +156,8 @@ class GenerateList reqs where
instance GenerateList AjaxReq where instance GenerateList AjaxReq where
generateList r = [r] generateList r = [r]
instance GenerateList rest => GenerateList (AjaxReq :<|> rest) where instance (GenerateList start, GenerateList rest) => GenerateList (start :<|> rest) where
generateList (r :<|> rest) = r : generateList rest generateList (start :<|> rest) = (generateList start) ++ (generateList rest)
-- | Generate the necessary data for JS codegen as a list, each 'AjaxReq' -- | Generate the necessary data for JS codegen as a list, each 'AjaxReq'
-- describing one endpoint from your API type. -- describing one endpoint from your API type.