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

DietMap #66

Open
velvia opened this issue Oct 26, 2016 · 8 comments
Open

DietMap #66

velvia opened this issue Oct 26, 2016 · 8 comments
Milestone

Comments

@velvia
Copy link

velvia commented Oct 26, 2016

I found Diet, which seems quite nice, but I'm particularly interested in a DietMap, which would allow you to store values associated with each range.

dietMap.addRange((1, 10), myCaseClass)
def intersection(range): Seq[V]
@anicolaspp
Copy link
Contributor

I could add dietmap[A,B] to store items of type B associated with ranges of type A. I dont think it is a problem. I just need other things committed first.

@anicolaspp
Copy link
Contributor

anicolaspp commented Feb 13, 2017

@stew I am going to start working on this. The interesting part is merging two nodes. Each Node needs the Range and and elements in the range. I am thinking on using shapeless to do this since we don't need to fix a type A. A Node could potentially look like this:

case class Node[A <: HList, B](range: Range[B], item: A)

in other words, we could do something like this:

Node(Range(10, 20), 5 :: HNil) + 
Node(Range(8, 18, "Hello" :: HNil)

will result in:

Node(Range(9, 20), 5 :: "Hello" :: HNil)

What do you think?

Will that work for you @velvia?

@stew
Copy link
Contributor

stew commented Mar 13, 2017

I think that it should require a Semigroup on A instead of using an HList

@anicolaspp
Copy link
Contributor

That will work too. I will look into it

@anicolaspp
Copy link
Contributor

@velvia I have done this and open #94 make sure you look at the commit message to see how to use it.

@velvia
Copy link
Author

velvia commented Jun 22, 2017 via email

@larsrh larsrh added this to the Backlog milestone Sep 24, 2018
@anicolaspp
Copy link
Contributor

@larsrh I am back to write some code for this project. I would like to resubmit some of my old PRs. between @stew and I wrote most of the structures here and I would like to continue with it.

@larsrh
Copy link
Contributor

larsrh commented Oct 8, 2018

That's great! I'd be happy to take a look at them.

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

No branches or pull requests

4 participants