[Haskell-cafe] Data constructors

Iavor S. Diatchki diatchki at cse.ogi.edu
Mon Apr 26 11:27:52 EDT 2004


hi,
i have thought about things like that, but the qualification 
Type.Constructor does
not seem particularly useful.  you can achieve the same by using "_", e.g
data A = A_X | A_Y
data B = B_X | B_Y
alternatively (at least for non-recursilve datatypes) anonymous sums 
(ala TREX's records)
could work pretty well, but they are not in Haskell.  details about 
those can probably be
found in Ben Gaster's thesis.
-iavor


Mark Carroll wrote:

>I keep running into annoyance in having to name data constructors
>differently if they're for different types if they're in the same module
>or something. I wish that something like some Type.Constructor syntax
>worked in order to disambiguate. Or, better still, I have that problem
>with function names too (e.g. Data.List.union, Data.Set.union, IIRC) and
>it occurs to me that a lot of this can be resolved automatically because
>the types only make sense with one of the choices.
>
>I'm not really proposing any changes; more, I'm wondering what others'
>thinking is about this sort of thing - what annoys them, how they get
>around it, etc.
>
>-- Mark
>_______________________________________________
>Haskell-Cafe mailing list
>Haskell-Cafe at haskell.org
>http://www.haskell.org/mailman/listinfo/haskell-cafe
>  
>



More information about the Haskell-Cafe mailing list