[Haskell-cafe] Cons of -XUndecidableInstances
Yitzchak Gale
gale at sefer.org
Mon Jun 6 09:43:05 CEST 2011
Scott Lawrence wrote:
> But... this prevents me from storing more information in a Model in the
> future. While I don't really anticipate needing too (I can see this
> function covering all likely use cases), it does seem sorta restrictive.
I tend not to think about "storing information inside of things". I just
write functions that do the computations I need - their types describe
the desired inputs and outputs. Data types group them together into
logical structures that reflect what I want to do.
Where the information is coming from and where it is going
then remains a totally independent issue. It is a different part
of the program. That is actually more flexible, not restrictive. Kind
of like the MVC design pattern. The IO monad, which
keeps the parts of the program that interact with outside world
separate, helps us think in this way.
Regards,
Yitz
More information about the Haskell-Cafe
mailing list