[Haskell-cafe] Existential quantification of config data types

Sumit Sahrawat, Maths & Computing, IIT (BHU) sumit.sahrawat.apm13 at iitbhu.ac.in
Mon Apr 18 23:45:16 UTC 2016

You can create a readLayer function that returns something like this:

   * data** OneLayer** =** forall** a. Layer a =>** OneLayer** a*

Such that we get:

*    -- Read next layer*
    *readLayer** :: Handle -> IO* *OneLayer*

Still, I feel that an ADT that combines all types is better as it fits the
problem perfectly. Every time you add a new layer it will generate warnings
for missing pattern matches.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20160419/e21e48a8/attachment.html>

More information about the Haskell-Cafe mailing list