News for hackers. Stuff that matters.
Re:Letter to a Young Haskell Enthusiast by lomnakkus on Saturday August 02, 2014 @04:12AM (#8124389)
I find this a strange and unconvincing example -- if I'm understanding you correctly, that is. Is your complaint about strong typing here that you'd be forced to define stuff like a record Customer with fields "lastName", "firstName", etc. and you'd rather avoid that?

If you'd like something more "dynamic" (i.e. type-unsafe), you can instead just define a "universal data type" for all your CRUD data. For example you could define, say

   data Any = Number Int
            | Str String
            | Map String Any
            | Date ...
            | ...
and where you want "universal" data manipulation you just use Any.

EDIT: Thus you've confined all the "fuzziness" of your data definitions to a "subsystem" of your system and you can still benefit from proper types and type checking everywhere else.

There are no comments on this comment yet.