Zulip Chat Archive

Stream: lean4

Topic: Alias for many instance implicits


Alex Sweeney (Oct 09 2023 at 03:07):

I have a few functions with 4 instance implicits because I do arithemtic on α. Is there a shorthand for this? I tried creating a new class AddSubMulDiv but I can't figure out how to make it inherit or alias the 4 classes.

def step [Add α] [Sub α] [Mul α] [Div α] (...) where ...

Kevin Buzzard (Oct 09 2023 at 06:21):

extend them and it should work fine.

Sebastian Ullrich (Oct 09 2023 at 07:15):

docs4#Lean.Parser.Command.classAbbrev registers instances in both directions


Last updated: Dec 20 2023 at 11:08 UTC