coconut
coconut copied to clipboard
Simple, elegant, Pythonic functional programming.
There is currently this package: https://github.com/enilsen16/language-coconut . But its very outdated as it supports only version 0.2.0. It would be nice to have proper coconut support in Atom.
Brand new to Coconut and already loving it. I'm currently taking a numerical analysis class where we are required to do all our homework in Python while using LaTeX. I...
I have this code which compiles and runs fine: ``` data TimeInterval(fromHour:float, toHour:float, weekFactor:float = 7./7.): pass ``` Is compiled to Python code: ``` class TimeInterval(_coconut_NamedTuple("TimeInterval", [("fromHour", 'float'), ("toHour", 'float'),...
Potentially only for dotted function definition, but ideally for standard method definition as well.
The new version of `@recursive` would: 1. enable TRE even when `--no-tco` is in effect, and 2. disable the "if function is still function" check in the rewritten code. Thus,...
Instead of `_coconut_something`, we could try just `_something` or even `_s`, but would have to be careful to only do so if that variable name was never used anywhere else.
Syntax should be ``` meta : ``` which should have its `` run and then compiled to ``` parse(lhs + " = " + ascii(rhs)) ```
We should translate ```python def func($1): $2 @addpattern(func) def func($3): $4 ``` into ```python def func(*args, **kwargs): kwargs_ = kwargs.copy() match_args_kwargs $1: $2 return None kwargs = kwargs_ match_args_kwargs $3:...
When Coconut sees `for x in enumerate`, it should use `_coconut.enumerate`, not `_coconut_enumerate`.
Coconut being a language, it would be nice if it included some standard monadic types such as Maybe and Result/Either. If not I might create such a library. What do...