IHP 1.1 is out now!

Discriminating unions

Aksel Stadler Kjetså

Hi! I'm new to Haskell and I'm really impressed by the modelling power of discriminating unions. Fex a zapier clone might do something like this

Zap = new Record {id, trigger, actions}

data trigger = timerTrigger | httpTriger ... etc

However, how does people go about modelling sum types in postgres? I cant find any examples. Is it usually not done?

Lillo PRO

Based on your example, it might be that enums could work for you here: