library sort

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
19 messages Options
Reply | Threaded
Open this post in threaded view
|

library sort

Radu Grigore
Is there a sort function in the libraries that come with GHC (6.4)? My search at
  http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
has failed, but I can't believe there is none.

--
regards,
  radu
http://rgrig.blogspot.com/

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: library sort

Bayley, Alistair
> From: [hidden email]
> [mailto:[hidden email]] On Behalf Of Radu Grigore
>
> Is there a sort function in the libraries that come with GHC
> (6.4)? My search at
>   http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
> has failed, but I can't believe there is none.

Data.List.sort (and sortBy):
http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-List.htm
l#v%3Asort
*****************************************************************
Confidentiality Note: The information contained in this message,
and any attachments, may contain confidential and/or privileged
material. It is intended solely for the person(s) or entity to
which it is addressed. Any review, retransmission, dissemination,
or taking of any action in reliance upon this information by
persons or entities other than the intended recipient(s) is
prohibited. If you received this in error, please contact the
sender and delete the material from any computer.
*****************************************************************
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

J. Garrett Morris
In reply to this post by Radu Grigore
Data.List contains

sort :: Ord a => [a] -> [a]

and

sortBy :: (a -> a -> Ordering) -> [a] -> [a]

I believe they're currently implemented using merge sort, at least in GHC.

 /g

On 2/16/06, Radu Grigore <[hidden email]> wrote:

> Is there a sort function in the libraries that come with GHC (6.4)? My search at
>   http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
> has failed, but I can't believe there is none.
>
> --
> regards,
>   radu
> http://rgrig.blogspot.com/
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>


--
We have lingered in the chambers of the sea
By sea-girls wreathed with seaweed red and brown
Till human voices wake us, and we drown.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Neil Mitchell
In reply to this post by Radu Grigore
Hi Radu,

> Is there a sort function in the libraries that come with GHC (6.4)?

import Data.List

Or just hit Hoogle with "sort"
http://haskell.org/hoogle/?q=sort

Thanks

Neil

On 16/02/06, Radu Grigore <[hidden email]> wrote:
My search at

>   http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
> has failed, but I can't believe there is none.
>
> --
> regards,
>   radu
> http://rgrig.blogspot.com/
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Cale Gibbard
In reply to this post by Radu Grigore
Yes, it's in Data.List, and called 'sort'. You can use the index (see
top right) to look for it under 'S'.
 - Cale

On 16/02/06, Radu Grigore <[hidden email]> wrote:

> Is there a sort function in the libraries that come with GHC (6.4)? My search at
>   http://www.haskell.org/ghc/docs/latest/html/libraries/index.html
> has failed, but I can't believe there is none.
>
> --
> regards,
>   radu
> http://rgrig.blogspot.com/
>
> _______________________________________________
> Haskell-Cafe mailing list
> [hidden email]
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
>
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Jared Updike
In reply to this post by Bayley, Alistair
If you need an easier way to search the Haskell APIs, use Hoogle:
   http://haskell.org/hoogle/?q=sort
You can even search by type signature.

BTW, the sort function is part of the Prelude List libraries, if you
want to see one possible implementation:
  http://haskell.org/onlinereport/list.html

  Jared.

--
http://www.updike.org/~jared/
reverse ")-:"
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Radu Grigore
On 2/16/06, Jared Updike <[hidden email]> wrote:
> If you need an easier way to search the Haskell APIs, use Hoogle:

Hoogle is very nice. Thanks to everyone who answered my question about
finding a sort library function.

--
regards,
  radu
http://rgrig.blogspot.com/

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

RE: library sort

Simon Peyton Jones
In reply to this post by Radu Grigore
Strangely, Hoogle isn't easy to find at haskell.org.  I'm not sure where
the best place to add a link would be: perhaps near the top of the
libraries-and-tools page?  It's all wikified now, so would someone like
to add it somewhere appropriate?

Simon

| -----Original Message-----
| From: [hidden email]
[mailto:[hidden email]] On Behalf Of
| Radu Grigore
| Sent: 17 February 2006 14:11
| To: Haskell Cafe
| Subject: Re: [Haskell-cafe] library sort
|
| On 2/16/06, Jared Updike <[hidden email]> wrote:
| > If you need an easier way to search the Haskell APIs, use Hoogle:
|
| Hoogle is very nice. Thanks to everyone who answered my question about
| finding a sort library function.
|
| --
| regards,
|   radu
| http://rgrig.blogspot.com/
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Sven Panne
Am Montag, 20. Februar 2006 12:46 schrieb Simon Peyton-Jones:
> Strangely, Hoogle isn't easy to find at haskell.org.  I'm not sure where
> the best place to add a link would be: perhaps near the top of the
> libraries-and-tools page?  It's all wikified now, so would someone like
> to add it somewhere appropriate? [...]

