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

Official support for views #301

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

Official support for views #301

wants to merge 14 commits into from

Conversation

ldionne
Copy link
Member

@ldionne ldionne commented Sep 28, 2016

The goal of this PR is to officially support views, which are only experimental right now.

Still left to do:

  • Move view types out of the experimental namespace, perhaps into detail
  • Consider providing access to the flattened methods & al. (not at first)
  • Test nested views
  • Add examples
  • Document views in the tutorial (requires some rewording of the sections on containers and on algorithms)
  • Provide operators (not at first)
  • Provide a non-dummy implementation of hana::equal (thanks @ricejasonf)
  • Provide a non-dummy implementation of hana::ap (thanks @ricejasonf)
  • Consider providing a filtered_view (not at first)

@ricejasonf
Copy link
Collaborator

ricejasonf commented Jul 1, 2017

I have a PR for equal, and I'd like to do ap as well. It appears that detail::cartesian_product_indices provides an interface that should make that easy to implement. A cartesian_product view looks pretty easy with that as well.

@ldionne
Copy link
Member Author

ldionne commented Dec 2, 2017

I'm striking a few things that I marked as being required to ship this PR. Given my lack of time to work on Hana (very sadly), I'm going to go for a minimal implementation for the sake of shipping this. This PR is important and it has been sitting around for way too long.

@ricejasonf
Copy link
Collaborator

I didn't actually do ap yet, but it should be trivial now.

I could help with tests too if that is welcome.

@ldionne
Copy link
Member Author

ldionne commented Dec 2, 2017

I think the tests for ap are okay, what I'm mostly concerned about is tests for the rest of the functionality. For example, filter should work currently because view_tag implements MonadPlus, but I'm fairly confident it won't work properly (either compilation error or dangling reference) based on looking at how single_view is implemented.

So yeah, I'd welcome help on making the tests more robust. I'm happy to tackle the documentation side.

  - All views should use `view_storage` so there can't be
    dangling references to view objects when composing views.
  - Adds use of `view_storage` in `identity_view` and `single_view`
@ricejasonf
Copy link
Collaborator

ricejasonf commented Jan 3, 2018

Are we going to make the views Sequence or is that some kind of violation?

(can't remember if I already asked this)

@ldionne
Copy link
Member Author

ldionne commented Jan 4, 2018

They can't be Sequences because there's no way to make them from a pack of elements. In other words, they don't have storage like a Container, and Sequence requires that (actually Sequence might be better named Container, since it reflects element ownership).

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.

2 participants