<@U924YEYTD> months ago i played with Free... And,...
# arrow
p
@Egor Trutenko months ago i played with Free... And, i wrote this 2 GIST https://gist.github.com/PhBastiani/26d8734ff33001cb0304df337ea936a1 https://gist.github.com/PhBastiani/a68dadf73da3050f9e4e46fbe981f6da Thx to @Jannis pointed me out a type safe solution using a simple ADT... Feedback are wellcome
@raulraja: my GISTs are now public. If you still want to integrate these documents in any form whatsoever in the Arrow doc ... there is no problem: but those are not documentation/tutorials!
r
@PhBastiani Those are awesome and would make a lot more sense to have in the docs than this placeholder crap https://arrow-kt.io/docs/free/free/
e
Oh, this is actually great! I just myself wanted to write some docs
r
Regarding casting in the ADTs, @elizarov pointed out in some other example that if you use the
A
type parameter a an abstract member of the ADT wherever it makes sense then the compiler will make sense out of it and you wouldn’t need to cast.
p
Ok, I will check this solution👌
j
That is actually a really good idea ^^. Although I like cps style a bit more, not that it makes a huge difference, just feels more flexible 😄
p
Make sense for a common GADT... but, how to have a Free algebra ? The cps solution solves the type checking... but, it is more verbose!
j
That complexity only shows up in the interpreters and not the actual program right? Because the actual programs will only use the extension methods that have the continuation partially applied already. So the vast majority of code will not see this complexity
p
No more complex for me... But, at first reading, the mapping to <A> with the Id fun is disturbing !