And a related question is: Which packages are searchable by Hoogle? I can't
find anything contained in my OpenGL/GLUT/OpenAL/ALUT packages. :-(

Cheers,
   S.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Neil Mitchell
> And a related question is: Which packages are searchable by Hoogle?

The best answer to that is "some". I intentionally excluded OpenGL and
other graphics ones because they have a large interface and yet are
not used by most people using Haskell.

I have recently patched Haddock so it will directly generate Hoogle
information, and am in the process of modifying  hoogle so that you
can pick which libraries or applications to search. Hopefully once
this is all done, the standard web hoogle interface will allow
searching OpenGL libraries, if the user selects that as an option -
and also allow searching other libaries/applications such as
GHC/Yhc/Darcs/Gtk2Hs as selected by the user.

Surprisingly, a large proportion of GHC gives errors after being run
over with Haddock, particularly the type directory - if someone fixed
this it would be handy :)

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Sven Panne
Am Samstag, 4. März 2006 21:30 schrieb Neil Mitchell:
> > And a related question is: Which packages are searchable by Hoogle?
>
> The best answer to that is "some". I intentionally excluded OpenGL and
> other graphics ones because they have a large interface and yet are
> not used by most people using Haskell. [...]

Well, this a bold assumption IMHO, and I'm not particularly happy with that,
as you can probably imagine. For my part, I would assume that Joe Programmer
is much more likely to use some multimedia packages than TH or Data.Graph.*
etc., but this is a bold assumption on *my* side...

> I have recently patched Haddock so it will directly generate Hoogle
> information, and am in the process of modifying  hoogle so that you
> can pick which libraries or applications to search. Hopefully once
> this is all done, the standard web hoogle interface will allow
> searching OpenGL libraries, if the user selects that as an option -
> and also allow searching other libaries/applications such as
> GHC/Yhc/Darcs/Gtk2Hs as selected by the user. [...]

Integrating with Haddock makes much sense, and perhaps we can bundle Hoogle
somehow with Haddock, so everybody can use Hoogle locally on the whole set of
packages which are installed. The current Hoogle website would then just be
an instance of that bundle. Are there any plans in this direction?

Cheers,
   S.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Neil Mitchell
> Well, this a bold assumption IMHO, and I'm not particularly
> happy with that, as you can probably imagine.

I would also imagine that Joe Programmer is more likely to use
wxHaskell or Gtk2Hs than those - however because those are outside the
standard tree they don't make it in. I don't think much of TH made it
in either (not becuase of deliberate exclusions, but because of
technical limitations in the tool).

Don't consider these choices to be a recommendation of one package
over another - or a permanent decision. I hope to make all libraries
available at some point.


> Integrating with Haddock makes much sense, and perhaps
> we can bundle Hoogle
> somehow with Haddock,
The data generation is now bundled with Haddock, and as far as I know,
will be in the next release.

Hoogle is both a website, and a command line program, so this is
already partially true that the website is just another instance.

Just to make sure everyone is clear, the near term plans for Hoogle are:

* Fix bugs (esp those relating to Monad and higher kinds)
* Add a user interface to the website to select packages
* Upload lots of packages
* Possibly performance improvements

Unfortunately I'm very busy right now, but give it a month or so and
I'll be able to devote some time to this.

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

John Hughes-4
In reply to this post by Radu Grigore

