Merge pull request #180 from haskell-servant/freezeboy/js-small-fix

Fix GenerateList to let the API be nested
This commit is contained in:
Julian Arni 2015-08-06 09:05:23 +02:00
commit 38eb199243

View file

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