🤔 Should Python Devs Use Monads?

preview_player
Показать описание


#arjancodes #softwaredesign #python
Рекомендации по теме
Комментарии
Автор

Check the related link for a full video on this topic!

ArjanCodes
Автор

requests + monads is good combo for error handling of http communication

TomTrval
Автор

I don’t know what Maybe does and I just remember that monad meme. “A monad is a monoid in the category of endofunctors” so like endofunctor means it returns itself..? I forget tbh I never actually learned category theory

darcash
Автор

I've been frustratingly trying to cram monads into languages "where they don't belong" for a year or so now. ;)

edgeeffect
Автор

I think it's an overkill to install a library just for a Maybe type. Python does have similar types like Optional type, albeit it is not based on the symmetric monoidal category (Monads), but you can still work with it. I think the program should be written in the most canonical form that is universally acceptable by the community.

At the end of the day it really depends on what kind of program you are writing. If you are writing for yourself, then write is however you please but if you are contributing to a large project, then it's probably a good idea to follow a standard that is canonical to the group.

ujjawalsinha
Автор

Use it for things where we have lot of nesting objects (device, port in device, device connected in those ports and port in them and the cycle goes on). So instead of putting lot of None check I use returns Maybe monads.

debakarr
Автор

I think Python developers use Monads all the time. Take list comprehension for example, it's really is a syntactic sugar on `bind` method on list.

ujjawalsinha