These are chat archives for evhub/coconut

Dec 2016
Eshan Singh
Dec 04 2016 12:35
@evhub Ok, so as long as we're on the same page, I'm OK with it. I think, if your goal is to simply make it easier to use MyPy, we can use type annotations like this:
def add_str_to_int(x: str, y: int) -> int:
    x_num: int = int(x)
    return x_num + y
Eshan Singh
Dec 04 2016 12:41
However, I would like to make a final case here. I don't want to add full fledged Haskell type system at all (in fact, the exact type system used in Haskell is impossible to do in a language like Python). Nor do I want this to become a forefront of the language. The static typing can be made approachable like I showed above while adding power user features that can be used by the FP programmers that want it. I was imagining the use of monads and ADTs and other stuff without interfering with this beginner-friendly, approachable type system. I respect @evhub's thinking, though, and it makes sense in most ways. Up to him.
Basically, if you're introducing Coconut and/or FP to another programmer, I don't think ADTs and type classes and stuff need to be mentioned. Like in Python, there are many advanced features such as decorators and meta classes, but we don't mention these to a beginner, and the features are sufficiently hidden that they don't interfere with the approachability of the language.