Stream: General

Topic: Polymorphic typedef with typeclass restriction


view this post on Zulip Christian Pardillo Laursen (May 16 2024 at 15:27):

Hi, is there any way of defining a new polymorphic type which makes use of a typeclass constant?

A minimal example of what I'd like to write is:

typedef ('a :: metric_space) unit_distances = "{(a::'a,b). dist a b  ≤  1}"

I'm expecting this to not be possible but I figured I'd ask anyway.

view this post on Zulip Christian Pardillo Laursen (May 16 2024 at 15:35):

On second thought it looks like adding (overloaded) works fine, my apologies


Last updated: Dec 21 2024 at 12:33 UTC