3 ms·
> SQL schemas are not expressive enough to describe the data types which I want to store in the database For my own edification, can you expand on this?
by teej 12y ago
> SQL schemas are not expressive enough to describe the data types which I want to store in the database
For my own edification, can you expand on this?
- stingraycharles 12y agoYou will have to educate yourself on Haskell's type system and type category theory in general. The bottom line is that you can be very, very expressive using higher level types that simply is not possible in any database at all. Personally I like foreign keys, a lot, and couldnt live without them. I dont think Haskell's type system would be a replacement to that, and would rather use a hybrid of those two.
- SamReidHughes 12y agoYou don't need to learn anything about category theory to use Haskell well.
- wereHamster 12y agoI suspect with (non-standard?) SQL extensions and pl/sql functions you could add enough validation that is otherwise inexpressible (in standard SQL). But then you have to replicate some of that logic in your application code and the database. Anyways, let's start with something simple: sumtypes. While simple sumtypes could be described using enums, what if the alternatives have more data attached to them? data User = Anonymous | Registered UserData data UserData = UserData { userName :: UserName , registredAt :: UTCTime } Foreign keys is something that can't be easily verified in Haskell code. So that's something where a proper database still is useful.