Skip to content

Add ReaderT#ask - #119

Merged
jnape merged 2 commits into
palatable:masterfrom
7h3kk1d:readert-ask
Mar 11, 2022
Merged

Add ReaderT#ask#119
jnape merged 2 commits into
palatable:masterfrom
7h3kk1d:readert-ask

Conversation

@7h3kk1d

@7h3kk1d 7h3kk1d commented Feb 21, 2022

Copy link
Copy Markdown
Member

I'm still not sure this is the right thing to add since it's so easy to pass pure#apply at the call site. It might be better to have an interface method on MonadReader so you don't need to pass the pure.

Comment on lines +216 to +217
//noinspection Convert2MethodRef
return readerT(a -> pureM.apply(a));

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also I'm not sure why this was necessary to make it compile under java 1.8.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, pretty unfortunate. You can ascribe the type of the apply or the ReaderT, but either way you have to suppress a warning so dealer's choice.

Comment on lines +216 to +217
//noinspection Convert2MethodRef
return readerT(a -> pureM.apply(a));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, pretty unfortunate. You can ascribe the type of the apply or the ReaderT, but either way you have to suppress a warning so dealer's choice.

@jnape
jnape merged commit 5e73e1f into palatable:master Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants