Open puffnfresh opened 7 years ago
Is Scott encoding same as Church encoding? if not what's the difference
I'm an atheist and not involved in Church encoding.
-- Scott
@safareli there's an awesome paper on this:
https://ifl2014.github.io/submissions/ifl2014_submission_13.pdf
Church:
Scott:
The occurrences of Tuple and Either should be Scott-encoded so we don't have to directly specify data types.
I think using an object encoding is more appropriate for JavaScript. See my comment here for a rationale.
@puffnfresh for non recursive data types both Church and Scott encoding would be same right?
I'd love to see Scott encoded ADTs in FL. Javascript has multi argument functions, so products are for free.
@safareli Yes, both are implemented as continuations. Scott uses functional pattern matching (uncons) to deconstruct recursive types, whereas Church uses a catamorphism (foldr). As a result Scott has explicit recursion (at the type and value level) and Church implicit.
Instead of Arrow (#273) we should have Strong Profunctor. It probably makes sense to do Choice Profunctor with this.
The occurrences of Tuple and Either should be Scott-encoded so we don't have to directly specify data types.