question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unify/throw away lmap and rmap

See original GitHub issue

I will start quoting what many bloggers states about Profunctors:

A Profunctor is just a bifunctor that is contravariant in the first argument and covariant in the second.

So, if I have a type that is both a Contravariant and a Functor (covariant) at the same time, that type is a Profunctor where rmap is map and lmap is contramap.

If so, do we need that duplication?

In principle looks like we can safely throw away the LMap and RMap invokables, then we can define lmap and rmap as aliases of contramap and map respectively.

Or we can go even further and throw away lmap and rmap.

Also we can shorten contramapto cmap as they did in Purescript.

Finally (this might be a separate issue but let’s include it here) we can argue the same for Bifunctor’s second and map.

Any thoughts?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
gustycommented, Mar 2, 2018

It’s been a long time thinking about unifying second and map.

At the moment, my thoughts converge in the direction that there will not be a function third. Actually first implies firstOf2 and second secondOf2.

When dealing with more that 2, we use different names, similarly to the naming in tuples, functions available are only fst and snd but for more than that we use itemX, same here. We already have ItemX and MapItemX Invokers.

So we can go ahead and unify them, making map and second aliases.

0reactions
gustycommented, Feb 4, 2018

Cool, I have the feeling that these abstractions are more unfamiliar to F-Sharpers so they need probably more docs and examples.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Light passing through mesh at seams
I bought these cliff sides off the asset store. It seems that light passes through the mesh at the seams or sharp angles....
Read more >
Unity lightmap shadow bleed artifacts - YouTube
Unity 3D | GPU Baking Light Maps With Bakery. Polycarbon Games•3.8K views ... How to Fix Light Map Baking Artifacts in Unity URP....
Read more >
Manual: Mesh Renderer component
On, This Renderer casts a shadow when a shadow-casting Light shines on it. ... or a quad can cast shadows, even if the...
Read more >
Null Reference Exceptions
A NullReferenceException happens when you try to access a reference variable that isn't referencing any object. If a reference variable isn't referencing an ......
Read more >
Our cookies
Every 3 metre square of the world has been given a unique combination of three words. Used for e-commerce and delivery, navigation, emergencies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found