>Am Samstag, 4. März 2006 21:30 schrieb Neil Mitchell:
>  
>
>>>And a related question is: Which packages are searchable by Hoogle?
>>>      
>>>
>>The best answer to that is "some". I intentionally excluded OpenGL and
>>other graphics ones because they have a large interface and yet are
>>not used by most people using Haskell. [...]
>>    
>>
>
>Well, this a bold assumption IMHO, and I'm not particularly happy with that,
>as you can probably imagine. For my part, I would assume that Joe Programmer
>is much more likely to use some multimedia packages than TH or Data.Graph.*
>etc., but this is a bold assumption on *my* side...
>
>...
>
>>Well, this a bold assumption IMHO, and I'm not particularly
>>happy with that, as you can probably imagine.
>>    
>>
>
>I would also imagine that Joe Programmer is more likely to use
>wxHaskell or Gtk2Hs than those - however because those are outside the
>standard tree they don't make it in. I don't think much of TH made it
>in either (not becuase of deliberate exclusions, but because of
>technical limitations in the tool).
>
>  
>
When I surveyed Haskell users, I asked respondents to name the most
important tools and libraries they use. (Caveat: respondents saw the
list of tools and libraries already named, and could include these just
by selecting them, so tools mentioned early in the survey were more
likely to be named by subsequent respondents). Here are a few relevant
entries, where the percentage is the proportion of respondents who named
the tool:

29% Parsec
19% wxHaskell
16% QuickCheck
16% haddock
12% Monadic Parser Combinators
11% Gtk2Hs
9% hs-plugins
8% HaXml
7% Data.*
7% Monad foundation classes
6% Arrows
6% HOpenGL

The list includes all libraries named by more than 5% of respondents.
Sure enough, wxHaskell and Gtk2Hs are more popular, but 6% naming
HOpenGL as among the "most important" libraries is quite respectable.


John
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Sven Panne
In reply to this post by Neil Mitchell
Am Dienstag, 7. März 2006 14:24 schrieb Neil Mitchell:
> I would also imagine that Joe Programmer is more likely to use
> wxHaskell or Gtk2Hs than those [...]

Just a (hopefully final) remark about this, because the above statement seems
to imply something that is not completely true: 3 of the 4 packages I've
mentioned, i.e. OpenGL (rendering) and OpenAL/ALUT (sound) do not compete in
any way with the GUI packages mentioned above, they can be happily used with
those. And regarding the 4th package (GLUT): It very much depends on which
book you read first, lots of OpenGL books use GLUT as their GUI toolkit and
do this for a very good reason (reproducibility, widespread availibility,
ease of use for simple up to medium-sized programs etc.). For a larger
application other GUI toolkits are probably a better choice, and all of the
serious ones offer an OpenGL canvas to render on, anyway.

I just had to reply because lots of people seem to confuse GUI issues with
rendering issues, which are two completely different beasts, and this might
lead to various preconceptions.

> The data generation is now bundled with Haddock, and as far as I know,
> will be in the next release. [...]

That's good to hear. I really have to take a closer look at the current state
of the former fptools projects, but my job and the switch to darcs got in the
way...

Thanks for a really nice tool,
   S.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Sven Panne
In reply to this post by John Hughes-4
Am Mittwoch, 8. März 2006 11:25 schrieb John Hughes:

> When I surveyed Haskell users, I asked respondents to name the most
> important tools and libraries they use. (Caveat: respondents saw the
> list of tools and libraries already named, and could include these just
> by selecting them, so tools mentioned early in the survey were more
> likely to be named by subsequent respondents). Here are a few relevant
> entries, where the percentage is the proportion of respondents who named
> the tool:
>
> 29% Parsec
> 19% wxHaskell
> 16% QuickCheck
> 16% haddock
> 12% Monadic Parser Combinators
> 11% Gtk2Hs
> 9% hs-plugins
> 8% HaXml
> 7% Data.*
> 7% Monad foundation classes
> 6% Arrows
> 6% HOpenGL
>
> The list includes all libraries named by more than 5% of respondents.
> Sure enough, wxHaskell and Gtk2Hs are more popular, but 6% naming
> HOpenGL as among the "most important" libraries is quite respectable.

Well, I've never said that it is among the "most important" libraries, but
OTOH I really much doubt that the way the survey was done delivers anything
near reliable results. It heavily biases early entries, and I dare to
speculate that the people taking part in the survey were probably not even
near to a representative group, but a bunch of highly motivated, experienced
non-Joe-Programmer kind of people who are actively participating on the
mailing lists etc. Furthermore, some of the percentages above are extremely
strange, e.g. how can people use huge GUI toolkits with 30% while staying
largely away from something as fundamental as Data.*? The best we can
probably get from your survey is a rough indication what the research
community wants, but probably nothing more.

I don't claim to have a better idea how to get more reliable numbers, but I've
never trusted any web survey and probably never will.

Cheers,
   S.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Ketil Malde-3
In reply to this post by Neil Mitchell
"Neil Mitchell" <[hidden email]> writes:

