{"action":"created","issue":{"url":"https://api.github.com/repos/ldionne/hana/issues/105","labels_url":"https://api.github.com/repos/ldionne/hana/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/ldionne/hana/issues/105/comments","events_url":"https://api.github.com/repos/ldionne/hana/issues/105/events","html_url":"https://github.com/ldionne/hana/issues/105","id":88010956,"number":105,"title":"[Design][Documentation] Concepts do not convert from one to the other","user":{"login":"viboes","id":721225,"avatar_url":"https://avatars.githubusercontent.com/u/721225?v=3","gravatar_id":"","url":"https://api.github.com/users/viboes","html_url":"https://github.com/viboes","followers_url":"https://api.github.com/users/viboes/followers","following_url":"https://api.github.com/users/viboes/following{/other_user}","gists_url":"https://api.github.com/users/viboes/gists{/gist_id}","starred_url":"https://api.github.com/users/viboes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viboes/subscriptions","organizations_url":"https://api.github.com/users/viboes/orgs","repos_url":"https://api.github.com/users/viboes/repos","events_url":"https://api.github.com/users/viboes/events{/privacy}","received_events_url":"https://api.github.com/users/viboes/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-06-13T14:15:30Z","updated_at":"2015-06-13T20:51:15Z","closed_at":null,"body":"In http://ldionne.com/hana/structboost_1_1hana_1_1Foldable.html it is written that \r\n\r\n    any Foldable can be converted to a Sequence\r\n\r\nDo you mean that any instance/model  of Foldable can be seen as an instance+model of a Sequence? \r\n\r\nThe function `to<Tuple>` e.g. is a function from concrete models to a concrete model.\r\nDo we really need to make this conversion to be able to see a Foldable as a Sequence?\r\n\r\nI suggest to reword this kind of descriptions.\r\n"},"comment":{"url":"https://api.github.com/repos/ldionne/hana/issues/comments/111751897","html_url":"https://github.com/ldionne/hana/issues/105#issuecomment-111751897","issue_url":"https://api.github.com/repos/ldionne/hana/issues/105","id":111751897,"user":{"login":"ldionne","id":700834,"avatar_url":"https://avatars.githubusercontent.com/u/700834?v=3","gravatar_id":"","url":"https://api.github.com/users/ldionne","html_url":"https://github.com/ldionne","followers_url":"https://api.github.com/users/ldionne/followers","following_url":"https://api.github.com/users/ldionne/following{/other_user}","gists_url":"https://api.github.com/users/ldionne/gists{/gist_id}","starred_url":"https://api.github.com/users/ldionne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldionne/subscriptions","organizations_url":"https://api.github.com/users/ldionne/orgs","repos_url":"https://api.github.com/users/ldionne/repos","events_url":"https://api.github.com/users/ldionne/events{/privacy}","received_events_url":"https://api.github.com/users/ldionne/received_events","type":"User","site_admin":false},"created_at":"2015-06-13T20:51:14Z","updated_at":"2015-06-13T20:51:14Z","body":"> In http://ldionne.com/hana/structboost_1_1hana_1_1Foldable.html it is written that\r\n> \r\n> any Foldable can be converted to a Sequence\r\n> Do you mean that any instance/model of Foldable can be seen as an instance+model of a Sequence?\r\n\r\nNo. What I mean is precisely that any object which is a model of the `Foldable` concept can be converted to a new object which is a model of the `Sequence` concept. Like it is written in the documentation, for a `Foldable` object `xs` with a linearization of `[x1, ..., xn]` and a `Sequence` tag `S`, \r\n\r\n```c++\r\nto<S>(xs) == make<S>(x1, ..., xn)\r\n```\r\n\r\n\r\n\r\n> The function to<Tuple> e.g. is a function from concrete models to a concrete model.\r\n\r\nI don't understand what you mean. `to<Tuple>` is a function from any `Foldable` (the concept) to a `Tuple` (the concrete model).\r\n\r\n> Do we really need to make this conversion to be able to see a Foldable as a Sequence?\r\n\r\nYes, since `Sequence` is a more refined concept than `Foldable`. For example, it makes sense to compute all the permutations of a `Tuple`, but it does not make sense to compute the permutations of a `Range`, since the result can't be expressed as a `Range`. What you can do, however, is perform a lossy conversion from `Range` to `Tuple`, and then use this as a `Sequence`, which it is indeed.\r\n\r\nSaying that we could see any `Foldable` as a `Sequence` without explicit conversion is like saying that a `std::optional` is a boolean (so we should define `&&` and `||`), simply because it can be converted to a `bool`. The right way is to perform a lossy conversion to `bool` first, and then do whatever you want.\r\n\r\n> I suggest to reword this kind of descriptions.\r\n\r\nI reworded this description, although I honestly found it pretty clear. If you have other examples of descriptions you find unclear, please let me know.\r\n"}}