Re: [Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread edgar klerks
No not for lists, but it is not a bad direction. If I modify it a bit, I can get an ifmzero function: ifmzero :: (MonadSplit m) => m a -> m b -> m b -> m b ifmzero p b f = join $ mhead $ (liftM (const f) p) `mplus` (return b) mhead :: (MonadSplit m) => m a -> m a mhead = liftM fst . msplit Which

[Haskell-cafe] ANNOUNCE: Haskell Communities and Activities Report (21st ed., November 2011)

2011-12-03 Thread Janis Voigtländer
On behalf of all the contributors, I am pleased to announce that the Haskell Communities and Activities Report (21st edition, November 2011) is now available in PDF and HTML formats: http://haskell.org/communities/11-2011/report.pdf http://haskell.org/communities

Re: [Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-03 Thread Stephen Tetley
Umm, an obvious point is that if you really are using lists as streams they should appear infinite to the processing code, so you shouldn't encounter operations that fail due to incompatible lengths. Otherwise I think there might be packages on Hackage for fixed sized lists, its a common example f

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread wren ng thornton
On 12/2/11 7:35 PM, Bas van Dijk wrote: On 3 December 2011 00:45, Bas van Dijk wrote: * 60 times faster than the previous release! Here are some benchmark results that compare the original monad-peel, the previous monad-control-0.2.0.3 and the new monad-control-0.3: http://basvandijk.github.

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-03 Thread wren ng thornton
On 12/1/11 2:26 PM, dokondr wrote: How to find this path using GHC libraries? There was a discussion about this recently over on libraries@, IIRC. The short answer is that, at present, there is no function to give you $0. We'd like to add such a function, but it's not been done yet. Part of

Re: [Haskell-cafe] How to get a file path to the program invoked?

2011-12-03 Thread wren ng thornton
On 12/1/11 11:12 AM, dokondr wrote: Hi, When my program starts it needs to know a complete path to the directory from which it was invoked. In terms of standard shell (sh) I need the Haskell function that will do equivalent to: #!/bin/sh path=$(dirname $0) That's not the path to the directory

[Haskell-cafe] Anonymous, Unique Types, maybe

2011-12-03 Thread Scott Lawrence
(Sorry if this email is rather unclear - I know my desired end result, but neither how to acheive nor explain it well. Here goes.) I'm processing lists, using them sortof as streams. (Whether that's a good idea isn't the issue here - but let me know if it isn't!) Fundamentally, there are two t

Re: [Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread David Menendez
On Sat, Dec 3, 2011 at 3:55 PM, Antoine Latter wrote: > On Sat, Dec 3, 2011 at 10:55 AM, edgar klerks wrote: >> Hi list, >> >> I am using MonadSplit >> (from http://www.haskell.org/haskellwiki/New_monads/MonadSplit )  for a >> project and now I want to make a library out of it. This seems to be >

Re: [Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread Antoine Latter
On Sat, Dec 3, 2011 at 10:55 AM, edgar klerks wrote: > Hi list, > > I am using MonadSplit > (from http://www.haskell.org/haskellwiki/New_monads/MonadSplit )  for a > project and now I want to make a library out of it. This seems to be > straightforward, but I got stuck when I tried to move miszero

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Ertugrul Söylemez
Bas van Dijk wrote: > It provides lifted versions of functions from the base library. > Currently it exports the following modules: > > * Control.Exception.Lifted > * Control.Concurrent.Lifted > * Control.Concurrent.MVar.Lifted > * System.Timeout.Lifted > > These are just modules which people hav

Re: [Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread edgar klerks
Hi Arseniy, Yes, I see it now. :) . I had some feeling there should be some structural equality: Just _ == Just _ = True Nothing == Nothing = True _ == _ = False But this doesn't work for functions. Thanks for your answer! Greets, Edgar On Sat, Dec 3, 2011 at 6:23 PM, Arseniy Alekseyev < arse

Re: [Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread Arseniy Alekseyev
Of course it is not possible! Take a simple composition of reader and Maybe functors for an example: miszero :: (b -> Maybe a) -> Bool I'm pretty sure (b -> Maybe a) for a is a MonadPlus, but you can't implement miszero for it. Arseniy. On 3 December 2011 16:55, edgar klerks wrote: > Hi list,

[Haskell-cafe] ismzero operator possible without equal constraint

2011-12-03 Thread edgar klerks
Hi list, I am using MonadSplit (from http://www.haskell.org/haskellwiki/New_monads/MonadSplit ) for a project and now I want to make a library out of it. This seems to be straightforward, but I got stuck when I tried to move miszero out of the class: miszero :: m a -> Bool It tests if the provi

Re: [Haskell-cafe] Weird interaction between literate haskell, ghci and OverloadedStrings

2011-12-03 Thread Bas van Dijk
On 3 December 2011 11:19, Erik de Castro Lopo wrote: > Joachim Breitner wrote: > >> it does not seem to be related to literate haskell, if I copy the code >> from your file into a .hs without the "> ", ghci still does not activate >> the OverloadedStrings extension when loading the file. > > I had

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Bas van Dijk
On 3 December 2011 00:45, Bas van Dijk wrote: > Note that Peter Simons just discovered that these packages don't build > with GHC-7.0.4 (https://github.com/basvandijk/monad-control/issues/3). > I just committed some fixes which enable them to be build on GHC >= > 6.12.3. Hopefully I can release th

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Bas van Dijk
On 3 December 2011 10:18, Herbert Valerio Riedel wrote: > btw, how did you manage to get measurements from 2 different versions of > the same library (monad-control 0.3 and 0.2.0.3) into a single report? By renaming the old package to monad-control2 and using the PackageImports extension. I do w

Re: [Haskell-cafe] Weird interaction between literate haskell, ghci and OverloadedStrings

2011-12-03 Thread Erik de Castro Lopo
Joachim Breitner wrote: > it does not seem to be related to literate haskell, if I copy the code > from your file into a .hs without the "> ", ghci still does not activate > the OverloadedStrings extension when loading the file. I hadn't noticed that. > I’d consider this a bug until the develop

Re: [Haskell-cafe] ANNOUNCE: monad-control-0.3

2011-12-03 Thread Herbert Valerio Riedel
On Sat, 2011-12-03 at 01:35 +0100, Bas van Dijk wrote: > Here are some benchmark results that compare the original monad-peel, > the previous monad-control-0.2.0.3 and the new monad-control-0.3: > > http://basvandijk.github.com/monad-control.html > > Note that the benchmarks use Bryan O'Sullivan'

Re: [Haskell-cafe] Weird interaction between literate haskell, ghci and OverloadedStrings

2011-12-03 Thread Joachim Breitner
Hi, Am Samstag, den 03.12.2011, 16:18 +1100 schrieb Erik de Castro Lopo: > I'm working on a literate haskell document (actually TeX, but the > example below is just test) and I'm using ByteStrings in the code. > I know I can do: > > ghci -XOverloadedStrings file.lhs > > or, after ghci is run