>> And a related question is: Which packages are searchable by Hoogle?

> The best answer to that is "some". I intentionally excluded OpenGL and
> other graphics ones because they have a large interface and yet are
> not used by most people using Haskell.

I'm not sure I agree that is a good reason.  If there is a specificity
problem with Hoogle, that should be adressed in the interface e.g. by
providing more information about the search results, or letting the
user restrict his search (filtering out parts of the hierarchy from
the result list, for instance).

-k
--
If I haven't seen further, it is by standing in the footprints of giants

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Neil Mitchell
> I'm not sure I agree that is a good reason.
I never claimed it was a good reason, merely that it was a reason :)

Hoogle 2 only allowed you to search the Haskell 98 libraries, which
obviously everyone wants to do. Hoogle 3 is still in beta - I
introduced searching more, but have not got round to letting the user
specify what to search.

My thinking with selecting which packages are defaults in Hoogle was
roughly guided by the question "if a person is searching for this
package, would they know that they wanted that package?"

For example, when searching for "sort" the user has no expectation of
where the sort will be. However when searching for something like a
"newOpenGlContext" the user knows they are looking for a very OpenGL
function. i.e. for one they are searching "haskell" - for the other
they really just want to search opengl.

Anyway, my current plan is:
* lots of smallish packages, and one big "base" package which is the
default search
* OpenGL, wxHaskell, Gtk2Hs, Darcs, GHC API, GHC (the code base), Yhc,
Parsec will all be options to search for. At some point in the future
I will send out an offer to everyone if they want their package
included.

See what functions users really do search for, if say 5% of users add
Parsec to their searches, consider including it in the defaults.

Maybe (depending on how efficient I can make Hoogle), it can give
google style hints - "there were also 3 results in OpenGL, would you
like to add OpenGL to your search options".

Thanks

Neil
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Duncan Coutts
In reply to this post by John Hughes-4
On Wed, 2006-03-08 at 11:25 +0100, John Hughes wrote:

> When I surveyed Haskell users, I asked respondents to name the most
> important tools and libraries they use. (Caveat: respondents saw the
> list of tools and libraries already named, and could include these just
> by selecting them, so tools mentioned early in the survey were more
> likely to be named by subsequent respondents). Here are a few relevant
> entries, where the percentage is the proportion of respondents who named
> the tool:
>
> 29% Parsec
> 19% wxHaskell
> 16% QuickCheck
> 16% haddock
> 12% Monadic Parser Combinators
> 11% Gtk2Hs
> 9% hs-plugins
> 8% HaXml
> 7% Data.*
> 7% Monad foundation classes
> 6% Arrows
> 6% HOpenGL
>
> The list includes all libraries named by more than 5% of respondents.
> Sure enough, wxHaskell and Gtk2Hs are more popular, but 6% naming
> HOpenGL as among the "most important" libraries is quite respectable.

As Sven said, HOpenGL is complementary to wxHaskell and Gtk2Hs as both
of these GUI toolkits can be used with HOpenGL to draw to an OpenGL
canvas widget.

Yes, there is some overlap with GLUT, but there are times when you'd
want to use GLUT rather than one of the bigger GUI toolkits.

wxWidets examples:
http://wxhaskell.sourceforge.net/samples.html
(at the bottom of the page)

Gtk2Hs example:
http://haskell.org/gtk2hs/archives/2005/11/11/more-opengl-goodness/


Duncan

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: library sort

Sven Panne
In reply to this post by Neil Mitchell
Am Mittwoch, 8. März 2006 15:11 schrieb Neil Mitchell:
> I never claimed it was a good reason, merely that it was a reason :) [...]

:-)

> Anyway, my current plan is:
> * lots of smallish packages, and one big "base" package which is the
> default search
> * OpenGL, wxHaskell, Gtk2Hs, Darcs, GHC API, GHC (the code base), Yhc,
> Parsec will all be options to search for. At some point in the future
> I will send out an offer to everyone if they want their package
> included. [...]

In the meantime it would be great if Hoogle could be made consistent with the
documentation on http://haskell.org/ghc/docs/latest/html/libraries/ (this is
the big "base" package IMHO). Currently the differences might be quite
confusing for new people.

> Maybe (depending on how efficient I can make Hoogle), it can give
> google style hints - "there were also 3 results in OpenGL, would you
> like to add OpenGL to your search options".

That would be a great feature IMHO.

Cheers,
   S.
_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe