[Haskell-cafe] Re: The Future of MissingH

2006-11-26 Thread Max Vasin
> "Benjamin" == Benjamin Franksen <[EMAIL PROTECTED]> writes:

Benjamin> Bulat Ziganshin wrote:
>> Friday, November 24, 2006, 7:32:55 PM, you wrote:
>> Josef Svenningsson posted a comment on my blog today that got me to
>>> thinking.  He suggested that people may be "intimidated by the
>>> size of MissingH, confused by the undescriptive name, and
>>> don't quite know what's in there."  And I think he's right.
>> 
>> first, is it possible to integrate MissingH inside existing
>> core libs, i.e. Haskell libs supported by Haskell community? i
>> think that it will be impossible if MissingH will hold its GPL
>> status. i think that such fundamental library as MissingH
>> should be BSDified to allow use it both in commercial and
>> non-commercial code

Benjamin> I hate to be nitpicking but GPL is not only compatible
Benjamin> with but encourages commerce in general and commercial
Benjamin> software in particular. It is incompatible with
Benjamin> proprietary software. There's a difference.

A small addition: some GPLed libraries (libstdc++ AFAIK) allow
linking with proprietary software by adding clause to lisence
which relaxes GPL requirements.

-- 
WBR,
Max Vasin.

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


Re: [Haskell-cafe] Glade Gtk2Hs Tutorial

2006-11-26 Thread Duncan Coutts
An updated version of the Glade tutorial for Haskell & Gtk2Hs is now
available on the Gtk2Hs website:

http://haskell.org/gtk2hs/docs/tutorial/glade/

This is of course linked from the documentation page on the Gtk2Hs site:

http://haskell.org/gtk2hs/documentation/#tutorials

Thanks very much to Eddy Ahmed, the original author and to Hans van
Thiel for 'porting' the tutorial from Gtk's C API to Haskell and Gtk2Hs.


We are seeking help with writing other tutorials too, in particular an
introductory tutorial. If that's something you think you might be
interested in helping with then darcs get the Gtk2Hs sources and send in
your changes (or if you don't do darcs then email is fine). So far we
have just a quick outline:
http://haskell.org/gtk2hs/docs/tutorial/intro/

Duncan

On Sun, 2006-11-05 at 20:24 +0100, Hans van Thiel wrote:

> The Haskell Gtk2Hs adaptation of the 'Developing Gnome Apps with Glade'
> tutorial for beginners is now also on http://eddy.writelinux.com/
> Note there are translations there of the original version for C in
> French, Dutch, Spanish, Turkish and Korean. Native speakers of those
> languages who are interested could use these and check out the Haskell
> Gtk2Hs listings later.


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


Re: [Haskell-cafe] Priority Queue?

2006-11-26 Thread Mark T.B. Carroll
"Ken Takusagawa" <[EMAIL PROTECTED]> writes:

> Is there a Haskell implementation of an efficient priority queue
> (probably heap-based) out there that I can use?  I do not see it in
> the GHC libraries.

ISTR Okasaki's algorithms book has a suitable one.

-- Mark

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


Re: [Haskell-cafe] Priority Queue?

2006-11-26 Thread Ross Paterson
On Sun, Nov 26, 2006 at 04:58:13PM -0500, Ken Takusagawa wrote:
> Is there a Haskell implementation of an efficient priority queue
> (probably heap-based) out there that I can use?  I do not see it in
> the GHC libraries.

As already mentioned, there are several in Edison.  If you want to roll
your own, you can't get much simpler than Okasaki's lazy skew heaps, from
"The Fun of Programming" (the Edison version is a specialized version
of this):

data Tree a = Null | Fork a (Tree a) (Tree a)

isEmpty :: Tree a -> Bool
isEmpty Null = True
isEmpty _ = False

minElem :: Tree a -> a
minElem (Fork x a b) = x

deleteMin :: Ord a => Tree a -> Tree a
deleteMin (Fork x a b) = merge a b

insert :: Ord a => a -> Tree a -> Tree a
insert x a = merge (singleton x) a
  where singleton x = Fork x Null Null

merge :: Ord a => Tree a -> Tree a -> Tree a
merge a Null = a
merge Null b = b
merge a b
  | minElem a <= minElem b = join a b
  | otherwise  = join b a
  where join (Fork x a b) c = Fork x b (merge a c)

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


[Haskell-cafe] Re: Priority Queue?

2006-11-26 Thread Benjamin Franksen
Ken Takusagawa wrote:
> Is there a Haskell implementation of an efficient priority queue
> (probably heap-based) out there that I can use?  I do not see it in
> the GHC libraries.

Unfortunately the base package contains only the specialized Data.Sequence
and not the general annotated 2-3 finger trees, which could be easily
instantiated to an efficient priority queue.

I have a package lying around that I wrote 1 or 2 years ago that implements
the (much more complicated) search tree version of the 2-3 finger trees. I
just managed to compile it again. Can send you a tarball if you are
interested.

Ben

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


[Haskell-cafe] Re: The Future of MissingH

2006-11-26 Thread Benjamin Franksen
Bulat Ziganshin wrote:
> Friday, November 24, 2006, 7:32:55 PM, you wrote:
>> Josef Svenningsson posted a comment on my blog today that got me to
>> thinking.  He suggested that people may be "intimidated by the size of
>> MissingH, confused by the undescriptive name, and don't quite know what's
>> in there."  And I think he's right.
> 
> first, is it possible to integrate MissingH inside existing core libs,
> i.e. Haskell libs supported by Haskell community? i think that it will
> be impossible if MissingH will hold its GPL status. i think that
> such fundamental library as MissingH should be BSDified to allow use
> it both in commercial and non-commercial code

I hate to be nitpicking but GPL is not only compatible with but encourages
commerce in general and commercial software in particular. It is
incompatible with proprietary software. There's a difference.

Cheers
Ben

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


Re: [Haskell-cafe] Priority Queue?

2006-11-26 Thread Spencer Janssen

I recommend the Edison library, which has several heap implementations.

http://www.eecs.tufts.edu/~rdocki01/edison.html


Cheers,
Spencer Janssen

On Nov 26, 2006, at 3:58 PM, Ken Takusagawa wrote:


Is there a Haskell implementation of an efficient priority queue
(probably heap-based) out there that I can use?  I do not see it in
the GHC libraries.
___
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


[Haskell-cafe] Priority Queue?

2006-11-26 Thread Ken Takusagawa

Is there a Haskell implementation of an efficient priority queue
(probably heap-based) out there that I can use?  I do not see it in
the GHC libraries.
___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] The Future of MissingH

2006-11-26 Thread Dougal Stanton
Quoth Bulat Ziganshin, nevermore,
> while i personally prefer to read source code and fascinated with
> quality of code documenting in your lib, most peoples prefer to read
> Haddocks, which again should be made available on web

I just thought I should point out, cos there appears to be some
confusion on the matter, that there is a Haddock API for MissingH, which
I've found to be very informative.



As Neil Mitchell (I think) mentioned earlier it's not on a standard HTTP
port which may be unsuitable for some people.

Cheers,

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


[Haskell-cafe] Implementations of bit vectors

2006-11-26 Thread Dominic Steinitz
You could also look at http://darcs.haskell.org/crypto/Data/LargeWord.hs but 
it would need modifying to produce a 33 bit word.

Dominic.


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


Re: [Haskell-cafe] The Future of MissingH

2006-11-26 Thread Bulat Ziganshin
Hello John,

Friday, November 24, 2006, 7:32:55 PM, you wrote:

> Josef Svenningsson posted a comment on my blog today that got me to
> thinking.  He suggested that people may be "intimidated by the size of
> MissingH, confused by the undescriptive name, and don't quite know what's
> in there."  And I think he's right.

first, is it possible to integrate MissingH inside existing core libs,
i.e. Haskell libs supported by Haskell community? i think that it will
be impossible if MissingH will hold its GPL status. i think that
such fundamental library as MissingH should be BSDified to allow use
it both in commercial and non-commercial code

if library will be not BSDified it can remain as a whole or be
splitted to smaller conceptual parts (strings, file system,
logging...) but these parts should remain separate from other haskell
libs and these features can't be made, say, part of a Haskell standard

if library will be BSDified, and somewhat "advertized". i hope that
its parts will start moving to the more specific libs of core set, say
HVFS system into the Files library, logging facilities into the Unix
library, so on

next. why your library isn't well recognized. i can suggest in each
announce of new library version write the full list of its features
or at least url to such advertizing page. second, are you included
your library in HCAR and hswiki/Libraries_and_tools pages? third,
while i personally prefer to read source code and fascinated with
quality of code documenting in your lib, most peoples prefer to read
Haddocks, which again should be made available on web

next, while you accept patches to the lib, this's not declared in your
announces. best way is just to open darcs repository - most peoples
thinks that having darcs repository and accepting patches is the same
thing :)  i can also propose you the idea that Pupeno, packager of
Streams library used - he included in the tgz files copy of darcs
repository, again facilitating use of darcs and developing new patches
for library

