Skip to content

<**> and lift2 #41

Answered by j-mie6
mihneagogu asked this question in Q&A
Jan 25, 2021 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

Yeah, val mulParser = intParser1 <**> intParser2.map(intMul) will do the trick, but you probably want to define:

val intMul = (y: Int) => (x: Int)  => x * y

So that the arguments are reversed, that way it correctly models what you had with the lift2: obviously, for an associative operation like * it doesn't actually matter.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@j-mie6
Comment options

Answer selected by j-mie6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants