haskell-graphql / graphql-api

Write type-safe GraphQL services in Haskell
BSD 3-Clause "New" or "Revised" License
406 stars 35 forks source link

List is too general #28

Open jml opened 7 years ago

jml commented 7 years ago

GraphQL says lists are homogeneous. All elements should be the same type.

Our type is currently:

newtype List = List [Value] deriving (Eq, Ord, Show)

We could change it to:

data List
  = IntList [Int32]
  | FloatList [Double]
  -- ... and so forth

I don't know if this is a good idea or not, but worth experimenting after other bits are more coherent.