Functional style - examples

Related to this query : SQL formatter library wanted

People might like to take a squiz at how the datatypes in Haskell are used in this library
to capture the structure of SQL statements.
source : queryparser/Query.hs at master · uber/queryparser · GitHub

Product types are like our Record and Class.
eg A single type might contain integer AND string AND enum.

image

Sum types (co-product types) are the opposite of product types.
eg A single type which is integer OR string OR enum.

‘Select r a’ and ‘Expr r a’ are type constructors.

Just like a generic type in Delphi, eg TSelect< R,A > or TExpr< R,A >
they need to be provided with two types in order to form a concrete type, like eg TExpr< string, string >