[m-users.] Typeclasses
Mark Brown
mark at mercurylang.org
Sun Oct 15 09:25:08 AEDT 2017
On Sun, Oct 15, 2017 at 12:19 AM, Tomas By <tomas at basun.net> wrote:
> On 2017-10-14 14:44, Mark Brown wrote:
>>
>> On Sat, Oct 14, 2017 at 11:00 PM, Dirk Ziegemeyer <dirk at ziegemeyer.de>
>> wrote:
>>>
>>> Is it possible at all to define a typeclass key_value_store with the
>>> method search_value and then to declare map as an instance of this
>>> typeclass?
>>
>>
>> No, "map" is a constructor, not a type, so you would need a
>> constructor class not a typeclass.
>
>
> Isn't it both?
I don't think so. There's a difference between "map" and "a map".
>
> This is the closest I can get to Dirk's example:
>
>
> :- type store ---> store(map(int,int)).
That's "a map" ;-)
How did you know the keys and values were ints? I didn't see any
mention of that earlier in the thread...
Mark
More information about the users
mailing list