From b769ddc32bdb5519725ce9a61d74f24211e4389f Mon Sep 17 00:00:00 2001 From: Freezeboy Date: Wed, 5 Aug 2015 21:01:33 +0200 Subject: [PATCH] Fix GenerateList to let the API be nested --- servant-js/src/Servant/JS.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servant-js/src/Servant/JS.hs b/servant-js/src/Servant/JS.hs index 6381bb6c..383b9c46 100644 --- a/servant-js/src/Servant/JS.hs +++ b/servant-js/src/Servant/JS.hs @@ -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.