Zulip Chat Archive

Stream: Is there code for X?

Topic: Equivalent to Haskell's hoistMaybe


Chris Henson (Nov 15 2024 at 13:46):

Does this definition:

def hoistOption [Monad m] : Option T  OptionT m T := OptionT.mk  pure

exist somewhere already, or is there a more idiomatic way to write this in Lean?

Eric Wieser (Nov 15 2024 at 13:50):

I asked about this before here

Chris Henson (Nov 15 2024 at 13:56):

Eric Wieser said:

I asked about this before here

That's helpful, thanks! I tend to agree with you that it is nice to lift so long as it doesn't create any typeclass inefficiency problems.


Last updated: May 02 2025 at 03:31 UTC