These are chat archives for evhub/coconut

22nd
Jun 2018
Evan Hubinger
@evhub
Jun 22 2018 03:11
@asmodehn Import hooks will work on all Python versions, just like Coconut does.
@anthony-khong That's awesome; I'd love to hear about it!
@balajeerc You might be interested in coconut-prelude, which has a nice Either implementation.
@acdimalev Using __join__ is fine, that's what coconut-prelude does. The only reason not to use a dunder (double-underscore) name is if it conflicts with one being used by Python/Coconut, which it doesn't.
@yggdr You need to make sure you're using addpattern with pattern-matching functions not normal functions. Since both of your func definitions are just standard Python syntax, they raise TypeError instead of MatchError, and thus addpattern doesn't work on them. Just use match def instead of def to fix the issue. I should probably be more clear about this in the documentation, so raising an issue with this would be much appreciated.
balajeerc
@balajeerc
Jun 22 2018 03:39
@evhub Oh wow. Thanks. Could not find mention of coconut-prelude in documentation.
'jamin
@acdimalev
Jun 22 2018 05:04
Ah, cool! Giving that a look.
yggdr
@yggdr
Jun 22 2018 11:05
@evhub ah, thank you, that works just fine :) And I finally have an example where match def is necessary