[Haskell-cafe] Using -> as both type and value constructor

Armando Blancas abm221617 at gmail.com
Thu Aug 25 02:31:28 CEST 2011


Thanks for the info; that's good to know. The ICFP '01 version uses pairs;
not sure when the other came out or where.

On Wed, Aug 24, 2011 at 4:46 PM, wren ng thornton <wren at freegeek.org> wrote:

> On 8/24/11 5:03 PM, Armando Blancas wrote:
>
>>
>>>  I didn't see that claim in the linked slides, and it's not Haskell '98
>>>>
>>> (nor Haskell 2010).
>>>
>>
>> I didn't realize it linked to the slides; I thought that pointed to the
>> article. I just found another version of the paper, A Simple
>> Implementation
>> Technique for Priority Search Queues, by Hinze, which shows the binding
>> type
>> as a pair, with access functions for k and p. I'll continue to work my way
>> through the material there. Thanks for you response.
>>
>
> With -XTypeOperators you can define
>
>    data a :-> b = a :-> b
>
> where (:->) is both a type constructor and a data constructor. Note the
> leading colon which is the only "capital" punctuation letter. Hinze may have
> just chosen to elide the colon for prettiness.
>
> --
> Live well,
> ~wren
>
> ______________________________**_________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/**mailman/listinfo/haskell-cafe<http://www.haskell.org/mailman/listinfo/haskell-cafe>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110824/6bc489e6/attachment.htm>


More information about the Haskell-Cafe mailing list