Stream: General

Topic: instantiation with same type


view this post on Zulip irvin (May 02 2024 at 04:44):

Hi would like to ask how to instantiate a type class with a type with multiple of the same type for arity
such as a function mapping to itself 'a => 'a
instantiation "fun" :: (type ,type) instead instantiates for 'a => 'b.

view this post on Zulip Lukas Stevens (May 02 2024 at 09:16):

I think this is not possible. You could define a type for endofunctions (i.e. functions with type 'a => 'a) using typedef and then instantiate your typeclass for this type.

view this post on Zulip irvin (May 07 2024 at 11:16):

Thanks for your reply. I managed to do it manually using ML using Class.instantiation is there any reason for this behavior in the isar cmd?

view this post on Zulip irvin (May 07 2024 at 18:02):

wait nvm i just realized I didnt manage to succeed with doing it in ML :oh_no:


Last updated: May 19 2024 at 01:13 UTC