Fantasy-land: Strong

Created on 26 Oct 2017  路  6Comments  路  Source: fantasyland/fantasy-land

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.

enhancement

Most helpful comment

I'm an atheist and not involved in Church encoding.

-- Scott

All 6 comments

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:

2017-10-27-070919_391x140_scrot

Scott:

2017-10-27-070926_334x108_scrot

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dmitriz picture dmitriz  路  14Comments

framp picture framp  路  16Comments

safareli picture safareli  路  16Comments

davidchambers picture davidchambers  路  9Comments

ascartabelli picture ascartabelli  路  11Comments