Skip to content

Conversation

@ilario-pierbattista
Copy link
Contributor

Hi @widmogrod I've noticed that the implementation I proposed in #100 throws a type error with IO monads.

This PR consists in two commits.

  1. the test to highlight the problem
  2. the fix

Thanks

liftM2 throws a type error when it's used with IO monads. This commit contains the test to highlight that.
Copy link
Owner

@widmogrod widmogrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grate job!

@widmogrod
Copy link
Owner

I see that there is an issue with similar blocks of code, this is linter issue, so I would like you add code comments that instrument linter that this is OK for those two methods to have the same signatures.

image

@ilario-pierbattista
Copy link
Contributor Author

I realized now that liftM2 could simply call liftA2 behind the scenes.

I've never understood why there are two functions doing almost the same thing. Then I discover that liftM2 is much older than liftA2

@widmogrod widmogrod merged commit 34ed870 into widmogrod:master Jun 20, 2020
@ilario-pierbattista ilario-pierbattista deleted the ilario-pierbattista-liftm2-not-working-with-io branch June 20, 2020 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants