[Haskell-beginners] Use a list as data for a data type?

Michael Orlitzky michael at orlitzky.com
Fri Feb 22 21:56:51 CET 2013


On 02/22/2013 03:40 PM, Bryce Verdier wrote:
> Brent,
> 
> Thank you for the responses. I appreciate it. Bummer about there not 
> being some kind of built-in/generic shortcut.
> 


You can try with a fold:

  >>> (((IpAddress $ 1) $ 2) $ 3) $ 4
  IpAddress 1 2 3 4

If you consider the type of the constructor along with the types passed
through the fold, it might become clearer why this can't work in general.




More information about the Beginners mailing list