[Haskell-cafe] Module name space question

2011-12-12 Thread Christoph Breitkopf
Hi,

I recently asked about what interfaces to implement for a new data type.
Following the rule that the last 10% of work take the second 90% of time,
some other questions have come up.

If anyone wants to look at the code in question:
http://www.chr-breitkopf.de/comp/IntervalMap

Some time ago, I was looking for a data structure to search in sets of
possibly
overlapping intervals, and found only Data.SegmentTree, which did not fit
my needs
(nice term for I did not understand the type signatures).

So I started to roll my own IntervalMap implementation. But yesterday I used
Hayoo instead of Hoogle for the first time, and found
Data.IntervalMap.FingerTree.
This has an Interface that I _do_ understand, and, while slightly different
from my
aims (depite the name, it seems more like a multi-map and does not offer
lookup
of specific keys), it raises some tasks/questions:

Tasks: Benchmark against my implementation, and maybe scrap own if it
performs worse.

And questions:

1. Why doesn't Hoogle find this?

2. Module name space pollution

I would have been so bold to name my module Data.IntervalMap. Now, since
even
Ross Patterson uses a submodule name instead, what is the accepted practice?
If I decide to release my class after all, what should be the name?
Data.IntervalMap.RedBlackTree ? Or even
Data.IntervalMap.MyDomaindNameOrSomething.
An I even have a module Data.IntervalMap.Interval, so if Ross had decided
to put
his Interval type into a separate module, even FingerTree vs RedBlackTree
would not
have prevented a name clash.

3. Are there more wothwile operations on this data structure?

Data.IntervalMap.FingerTree has 'dominators', which I missed.
A function to extract the interval with the largest endpoint might be
useful, too.
Any more ideas?

TIA,

Chris
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Module name space question

2011-12-12 Thread John Lato
 From: Christoph Breitkopf chbreitk...@googlemail.com

 Hi,

 I recently asked about what interfaces to implement for a new data type.
 Following the rule that the last 10% of work take the second 90% of time,
 some other questions have come up.

 If anyone wants to look at the code in question:
 http://www.chr-breitkopf.de/comp/IntervalMap

 Some time ago, I was looking for a data structure to search in sets of
 possibly
 overlapping intervals, and found only Data.SegmentTree, which did not fit
 my needs
 (nice term for I did not understand the type signatures).

I can't answer any of your specific questions, although I've published
a related structure in the splaytree package
(http://hackage.haskell.org/package/splaytree).  The interface is
minimal, although it suits my needs and I'd be happy to extend it if
someone else found it worthwhile.

The difference between my data structure (which I've called a
RangeSet) and a standard IntervalSet is that overlapping ranges are
combined, and if part of a range is deleted, the affected range is
modified and possibly split e.g.

 let set1 = singleton $ range 0 5
  set2 = insert (range 2 5) set1

after this, set2 has one node representing the range 0-7.

Staying on topic, my package puts everything under
`Data.SplayTree.xxx`, which is different from the fingertree package
organization.  AFAICT the selection of one convention over the other
is fairly arbitrary, although more packages seem to use the one
second-level hierarchy structure (e.g. bytestring, text, containers).

John L.

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Module name space question

2011-12-12 Thread Ryan Newton
I don't know why Hoogle didn't find one of the packages.  I've often
wondered about this related question:

   * Is there a place to browse the union of all namespaces in all hackage
packages?

This would show the global Haskell/Hackage  namespace as it currently
stands and I think would be useful for a number of different purposes.

  -Ryan

On Mon, Dec 12, 2011 at 8:10 AM, Yitzchak Gale g...@sefer.org wrote:

 Christoph Breitkopf wrote:
  If anyone wants to look at the code in question:
  http://www.chr-breitkopf.de/comp/IntervalMap

 Looks interesting, thanks!

  3. Are there more wothwile operations on this data structure?

 Have a look at ranged sets:

 http://hackage.haskell.org/package/Ranged-sets

 Perhaps that will inspire you with some more ideas.

 Regards,
 Yitz

 ___
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Module name space question

2011-12-12 Thread wren ng thornton

On 12/12/11 9:32 AM, Ryan Newton wrote:

I don't know why Hoogle didn't find one of the packages.  I've often
wondered about this related question:

* Is there a place to browse the union of all namespaces in all hackage
packages?


There is, and it's awesome:

http://folk.ntnu.no/hammar/explore-hackage/

Though it can be a bit slow to load, so try not to hammer the server too 
hard :)


--
Live well,
~wren

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Module name space question

2011-12-12 Thread Alejandro Serrano Mena
You can try the Haskell Browser in the Eclipse plug-in.

2011/12/12 wren ng thornton w...@freegeek.org

 On 12/12/11 9:32 AM, Ryan Newton wrote:

 I don't know why Hoogle didn't find one of the packages.  I've often
 wondered about this related question:

* Is there a place to browse the union of all namespaces in all hackage
 packages?


 There is, and it's awesome:


 http://folk.ntnu.no/hammar/**explore-hackage/http://folk.ntnu.no/hammar/explore-hackage/

 Though it can be a bit slow to load, so try not to hammer the server too
 hard :)

 --
 Live well,
 ~wren


 __**_
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Module name space question

2011-12-12 Thread Michael Craig
 There is, and it's awesome:


 http://folk.ntnu.no/hammar/**explore-hackage/http://folk.ntnu.no/hammar/explore-hackage/

 Though it can be a bit slow to load, so try not to hammer the server too
hard :)

Awesome indeed! Can we convince Andreas to have it update regularly? Looks
like the last update was in May.

Mike S Craig


On Mon, Dec 12, 2011 at 3:45 PM, wren ng thornton w...@freegeek.org wrote:

 On 12/12/11 9:32 AM, Ryan Newton wrote:

 I don't know why Hoogle didn't find one of the packages.  I've often
 wondered about this related question:

* Is there a place to browse the union of all namespaces in all hackage
 packages?


 There is, and it's awesome:


 http://folk.ntnu.no/hammar/**explore-hackage/http://folk.ntnu.no/hammar/explore-hackage/

 Though it can be a bit slow to load, so try not to hammer the server too
 hard :)

 --
 Live well,
 ~wren


 __**_
 Haskell-Cafe mailing list
 Haskell-Cafe@haskell.org
 http://www.haskell.org/**mailman/listinfo/haskell-cafehttp://www.haskell.org/mailman/listinfo/haskell-cafe

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe