[Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread Bryan O'Sullivan
On behalf of the Data.Text team, I am delighted to announce the release of preview versions of two new packages: text 0.1 Fast, packed Unicode text support, using a modern stream fusion framework. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/text text-icu 0.1 Augments text with

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread Thomas Davie
On 27 Feb 2009, at 08:17, Arne Dehli Halvorsen wrote: Manuel M T Chakravarty wrote: I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. At least two of the regular contributors to GHC work on Macs. That should ensure that Mac OS X is

Re: [Haskell-cafe] Re: base-4 + gtk2hs-0.10.0 licensing

2009-02-27 Thread Wolfgang Jeltsch
Am Donnerstag, 26. Februar 2009 21:39 schrieb Peter Hercek: The acceptable size of inlined fuctions for a C code is about 10 lines. I did not read any info how it would be for Haskell. At least, GHC inlines very massively, to my knowledge. And I think you need this massive inlining for

Re: [Haskell-cafe] Re: base-4 + gtk2hs-0.10.0 licensing

2009-02-27 Thread Wolfgang Jeltsch
Am Donnerstag, 26. Februar 2009 20:20 schrieb Achim Schneider: Wolfgang Jeltsch g9ks1...@acme.softbase.org wrote: Am Donnerstag, 26. Februar 2009 09:17 schrieb Ketil Malde: Peter Hercek pher...@gmail.com writes: Relinking against newer Gtk2Hs versions might not work. You have the

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread George Pollard
On Fri, 2009-02-27 at 00:01 -0800, Bryan O'Sullivan wrote: text-icu 0.1 Augments text with comprehensive character set conversion support and normalization (and soon more), via bindings to the ICU library. http://hackage.haskell.org/cgi-bin/hackage-scripts/package/text-icu Excellent! I was

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread George Pollard
Unfortunately it doesn’t build for me. I have libicu-dev 3.8.1 installed. $ cabal install text-icu Resolving dependencies... 'text-icu-0.1' is cached. Configuring text-icu-0.1... Preprocessing library text-icu-0.1... Error.hsc: In function ‘main’: Error.hsc:229: error:

Re: [Haskell-cafe] Translating an imperative algorithm - negascout

2009-02-27 Thread Colin Paul Adams
Toby == Toby Hutton toby.hut...@gmail.com writes: Toby But I don't want to try and refactor the code you've Toby provided without some tests to ensure everything is correct. Toby Rule number one for refactoring. :) A very good reminder. I'll write some simple (data, that is) test

Re: [Haskell-cafe] Coming up with a better API for Network.Socket.recv

2009-02-27 Thread Johan Tibell
On Fri, Feb 27, 2009 at 12:03 AM, Bryan O'Sullivan b...@serpentine.com wrote: On Thu, Feb 26, 2009 at 1:45 PM, Johan Tibell johan.tib...@gmail.com wrote: I find it quite inconvenient to use the `recv` function in Network.Socket as it throws an exception when reaching EOF and there's no way

Re: [Haskell-cafe] Re: Coming up with a better API for Network.Socket.recv

2009-02-27 Thread Johan Tibell
On Fri, Feb 27, 2009 at 12:07 AM, Achim Schneider bars...@web.de wrote: Bryan O'Sullivan b...@serpentine.com wrote: There's another problem with the network APIs: they mirror the BSD socket API too faithfully, and provide insufficient type safety. You can try to send on an unconnected socket,

Re: [Haskell-cafe] Re: Coming up with a better API for Network.Socket.recv

2009-02-27 Thread Johan Tibell
2009/2/27 Brandon S. Allbery KF8NH allb...@ece.cmu.edu: On 2009 Feb 26, at 23:41, Achim Schneider wrote: Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 16:45, Johan Tibell wrote: Anyway, the reason recv doesn't return 0 is that if you have a datagram socket, a

Re: [Haskell-cafe] Re: Coming up with a better API for Network.Socket.recv

2009-02-27 Thread Colin Paul Adams
Anyway, the POSIX spec indicates the EOF condition as return -1 with errno == ECONNRESET; this should not be taken as anything but the limited expressiveness of a C-based API.  We should map this return to Nothing. Johan I'm not sure I agree. I think using exceptions in this case is fine as

Re: [Haskell-cafe] Performance question

2009-02-27 Thread Lennart Augustsson
The random() function is only marginally better than rand(). On Fri, Feb 27, 2009 at 6:50 AM, Ketil Malde ke...@malde.org wrote: Lennart Augustsson lenn...@augustsson.net writes: C's rand() function is very bad and should never be used really. On Linux (really GNU libc, I suppose) it is the

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread Arne Dehli Halvorsen
Thomas Davie wrote: For me, this worked: sudo port install ghc sudo port install gtk2 sudo port install cairomm curl http://downloads.sourceforge.net/gtk2hs/gtk2hs-0.10.0.tar.gz gtk2hs-0.10.0.tar.gz tar xvfz gtk2hs-0.10.0.tar.gz normal install stuff here. It worked! I had to throw out gtk2,

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread Thomas Davie
On 27 Feb 2009, at 11:21, Arne Dehli Halvorsen wrote: Thomas Davie wrote: For me, this worked: sudo port install ghc sudo port install gtk2 sudo port install cairomm curl http://downloads.sourceforge.net/gtk2hs/gtk2hs-0.10.0.tar.gz gtk2hs-0.10.0.tar.gz tar xvfz gtk2hs-0.10.0.tar.gz normal

[Haskell-cafe] Missing documentation for Haddock

2009-02-27 Thread Colin Paul Adams
On http://haskell.org/haddock/doc/html/module-attributes.html the not-home attribute is missing (it's documentation is present, but the attribute itself is not named). -- Colin Adams Preston Lancashire ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Missing documentation for Haddock

2009-02-27 Thread David Waern
2009/2/27 Colin Paul Adams co...@colina.demon.co.uk: On http://haskell.org/haddock/doc/html/module-attributes.html the not-home attribute is missing (it's documentation is present, but the attribute itself is not named). Thanks for the report. By the way, the Haddock trac page is at:

Re: [Haskell-cafe] Translating an imperative algorithm - negascout

2009-02-27 Thread Holger Siegel
Am Donnerstag, den 26.02.2009, 20:54 + schrieb Colin Paul Adams: Hello Haskellers, I want to implement the negascout algorithm for the game I'm writing. Wikipedia gives the algorithm in imperative terms: http://en.wikipedia.org/wiki/Negascout I've tried to translate this into

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread Arne Dehli Halvorsen
Thomas Davie wrote: Testing out the demos, it seems it can't find Graphics.UI.Gtk.Glade, Graphics.Rendering.OpenGL System.Gnome.GConf System.Gnome.VFS Media.Streaming.GStreamer Graphics.UI.Gtk.MozEmbed Graphics.UI.Gtk.SourceView Graphics.Rendering.Cairo.SVG Perhaps the demos are out of date?

Re[4]: [Haskell-cafe] Re: Incremental array updates

2009-02-27 Thread Bulat Ziganshin
Hello Eugene, Thursday, February 26, 2009, 10:28:13 PM, you wrote: Thanks, I'll have a look at these. Treating unboxed stuff polymorphically is anyways very interesting and would be good to use in collections API that has been recently discussed (and which I occasionally try to continue

Re: [Haskell-cafe] ByteString questions

2009-02-27 Thread Peter Verswyvelen
isn't this sufficient? might require some more Win32 bindings... http://msdn.microsoft.com/en-us/library/ms810467.aspx 2009/2/27 Galchin, Vasili vigalc...@gmail.com ;^) On Thu, Feb 26, 2009 at 11:15 PM, Brandon S. Allbery KF8NH allb...@ece.cmu.edu wrote: On 2009 Feb 26, at 23:58,

Re: Re[4]: [Haskell-cafe] Re: Incremental array updates

2009-02-27 Thread Eugene Kirpichov
I'm exactly basing on them, but they don't have at least these things: - Monad-mutable collections like MArray - Instances of something like Assoc for arrays (arrays are collections in some sense, after all) - Treatment for unboxed types (I don't know yet, whether it is needed; but why do

Re[6]: [Haskell-cafe] Re: Incremental array updates

2009-02-27 Thread Bulat Ziganshin
Hello Eugene, Friday, February 27, 2009, 4:42:03 PM, you wrote: I'm exactly basing on them, but they don't have at least these things: them means Edison or Collections typeclasses? - Treatment for unboxed types (I don't know yet, whether it is needed; but why do STUArrays have special

[Haskell-cafe] Re: ANNOUNCE: pqueue-mtl, stateful-mtl

2009-02-27 Thread Chung-chieh Shan
Ryan Ingram ryani.s...@gmail.com wrote in article 2f9b2d30902151615n1e8e25e8ubbee20d93c8ec...@mail.gmail.com in gmane.comp.lang.haskell.cafe: You can roll your own pure STT monad, at the cost of performance: Do you (or anyone else) know how to prove this STT implementation type-safe? It seems

Re: Re[6]: [Haskell-cafe] Re: Incremental array updates

2009-02-27 Thread Eugene Kirpichov
2009/2/27 Bulat Ziganshin bulat.zigans...@gmail.com: Hello Eugene, Friday, February 27, 2009, 4:42:03 PM, you wrote: I'm exactly basing on them, but they don't have at least these things: them means Edison or Collections typeclasses? The EdisonAPI.  - Treatment for unboxed types (I don't

[Haskell-cafe] Hidden module?

2009-02-27 Thread Cristiano Paris
Cabalising hsc2hc I get (this is actually from manually building the package): --- [pa...@bagend hsc2hs-0.67.20061107]$ runghc Setup.hs build Preprocessing executables for hsc2hs-0.67.20061107... Building hsc2hs-0.67.20061107... Main.hs:32:7: Could not find module `System.Process': it

Re: [Haskell-cafe] Status of Haskell under OsX

2009-02-27 Thread David Leimbach
On Fri, Feb 27, 2009 at 12:04 AM, Thomas Davie tom.da...@gmail.com wrote: On 27 Feb 2009, at 08:17, Arne Dehli Halvorsen wrote: Manuel M T Chakravarty wrote: I'm planning to purchase a MacBookPro so I'm wondering how well Haskell is supported under this platform. At least two of the

Re: [Haskell-cafe] Hidden module?

2009-02-27 Thread Daniel Fischer
Am Freitag, 27. Februar 2009 15:13 schrieb Cristiano Paris: Cabalising hsc2hc I get (this is actually from manually building the package): --- [pa...@bagend hsc2hs-0.67.20061107]$ runghc Setup.hs build Preprocessing executables for hsc2hs-0.67.20061107... Building hsc2hs-0.67.20061107...

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread minh thu
2009/2/27 Bryan O'Sullivan b...@serpentine.com: On behalf of the Data.Text team, I am delighted to announce the release of preview versions of two new packages: text 0.1 Fast, packed Unicode text support, using a modern stream fusion framework.

[Haskell-cafe] Re: [darcs-users] darcs and Google Summer of Code

2009-02-27 Thread Eric Kow
Hi, (carefully avoiding your name :-P) On Mon, Feb 23, 2009 at 16:08:18 +0100, Wolfgang Jeltsch wrote: Tomorrow, I will discuss with the first half of my student project students (3 students) about what exact topic they will pursue. My idea is to let them start a Grapefruit-based darcs GUI.

Re: [Haskell-cafe] Strict version of Data.Map.map

2009-02-27 Thread Edsko de Vries
I guess so. Maybe using mapAccum helps: import qualified Data.Map as M strictMap :: (a - b) - M.Map k a - M.Map k b strictMap f m = case M.mapAccum f' () m of ((), m') - m' where f' () x = x' `seq` ((), x') where x' = f x testStrictness mapper = m `seq` Not strict.

[Haskell-cafe] Sparse vector operations

2009-02-27 Thread Grzegorz Chrupala
Hi all, In a couple of my projects I have needed to perform operations on (very) sparse vectors. I came up with the attached simple module which defines a typeclass and implements instances for simple and nested (Int)Maps. Is this the right way to go about it? Am I reinventing some wheels?

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread minh thu
2009/2/27 minh thu not...@gmail.com: 2009/2/27 Bryan O'Sullivan b...@serpentine.com: On behalf of the Data.Text team, I am delighted to announce the release of preview versions of two new packages: text 0.1 Fast, packed Unicode text support, using a modern stream fusion framework.

[Haskell-cafe] Trouble building ArrayRef 0.1.3

2009-02-27 Thread Mads Lindstrøm
Hi When I try to build ArrayRef 0.1.3 I get: Control/Concurrent/LockingBZ.hs:159:54: Ambiguous type variable `e' in the constraint: `Exception e' arising from a use of `throw' at Control/Concurrent/LockingBZ.hs:159:54-60 Probable fix: add a type

Re: [Haskell-cafe] Hidden module?

2009-02-27 Thread Cristiano Paris
On Fri, Feb 27, 2009 at 3:19 PM, Daniel Fischer daniel.is.fisc...@web.de wrote: Cabal hides all packages not listed among the build-depends when building the libraries. I think in 2006, System.Process was in the base package ('twas before the base-split), so process is not listed among the

Re: [Haskell-cafe] Trouble building ArrayRef 0.1.3

2009-02-27 Thread Bulat Ziganshin
Hello Mads, Friday, February 27, 2009, 6:27:52 PM, you wrote: i made this lib back in the ghc 6.4 days, so it probably have a lot of compatibility problems here and there :( i'm self still use ghc 6.6 :) When I try to build ArrayRef 0.1.3 I get: Control/Concurrent/LockingBZ.hs:159:54:

Re: [Haskell-cafe] ANNOUNCE: text and text-icu, fast and comprehensive Unicode support using stream fusion

2009-02-27 Thread Bryan O'Sullivan
On Fri, Feb 27, 2009 at 12:57 AM, George Pollard por...@porg.es wrote: Unfortunately it doesn’t build for me. I have libicu-dev 3.8.1 installed. Yes, as the README states, the text-icu package needs ICU 4.0. The basic text library has no such external dependencies.

Re: [Haskell-cafe] Data.Binary, strict reading

2009-02-27 Thread Duncan Coutts
On Thu, 2009-02-26 at 09:17 +, Neil Mitchell wrote: I suggest you use withFile instead and decode from the Handle that gives you (via hGetContents) rather than decodeFile from the file name. That makes it much clearer. Of course you have to avoid doing lazy stuff, but that should be

Re: [Haskell-cafe] differences between Data.Array and Data.Vector

2009-02-27 Thread Don Stewart
manlio_perillo: Hi. In Hackage there are some packages named *array*, and others named *vector*. What are the differences? Is available a guide to the various data structures available in Haskell? The vector packages tend to be either easily growable, or easily fusible, or both.

Re: [Haskell-cafe] Re: ANNOUNCE: pqueue-mtl, stateful-mtl

2009-02-27 Thread Ryan Ingram
Hmm, that's a really good question now that you mention it. So, the implementation given is trivially *not* type-safe; eventually the Int index will wrap around and reuse indices at the potentially wrong type. But lets say you replaced IntMap with Map Integer, to avoid this problem. A simple

[Haskell-cafe] Making the pointfree package work with cabal

2009-02-27 Thread Niemeijer, R.A.
Today I was very happy to discover the pointfree package, since lambdabot unfortunately doesn't work on Windows. The package works just fine, but the installation process is less than ideal. cabal install pointfree doesn't work and to install it manually you have to add containers and array to

Re: [Haskell-cafe] Trouble building ArrayRef 0.1.3

2009-02-27 Thread Mads Lindstrøm
Hi For anyone who may care, I have googled a workaround. The problem below is similar to the problem mentioned here http://stackoverflow.com/questions/431527/ambiguous-type-variable-error-msg . I wrote: Hi When I try to build ArrayRef 0.1.3 I get: Control/Concurrent/LockingBZ.hs:159:54:

Re[2]: [Haskell-cafe] Trouble building ArrayRef 0.1.3

2009-02-27 Thread Bulat Ziganshin
Hello Mads, Friday, February 27, 2009, 10:08:17 PM, you wrote: http://haskell.org/haskellwiki/Upgrading_packages is more appropriate, see 2.3 Hi For anyone who may care, I have googled a workaround. The problem below is similar to the problem mentioned here

[Haskell-cafe] Re: Sparse vector operations

2009-02-27 Thread Neal Alexander
Grzegorz Chrupala wrote: Hi all, In a couple of my projects I have needed to perform operations on (very) sparse vectors. I came up with the attached simple module which defines a typeclass and implements instances for simple and nested (Int)Maps. Is this the right way to go about it? Am I

[Haskell-cafe] Re: Sparse vector operations

2009-02-27 Thread Neal Alexander
Neal Alexander wrote: Grzegorz Chrupala wrote: Hi all, In a couple of my projects I have needed to perform operations on (very) sparse vectors. I came up with the attached simple module which defines a typeclass and implements instances for simple and nested (Int)Maps. Is this the right way to

[Haskell-cafe] Re: Hidden module?

2009-02-27 Thread Achim Schneider
Cristiano Paris cristiano.pa...@gmail.com wrote: I had to append process and directory as dependencies but then it worked. How can I submit a patch to Hackage? Do I have to contact the owner? In general, just try the maintainer and/or author adresses given on hsc2hs's hackage page. I'd

[Haskell-cafe] How can you effectively manually determine the type?

2009-02-27 Thread Anonymous Anonymous
Hello, I'm new at haskell and I have the following question: let's say I type the following: function = foldr until Now my first question is what is the type of this function? Well let's see what the type of until and foldr is: until :: (a - Bool) - (a - a) - a - a foldr :: (a - b - b) - b -

[Haskell-cafe] Samples for http package

2009-02-27 Thread Gü?nther Schmidt
Hi everyone, are there any examples on how to use the current version of the http package? Günther ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] memory issues

2009-02-27 Thread Don Stewart
bulat.ziganshin: Hello Rogan, Saturday, February 28, 2009, 1:18:47 AM, you wrote: data Block = Block { offset::Integer , size::Integer } deriving (Eq) try !offset::Integer , !size::Integer offset :: !Integer And possibly just using {-# UNPACK

Re: [Haskell-cafe] memory issues

2009-02-27 Thread Daniel Fischer
Am Samstag, 28. Februar 2009 00:37 schrieb Bulat Ziganshin: Hello Daniel, Saturday, February 28, 2009, 2:21:31 AM, you wrote: printf %s $ unlines $ map (show) (sort $! blocks content) Bad! Use mapM_ print $ sort $ blocks content are you sure? Tested it. The printf %s is

[Haskell-cafe] Re: Incremental array updates

2009-02-27 Thread Keith Sheppard
I'm still learning haskell, so I may be missing something pretty obvious, but isn't this the kind of thing that the diff array types were created for. http://en.wikibooks.org/wiki/Haskell/Hierarchical_libraries/Arrays#DiffArray_.28module_Data.Array.Diff.29 -Keith On Thu, Feb 26, 2009 at

Re: [Haskell-cafe] Translating an imperative algorithm - negascout

2009-02-27 Thread wren ng thornton
Holger Siegel wrote: loop alpha b (c:cs) = let alpha' = max(alpha, - negascout c d (-b) (-alpha)) in if alpha' = beta then alpha' else if alpha' = b then let alpha'' = - negascout c d (-beta) (-alpha') in if

Re: [Haskell-cafe] Re: ANNOUNCE: pqueue-mtl, stateful-mtl

2009-02-27 Thread Ryan Ingram
I note that all of your broken issues revolve around calls that can't be written in terms of lift; that is, you need access to the STT constructor in order to create these problems. It's obvious that anything that accesses the STT constructor will potentially not be typesafe; the question I have

Re: [Haskell-cafe] Re: Incremental array updates

2009-02-27 Thread Eugene Kirpichov
It is, but they are still too slow. STArrays rock the world. 2009/2/28 Keith Sheppard keiths...@gmail.com: I'm still learning haskell, so I may be missing something pretty obvious, but isn't this the kind of thing that the diff array types were created for.