These are chat archives for evhub/coconut

26th
Aug 2016
Philip Hunt
@cabalamat
Aug 26 2016 15:02
Is it intended to add Haskell-style types to Coconut? Part of the reason I ask is that I find Haskell's type syntax clearer and easier to understand than mypy's, for example, Haskell:
Haskell:
myMap :: (a->b) -> [a] -> [b]
mypy:
A = typevar('A')
B = typevar('B')
def myMap(f: Callable[[A], B], xs: List[A]) -> List[B]:
Evan Hubinger
@evhub
Aug 26 2016 17:26
@cabalamat Definitely a good idea--I'm a huge fan of Haskell's type system myself! We're working on trying to integrate Coconut with MyPy more tightly right now in #121, which is currently blocked on MyPy fixing a breaking bug but once that's done, which is slated for inclusion in the next MyPy release, we'll be able to work on making Coconut work really nicely with MyPy. If you'd like, it would be great if you could leave a comment on #121 with the same sort of description you have here for adding that feature.
Chuck Daniels
@chuckwondo
Aug 26 2016 19:38
@evhub Is there any way to pipe arguments to the beginning of a function call rather than to the end? For example, I’d like to create a partial function by setting some keyword args, but pipe the positional args to the function.
Evan Hubinger
@evhub
Aug 26 2016 20:45
I think this does what you want?
(pos_arg_1, pos_arg_2) |*> some_func$(keyword_1=arg_1, keyword_2=arg_2)
Chuck Daniels
@chuckwondo
Aug 26 2016 21:00
Yes, perfectly. I don’t know why I thought that wouldn’t work :-)