These are chat archives for evhub/coconut

21st
Mar 2017
Julian Ospald
@hasufell
Mar 21 2017 10:01
Why does this not work:
(fmap..fmap)((x) -> x + 1)$([[1],[2]])
( ꒪﹃ ꒪)
@suzukna
Mar 21 2017 13:41
Hi! Can I use type hinting in coconuts?
Anders Nygren
@litemerafrukt
Mar 21 2017 13:47
Yes, and you can tell the compiler to check with --mypy
( ꒪﹃ ꒪)
@suzukna
Mar 21 2017 13:56
@litemerafrukt Thank you!
And I have another question, can coconut compile to Cython?
Anders Nygren
@litemerafrukt
Mar 21 2017 14:03
np :smile: I don´t know much about Cython, but since Coconut compiles down to python any further step from there should work.
( ꒪﹃ ꒪)
@suzukna
Mar 21 2017 14:10
@litemerafrukt I see. Thank you for your reply. I like coconut😍 . I will more like when coconut could compile to Cython.
Evan Hubinger
@evhub
Mar 21 2017 19:05
@rkchif If you want to get Cython constructs like cdef into the compiled code, you'll to use code passthrough. If you then run the compiled code through Cython, it should work.
Evan Hubinger
@evhub
Mar 21 2017 19:11

@hasufell Translating your example,

(fmap..fmap)(x -> x+1)$([[1], [2]])

is equivalent to

fmap(fmap(x -> x+1))$([[1], [2]])

which is not what you want. Instead, you should do

[[1], [2]] |> fmap$(fmap$(x->x+1))

which is equivalent to

fmap(fmap$(x -> x+1), [[1], [2]])

which is what you want.