Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add `flap` operator #59

chshersh opened this issue Aug 19, 2018 · 2 comments


2 participants
Copy link

commented Aug 19, 2018

This one:

(??) :: Functor f => f (a -> b) - a -> f b

@chshersh chshersh added the new label Aug 19, 2018

@chshersh chshersh added this to the v0.3.0: Combinators milestone Aug 19, 2018


This comment has been minimized.

Copy link

commented Sep 6, 2018

I've never seen this function before and I can't find this function anywhere, can you tell why it's needed? And why you need to make an operator? Should I implement the function first?


This comment has been minimized.

Copy link
Member Author

commented Sep 6, 2018

@vrom911 These are good points. We can have both flap and ?? operator available. I learned about this operator from this document:

For me it's mostly useful when I have a list of function and want to apply them to single element, like this:

ghci> [(+2), (*3)] ?? 5
[7, 15]

Or apply to function inside Maybe:

ghci> Just (+3) ?? 5
Just 8

I can't say that this operator is as useful as other common operators like <$>, <*>, <&>, etc. But some people like it, and it's still useful sometimes.

In the document I've send in this comment, this operator is called <@> but in Haskell world it's more popular under ?? name from lens library:

vrom911 added a commit that referenced this issue Sep 7, 2018

@chshersh chshersh closed this in #71 Sep 7, 2018

#1: JoJo's Bizarre Adventure (September, 2018) automation moved this from To do to Done: issues Sep 7, 2018

chshersh added a commit that referenced this issue Sep 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.