Skip to content

Add ifst and isnd#389

Merged
phadej merged 1 commit intomasterfrom
ifocus
Jan 27, 2021
Merged

Add ifst and isnd#389
phadej merged 1 commit intomasterfrom
ifocus

Conversation

@phadej
Copy link
Copy Markdown
Contributor

@phadej phadej commented Jan 6, 2021

No description provided.

@phadej
Copy link
Copy Markdown
Contributor Author

phadej commented Jan 6, 2021

The name focus comes from, so maybe more correct name would ifocused (c.f. itraversed).

-- (Actually, AffineTraversable, and Traversable1 would be more correct superclasses, if also existed).
class Traversable t => Singleton t where
    focus :: Functor f => (a -> f b) -> t a -> f (t b)

A name I invented just today, so I'm not (yet) attached to it.

https://oleg.fi/gists/posts/2018-05-12-singleton-container.html uses peekaboo :)


Is there a word for going to an amusement park, with only one decent ride, get on it, and then go home?

@arybczak
Copy link
Copy Markdown
Collaborator

arybczak commented Jan 8, 2021

ifocus is a very generic name 🤔 I take it lens doesn't have this?

Maybe ipaired?

Or isecond? Then we can also add ifirst.

@phadej
Copy link
Copy Markdown
Contributor Author

phadej commented Jan 8, 2021

ifst and isnd would make sense. (first is slightly too overloaded). Also they are about as short as _1 and _2.

@arybczak
Copy link
Copy Markdown
Collaborator

arybczak commented Jan 8, 2021

Sounds good 👍

@phadej phadej requested a review from arybczak January 8, 2021 17:20
@phadej phadej changed the title Add ifocus Add ifst and isnd Jan 8, 2021
@phadej
Copy link
Copy Markdown
Contributor Author

phadej commented Jan 9, 2021

@adamgundry are you fine with this?

Copy link
Copy Markdown
Member

@adamgundry adamgundry left a comment

Choose a reason for hiding this comment

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

Seems fine to me. Sorry for the latency.

@phadej phadej merged commit b74a1f7 into master Jan 27, 2021
@phadej phadej deleted the ifocus branch January 27, 2021 00:20
@phadej
Copy link
Copy Markdown
Contributor Author

phadej commented Jan 27, 2021

@adamgundry no worries. As long as you find time to discuss breaking changes, there is no problem delaying things like this. :)

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