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
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