and, about WindowsCompat.hs - stat() function is available on Windows
and even used to implement getModificationTime :)

>   I initially wrote it that way to make resolving dependencies easier
>   for end users.

now Cabal handles this

> How could greater community participation be encouraged, while still
> encouraging quality control?

>   I have received some very good contributions to MissingH from people,
>   and that's been great.  I've also received some that just aren't that
>   great -- they don't have Haddock docs, the code is opaque, they
>   don't come with unit tests, etc.  

>   But by and large, I've been maintaining it mostly myself.

i think that this is more general question for all haskell core
libraries



-- 
Best regards,
 Bulatmailto:[EMAIL PROTECTED]

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


[Haskell-cafe] Re: Optimizing a hash function

2006-11-26 Thread apfelmus
> Yesterday evening I had a go at porting Bob Jenkins' hash function
> (http://www.burtleburtle.net/bob/c/lookup3.c) to Haskell.

If you need hash functions, I hope that you don't need them to become a
hash table necromancer: this dark data structure simply does not fit
well into Haskell. Tries are a better alternative:

  Ralf Hinze. Generalizing generalized tries. Journal of Functional
  Programming, 10(4):327-351, July 2000
  http://www.informatik.uni-bonn.de/~ralf/publications/GGTries.ps.gz

Otherwise, take care to conduct hash experiments inside Otiluke's
Resilient Sphere only.

Regards,
apfelmus

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


[Haskell-cafe] re: Improving library documentation

2006-11-26 Thread brad clawsie
don, i am glad you raised this point, i was going to write a note to
this list soon with a similar request

i would suggest comparing perldoc to haddock and other haskell
documentation tools.

generally speaking, i find that documentation for perl libraries is
written as if the author is enthusiastic about users understanding it.
there are typically detailed function descriptions, and often inlined
examples. on the other hand i have found most haddock documentation to
consist merely of function signatures. as a result i have to employ
spotty supplemental references like the haskell ref at zvon.org (which i
am sure is a copy of a well-known reference set floating around out
there), which includes some examples, or google's code search with
haskell support.

furthermore, perldoc has querying capabilities (-f etc) which preclude
having to surf around references, another great feature.

regardless of format, well-written documentation will go a long way to
forwarding haskell adoption.

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


Re: [Haskell-cafe] Optimizing a hash function

2006-11-26 Thread isto
su, 2006-11-26 kello 15:12 +1100, Ivan Tomac kirjoitti:
> The first version I came up with ran 20 times slower than C.
> Thanks to Don Stewart's suggestions on IRC, I managed to improve the  
> ...

> Options used to compile the version using the hash function written  
> in Haskell:
> ghc -O -funbox-strict-fields -fglasgow-exts -fbang-patterns -cpp -o  
> test hashByteString.hs test.hs
> 
> Options used to compile the version using the hash function in C:
> ghc -O -fglasgow-exts -ffi -fbang-patterns -cpp -DCHASH -o ctest  
> ctest.c test.hs

Hi Ivan Tomac,

Have you tried -O3 -optc-O3  -funfolding-use-threshold=16 
compile flags?  Don, Lemmih, Lennart and Bulat helped me to sort
out a similar problem a couple of weeks ago. More hints can be found at
http://haskell.org/haskellwiki/Performance/GHC
Especially, to check generated code by taking a look of core
-ddump-simpl > core.txt
and to check memory leaks, you could run with
+RTS -sstderr

br, Isto

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


Re: [Haskell-cafe] Haddock question

2006-11-26 Thread Luis Cabellos

Ok, With your example I realized that I don't write the type signature
declaration of anything. Without the type Haddock don't put the
comments from code in the generated doc. Now it works.

Thanks. Luis

On 11/26/06, Donald Bruce Stewart <[EMAIL PROTECTED]> wrote:

It appears to be an error in current haddock when interacting with ghc
6.6.

If you use haddock 0.8, the error message is there, but the
documentation is still generated, so should be ok:

$ runhaskell Setup.lhs haddock
Preprocessing executables for haq-0.0...
Running Haddock for haq-0.0...
Warning: cannot use package haq-0.0:
   ghc-pkg failed
Warning: cannot use package base-2.0:
   HTML directory /home/dons/share/ghc-6.6/html/libraries/base does not 
exist.
Warning: Main: the following names could not be resolved:
IO

$ w3m -dump dist/doc/html/haq/Main.html
 haq Contents Index
Main
Synopsis
main :: IO ()
Documentation
main :: IO ()
main runs the main program
Produced by Haddock version 0.8

So grab haddock 0.8 and try that.

http://haskell.org/haddock/#Download

-- Don


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