slamdata / purescript-sql-squared

purescript Sql^2 ast, pretty printer etc
11 stars 6 forks source link

Add query/module productions #12

Closed natefaubion closed 7 years ago

natefaubion commented 7 years ago

I left the existing functions (parse, encodeJson, etc) to work on just SqlF expressions, adding parseTop, etc for the module/query productions. I can get rid of this distinction though and require everything to build either a Query or Module. Which would you prefer?

garyb commented 7 years ago

Do you think it makes sense to have a sum for SqlTop? I'm not sure there are many (any?) cases where either query or module are acceptable in the same place. It seems like maybe they should be separate types. Either that, or we could use a phantom type / pseudo-GADT thing, so that we don't have to pattern match SqlTop, as we'll already know which of the two options it is from the type.

natefaubion commented 7 years ago

That's a good point. I'll put them in separate types.

natefaubion commented 7 years ago

Done.