haskell-servant / servant-elm

Automatically derive Elm functions to query servant webservices
BSD 3-Clause "New" or "Revised" License
164 stars 48 forks source link

generating elm for polymorphic data type and type synonym is broken #58

Open nlv opened 5 years ago

nlv commented 5 years ago

In my project I use opaleye lib. I have to define polymorphic data type that corresponds to db table and several type synonyms with concrete fixed type parameters. For example:

data People' a b c = People { name :: a, lastname :: b, birthday :: s} type People = People' Text Text Int

And in API type I use type synonym:

type PeopleApi = "people" :> Capture "code" Int :> Get '[JSON] People

Generating elm api client is broken for this case. Full example you can see here: https://github.com/nlv/servant-elm-test