Re: [Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-05 Thread Yuri de Wit
It is easy enough to recreate the link manually or as easy to run cabal install again, but that is not the point here. The point is that it will bite the next dozen of unsuspecting users since, at first, they have no idea of what is going on. In any case, apologies for sending this in this thread

Re: [Haskell-cafe] Performance of delete-and-return-last-element

2013-09-05 Thread Petr Pudlák
Dne 09/01/2013 09:13 PM, Harald Bögeholz napsal(a): Am 31.08.13 14:35, schrieb Petr Pudlák: One solution would be to fold over a specific semigroup instead of a recursive function: |import Data.Semigroup import Data.Foldable(foldMap) import Data.Maybe(maybeToList) data Darle a =Darle

Re: [Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-05 Thread Rogan Creswick
I ran into another oddity due to old build artifacts today -- it was easy to fix, but very confusing; cabal repl was exiting with unrecognised command: repl. tl/dr; if you see this, delete the old 'dist' dir and re-run 'cabal configure'. Here's a snippit of my shell session to explain in more

Re: [Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-05 Thread Johan Tibell
I pasted your report into the bug tracker: https://github.com/haskell/cabal/issues/1478 I don't know if you're on GitHub or not so I could link the report to your user. On Thu, Sep 5, 2013 at 8:16 AM, Rogan Creswick cresw...@gmail.com wrote: I ran into another oddity due to old build artifacts

[Haskell-cafe] Reminder to file Haddock bugs on Trac.

2013-09-05 Thread Mateusz Kowalczyk
This is just a friendly reminder that if you have any issues with Haddock that you would like to get looked at, you should probably be making your way to the Haddock Trac[1] now. If you already have open tickets, you can probably get them looked at if you reply to this thread. Unfortunately there

Re: [Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-05 Thread Johan Tibell
Hideyuki Tanaka was missing from the list of contributors (his patch was applied through me). His contribution made 'cabal update' faster! On Wed, Sep 4, 2013 at 2:11 PM, Johan Tibell johan.tib...@gmail.com wrote: Hi all, On behalf of the cabal maintainers and contributors I'm proud to

[Haskell-cafe] ghc-mod v3.0.0

2013-09-05 Thread 山本和彦
Hi all, I have just uploaded ghc-mod v3.0.0 to Hackage. In this version, ghc-mod supports the sandbox feature of cabal-install. Instead, it stopped supporting cabal-dev. If you want to use ghc-mod v3.0.0, I would recommand to install cabal-install 1.18. The sandbox in your package is

Re: [Haskell-cafe] Fwd: Can I use String without in ghci?

2013-09-04 Thread Richard A. O'Keefe
On 3/09/2013, at 10:44 PM, Rustom Mody wrote: Whoops! my bad -- I was *thinking* 'pipes' but ended up *writing* 'IPC' :-) So let me restate more explicitly what I intended -- pipes, FIFOs, sockets, etc. IOW read/write/send/recv calls and the mathematical model represented by the

Re: [Haskell-cafe] Haskell / Functional Programmers Group in Madrid (Spain)?

2013-09-04 Thread Eduardo Basterrechea
Alejandro Serrano Mena trupill at gmail.com writes: Hi,Is there any Haskell or functional programmers user group in the region of Madrid? If not, I think it could be a great idea to get to know each other, and share experiences. Furthermore, we could try to organize some meetings with

Re: [Haskell-cafe] Haskell / Functional Programmers Group in Madrid (Spain)?

2013-09-04 Thread Alberto G. Corona
There is one Functional Programming meetup in Madrid. The first meeting was in August. The next meeting is the 11th September (this month) . I couldn't assist in September. I hope to see you in October!. http://www.meetup.com/FP-Madrid/ 2013/9/4 Eduardo Basterrechea eba...@molinodeideas.es

[Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Alejandro Serrano Mena
Hi, I'm currently writing a tutorial on web applications using Haskell. I know the pros and cons of each server-side library (Yesod, Snap, Scotty, Warp, Happstack), but I'm looking for the right choice for client-side programming that converts Haskell to JavaScript. I've finally come to Fay vs.

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Niklas Hambüchen
Hi, I'm also interested in that. Have you already evaluated haste? It does not seem to have any of your cons, but maybe others. What I particularly miss from all solutions is the ability to simply call parts written in Haskell from Javascript, e.g. to write `fib` and then integrate it into an

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Alejandro Serrano Mena
I haven't looked at Haste too much, I'll give it a try. My main problem is that I would like to find a solution that will continue working in years (somehow, that will became the solution for generating JS from Haskell code). That's why I see GHCJS (which just includes some patches to mainstream

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Nathan Hüsken
In my opinion haste is somewhere between Fay and ghcjs. It supports more than Fay, but in difference to ghcjs some PrimOps are not supported (weak pointers for example). It is a little bit more direct than ghcjs, in the sense that it does not need such a big rts written in js. I like haste

[Haskell-cafe] Efficient matrix multiply using accelerate

2013-09-04 Thread Morten Olsen Lysgaard
I've been trying to get some speed out of the accelerate library today. What I want to implement is something as simple as a matrix multiply. I'd like it to be fast and memory efficient. Given the equation C = AB where A is nxr B is rxm C is nxm it seem reasonable to allocate three arrays

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Adam Bergmark
You might be interested in these two comment threads (and maybe the rest of the comments as well): http://www.reddit.com/r/haskell/comments/1ldqav/thoughts_on_uhc_vs_haste_vs_fay/cbyrhwz

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-04 Thread Bryan O'Sullivan
On Tue, Sep 3, 2013 at 3:56 PM, Simon Yarde simonya...@me.com wrote: I'm new to Haskell and have reached an impasse in understanding the behaviour of sockets. Your question is actually not related to Haskell at all, but is a general I don't understand socket programming question. You're being

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Joachim Breitner
Hi, Am Mittwoch, den 04.09.2013, 14:46 +0200 schrieb Adam Bergmark: You might be interested in these two comment threads (and maybe the rest of the comments as well): http://www.reddit.com/r/haskell/comments/1ldqav/thoughts_on_uhc_vs_haste_vs_fay/cbyrhwz

Re: [Haskell-cafe] Reasoning about performance

2013-09-04 Thread Carter Schonwald
Awesome/ thanks for sharing. It's worth noting that criterion is also pretty great for microbenchmarks too. On my machine I get pretty good timing accuracy on anything that takes more than 20 nanoseconds. On Wednesday, September 4, 2013, Scott Pakin wrote: On 09/03/2013 06:02 PM, Carter

[Haskell-cafe] How to read a file and return a String?

2013-09-04 Thread yi lu
I want to read a text file, and store it in a *String*. But readFile will get *IO String*. I search with google and they tell me it is not necessarily to do so. Can you explain to me why is this? Furthermore, How to read a file and store it in a String? In fact, I want to read a file and split it

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Daniil Frumin
Hi! On Sep 4, 2013, at 13:02, Niklas Hambüchen m...@nh2.me wrote: Hi, I'm also interested in that. Have you already evaluated haste? It does not seem to have any of your cons, but maybe others. What I particularly miss from all solutions is the ability to simply call parts written in

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Adam Bergmark
Here are some points I'd like to emphasize in addition to the threads above, with the disclaimer that I'm the maintainer of Fay. Fay tries to be very simple, the code base is small (~4800 LoC). This really lowers the entry barrier for contributions which I think is very important for open source

Re: [Haskell-cafe] How to read a file and return a String?

2013-09-04 Thread Brandon Allbery
On Wed, Sep 4, 2013 at 10:21 AM, yi lu zhiwudazhanjiang...@gmail.comwrote: I want to read a text file, and store it in a *String*. But readFile will get *IO String*. I search with google and they tell me it is not necessarily to do so. Can you explain to me why is this? Furthermore, How to

[Haskell-cafe] Strange IO sequence behaviour (Was: sequence causing stack overflow on pretty small lists)

2013-09-04 Thread Tom Ellis
As an addendum to the recent discussion, can anyone explain why main crashes quickly with a stack overflow, whereas main' is happy to print Hi for ages (eventually crashing due to an out of memory condition)? bignum = 100 * 1000 * 1000 main = replicateM bignum (return ()) main' =

Re: [Haskell-cafe] How to read a file and return a String?

2013-09-04 Thread Tom Ellis
On Wed, Sep 04, 2013 at 10:21:37PM +0800, yi lu wrote: I want to read a text file, and store it in a *String*. But readFile will get *IO String*. I search with google and they tell me it is not necessarily to do so. Can you explain to me why is this? Furthermore, How to read a file and store

Re: [Haskell-cafe] Reasoning about performance

2013-09-04 Thread Scott Pakin
On 09/03/2013 06:02 PM, Carter Schonwald wrote: It's also worth adding that ghci does a lot less optimization than ghc. Yes, I discovered that before I posted. Note from my initial message that I used ghc to compile, then loaded the compiled module into ghci: Prelude :!ghc -c -O2

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Luite Stegeman
On Wed, Sep 4, 2013 at 6:32 PM, Daniil Frumin difru...@gmail.com wrote: I think it's nice that you've raised that question, I will think about implementing a finer API for calling Haskell from JS. It sounds like something like h$runSyncWithResult (name open for bikeshedding) that takes an

[Haskell-cafe] ANNOUNCE: Haskell Refactorer (HaRe) version 0.7.0.0

2013-09-04 Thread AlanKim Zimmerman
I am please to announce an alpha release of the Haskell Refactorer making use of the GHC API. It is a work in progress, but currently supports the following refactorings iftocase Convert an if expression to a case expression dupdef Duplicate a definition

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Chris Smith
I second the recommendation to look at Haste. It's what I would pick for a project like this today. In the big picture, Haste and GHCJS are fairly similar. But when it comes to the ugly details of the runtime system, GHCJS adopts the perspective that it's basically an emulator, where

Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-04 Thread Adam Bergmark
Niklas: I missed your note about calling Haskell from JS, see this for Fay: https://github.com/faylang/fay/wiki/Fay-Status-Update-September-2013%3A-ZuriHac%2C-typeclasses%2C-haskell-suite%2C-and-strictness-wrappers#javascript-fay-communication On Wed, Sep 4, 2013 at 8:18 PM, Luite Stegeman

Re: [Haskell-cafe] Strange IO sequence behaviour (Was: sequence causing stack overflow on pretty small lists)

2013-09-04 Thread Joe Q
To give a very casual explanation, both mains are of the form do this a bunch of times and return the results. Your first is do nothing and return the ()s, but importantly, it has to execute all those nothings. Your second is print hello a bunch and return the ()s. The list it wants to eventually

Re: [Haskell-cafe] Strange IO sequence behaviour (Was: sequence causing stack overflow on pretty small lists)

2013-09-04 Thread Joe Q
Er, I seem to have misread and thought you were doing infinite replicateM, so that explanation doesn't completely address your question. That's what I get for reading on a phone! On Sep 4, 2013 4:11 PM, Joe Q headprogrammingc...@gmail.com wrote: To give a very casual explanation, both mains are

[Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-04 Thread Johan Tibell
Hi all, On behalf of the cabal maintainers and contributors I'm proud to announce the Cabal (and cabal-install) 1.18.0 release. To install run cabal update cabal install Cabal-1.18.0 cabal-install-1.18.0 With 854 commits since the last release there are two many improvements and bug fixes

Re: [Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-04 Thread Darren Grant
Thank you all for the hard work. The new features are already of great help to me! Cheers, Darren On 2013-09-04 2:13 PM, Johan Tibell johan.tib...@gmail.com wrote: Hi all, On behalf of the cabal maintainers and contributors I'm proud to announce the Cabal (and cabal-install) 1.18.0 release.

Re: [Haskell-cafe] ANN: Cabal v1.18.0 released

2013-09-04 Thread Yuri de Wit
Thanks for all the hard work! If you see this in OSX (#1009) while installing cabal 1.18: *Warning: could not create a symlink in /Users/lemao/Library/Haskell/bin for * *cabal because the file exists there already but is not managed by cabal. You* *can create a symlink for this executable

Re: [Haskell-cafe] type constructor section for (- Bool), _not_ ((-) Bool)

2013-09-04 Thread AntC
Brent Yorgey byorgey at seas.upenn.edu writes: On Tue, Sep 03, 2013 at 11:33:46AM +, AntC wrote: I want an instance and type improvement constraint of the form instance (f ~ (- Bool)) = C Foo (f b) where ... There is no operator section syntax for types. Moreover,

Re: [Haskell-cafe] Reasoning about performance

2013-09-04 Thread Scott Pakin
On 09/03/2013 05:43 PM, Bob Ippolito wrote: Haskell's non-strict evaluation can often lead to unexpected results when doing tail recursion if you're used to strict functional programming languages. In order to get the desired behavior you will need to force the accumulator (with something

Re: [Haskell-cafe] Efficient matrix multiply using accelerate

2013-09-04 Thread Trevor L. McDonell
Hi Morten, On 04/09/2013, at 9:53 PM, Morten Olsen Lysgaard mor...@lysgaard.no wrote: I've been trying to get some speed out of the accelerate library today. What I want to implement is something as simple as a matrix multiply. I'd like it to be fast and memory efficient. Well, the trouble

Re: [Haskell-cafe] How to read a file and return a String?

2013-09-04 Thread Richard A. O'Keefe
The original poster wants to - read a file - get the contents as a String - break the string into lines - do something with the lines - and presumably print the result Easy. Put the following lines in a file called 'rf.hs': file_name = rf.hs main = readFile file_name = \string -

Re: [Haskell-cafe] stream interface vs string interface: references

2013-09-03 Thread Richard A. O'Keefe
On 3/09/2013, at 5:17 PM, damodar kulkarni wrote: I didn't want to clutter that thread so I am asking a question here. Where do I find foundational and/or other good references on the topic of stream interface vs string interface to convert objects to text? I tried google but failed. It

Re: [Haskell-cafe] stream interface vs string interface: references

2013-09-03 Thread damodar kulkarni
Thank you very much for the detailed explanation. It surely was an enlightenment for me. Especially the comments Java makes obtain print version as a string the basic form and append print version to output stream a derived form. Smalltalk makes append print version to output stream the basic

Re: [Haskell-cafe] stream interface vs string interface: references

2013-09-03 Thread oleg
For lazy I/O, using shows in Haskell is a good analogue of using #printOn: in Smalltalk. The basic form is include this as PART of a stream, with convert this to a whole string as a derived form. What the equivalent of this would be for Iteratees I don't yet understand. Why not to try

Re: [Haskell-cafe] Fwd: MVar problem in acid-state?

2013-09-03 Thread Dag Odenhall
It's conceivable. It might help if you list what version of acid-stateyou're using and what parts of it. And maybe file a bug https://github.com/acid-state/acid-state/issues upstream even if you're not sure it is acid-state. On Mon, Sep 2, 2013 at 7:35 PM, Corentin Dupont

[Haskell-cafe] Fwd: Can I use String without in ghci?

2013-09-03 Thread Rustom Mody
On Mon, Sep 2, 2013 at 10:43 AM, Richard A. O'Keefe o...@cs.otago.ac.nzwrote: On 2/09/2013, at 3:55 PM, Rustom Mody wrote: On Mon, Sep 2, 2013 at 5:43 AM, Richard A. O'Keefe wrote: A slogan I have programmed by since I first met C and recognised how vastly superior to PL/I it was for

[Haskell-cafe] type constructor section for (- Bool), _not_ ((-) Bool)

2013-09-03 Thread AntC
I'm probably being dumb, but Hoogle nor the wiki are helping me. I want an instance and type improvement constraint of the form instance (f ~ (- Bool)) = C Foo (f b) where ... The first arg to C is driving type improvement, for example: instance (f ~ []) = C Bar (f b) where ... (The

Re: [Haskell-cafe] Fwd: MVar problem in acid-state?

2013-09-03 Thread Corentin Dupont
OK, my mistake: it's working now. It was because I'm using an haskell interpreter in my program, and the version of GHC was different on my PC (where I compile) and on the server (where I run)... On Tue, Sep 3, 2013 at 11:13 AM, Dag Odenhall dag.odenh...@gmail.comwrote: It's conceivable. It

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-03 Thread Niklas Hambüchen
On 30/08/13 10:30, Mateusz Kowalczyk wrote: I would also like to remind you that if there's something that you'd like to see in Haddock or something that you feel is broken, a good way express this is to make a ticket on the Haddock Trac[2]. I made one:

Re: [Haskell-cafe] type constructor section for (- Bool), _not_ ((-) Bool)

2013-09-03 Thread Brent Yorgey
On Tue, Sep 03, 2013 at 11:33:46AM +, AntC wrote: I'm probably being dumb, but Hoogle nor the wiki are helping me. I want an instance and type improvement constraint of the form instance (f ~ (- Bool)) = C Foo (f b) where ... The first arg to C is driving type improvement, for

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread Tommy Thorn
This is interesting and I wish them luck, but it seems surprising that the below link doesn't have as much as a screenshot (for an IDE, you kind of expect to see what it looks like). After much browsing around on their website I finally found the Video Demo:

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread MigMit
Confirm the issue. I have Firefox on Mac as well, and it does show for me, but says the same thing as Tommy's Safari On Sep 3, 2013, at 11:25 PM, Tommy Thorn tt1...@yahoo.com wrote: This is interesting and I wish them luck, but it seems surprising that the below link doesn't have as much as a

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread MigMit
OK, now video on http://www.i-newswire.com/fp-complete-launches-fp-haskell/237230 works. Seems like a youtube glitch On Sep 3, 2013, at 11:37 PM, MigMit miguelim...@yandex.ru wrote: Confirm the issue. I have Firefox on Mac as well, and it does show for me, but says the same thing as Tommy's

[Haskell-cafe] Reasoning about performance

2013-09-03 Thread Scott Pakin
I'm a Haskell beginner, and I'm baffled trying to reason about code performance, at least with GHC. For a program I'm writing I needed to find all pairs of elements of a list. That is, given the list ABCD I wanted to wind up with the list

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Brandon Allbery
On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde simonya...@me.com wrote: I've found that setting the send buffer size causes send to truncate the ByteString to the buffer size, but that successive sends continue to succeed when the buffer should be full. I see no actual flow control here. That

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread Mike Meyer
On Tue, Sep 3, 2013 at 2:25 PM, Tommy Thorn tt1...@yahoo.com wrote: This is interesting and I wish them luck, but it seems surprising that the below link doesn't have as much as a screenshot (for an IDE, you kind of expect to see what it looks like). If you follow the link that says Product

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread Mathijs Kwik
You can always try the attached docx! :) On Tue, Sep 3, 2013 at 9:25 PM, Tommy Thorn tt1...@yahoo.com wrote: This is interesting and I wish them luck, but it seems surprising that the below link doesn't have as much as a screenshot (for an IDE, you kind of expect to see what it looks like).

[Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Simon Yarde
I'm new to Haskell and have reached an impasse in understanding the behaviour of sockets. I see that under the hood Network.Socket sockets are set to non-blocking. Presumably, when a non-blocking socket's buffer is full it should immediately return 0 bytes. I've found that setting the send

Re: [Haskell-cafe] World's First Commercial Haskell IDE and Deployment Platform, FP Haskell Center Launches Today

2013-09-03 Thread Brandon Allbery
On Tue, Sep 3, 2013 at 3:35 PM, Mathijs Kwik math...@bluescreen303.nlwrote: You can always try the attached docx! :) Which likewise showed nothing. -- brandon s allbery kf8nh sine nomine associates allber...@gmail.com

Re: [Haskell-cafe] Reasoning about performance

2013-09-03 Thread Bob Ippolito
Haskell's non-strict evaluation can often lead to unexpected results when doing tail recursion if you're used to strict functional programming languages. In order to get the desired behavior you will need to force the accumulator (with something like Data.List's foldl', $!, seq, BangPatterns,

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Gregory Collins
On Wed, Sep 4, 2013 at 12:56 AM, Simon Yarde simonya...@me.com wrote: What's going on? I expected the second and third send operation to return 0 bytes sent, because the send buffer can only hold 1 byte. If the underlying write operation returns EWOULDBLOCK then the send function calls into

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Joey Adams
On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde simonya...@me.com wrote: I'm new to Haskell and have reached an impasse in understanding the behaviour of sockets. The crux of my line of enquiry is this; how can my application know when to pause in generating its chunked output if send doesn't

Re: [Haskell-cafe] Reasoning about performance

2013-09-03 Thread Carter Schonwald
It's also worth adding that ghci does a lot less optimization than ghc. Likewise, the best tool for doing performance benchmarking is the excellent Criterion library. To repeat: use compiled code for benchmarking, and use criterion. Ghci is not as performance tuned as compiled code, except when

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Brandon Allbery
On Tue, Sep 3, 2013 at 7:58 PM, Joey Adams joeyadams3.14...@gmail.comwrote: On Tue, Sep 3, 2013 at 6:56 PM, Simon Yarde simonya...@me.com wrote: I'm new to Haskell and have reached an impasse in understanding the behaviour of sockets. The crux of my line of enquiry is this; how can my

Re: [Haskell-cafe] Reasoning about performance

2013-09-03 Thread Dan Burton
Well for one thing, note that allPairs3 produces the result in reverse order: allPairs1 abc [('a','b'),('a','c'),('b','c')] allPairs2 abc [('a','b'),('a','c'),('b','c')] allPairs3 abc [('b','c'),('a','c'),('a','b')] allPairs2 uses guarded recursion which the optimizer probably likes, although

Re: [Haskell-cafe] Reasoning about performance

2013-09-03 Thread Richard A. O'Keefe
allPairs2 can be simplified using a trick I wouldn't dare use in any language but Haskell: triangle4 xs = fused undefined [] xs where fused x (y:ys) zs = (x,y) : fused x ys zs fused _ [] (z:zs) = fused z zs zs fused _ [] [] = [] I submit this just for grins; it

Re: [Haskell-cafe] Unexpected behaviour with send and send-buffer setting

2013-09-03 Thread Simon Yarde
On 4 Sep 2013, at 00:49, Gregory Collins g...@gregorycollins.net wrote: If the underlying write operation returns EWOULDBLOCK then the send function calls into the GHC IO manager with threadWaitWrite, which registers interest in the file descriptor using epoll() and blocks the calling

Re: [Haskell-cafe] Traversals of monomorphic containers

2013-09-03 Thread Mario Blažević
On 09/02/13 06:53, Nicolas Trangez wrote: # Redirected to haskell-cafe On Sun, 2013-09-01 at 14:58 +0400, Artyom Kazak wrote: Would this be an appropriate place to propose adding mapM_ (and then possibly mapM) to bytestring library? Was it suggested before? If yes, why was it rejected? This

Re: [Haskell-cafe] Traversals of monomorphic containers

2013-09-03 Thread Tony Morris
These questions are exactly what Control.Lens answers. On 04/09/2013 12:50 PM, Mario Blažević blama...@acanac.net wrote: On 09/02/13 06:53, Nicolas Trangez wrote: # Redirected to haskell-cafe On Sun, 2013-09-01 at 14:58 +0400, Artyom Kazak wrote: Would this be an appropriate place to

Re: [Haskell-cafe] ANN: th-desugar simplifies Template Haskell processing

2013-09-02 Thread Anders Persson
For expanding/inlining type synonyms, there is also th-expand-syns ( http://hackage.haskell.org/package/th-expand-syns). /Anders On Mon, Sep 2, 2013 at 3:25 AM, Richard Eisenberg e...@cis.upenn.edu wrote: No, but I agree that this behavior is useful and in the spirit of th-desugar. I can add

[Haskell-cafe] ANNOUNCE: Ajhc Haskell Compiler 0.8.0.8 Release

2013-09-02 Thread Kiwamu Okabe
We are happy to announce Ajhc 0.8.0.8. This version is a point release to fix some BUGs, and support new platforms. You can get Ajhc using cabal install ajhc command. The usage is found at Ajhc's project web site http://ajhc.metasepi.org/. The source code at https://github.com/ajhc/ajhc/tags.

[Haskell-cafe] Traversals of monomorphic containers (was: Re: mapM_ for bytestring)

2013-09-02 Thread Nicolas Trangez
# Redirected to haskell-cafe On Sun, 2013-09-01 at 14:58 +0400, Artyom Kazak wrote: Would this be an appropriate place to propose adding mapM_ (and then possibly mapM) to bytestring library? Was it suggested before? If yes, why was it rejected? This got me wondering: there are several

Re: [Haskell-cafe] Proposal: Generic conditions for 'if' and 'case'

2013-09-02 Thread Nicolas Trangez
On Sun, 2013-09-01 at 15:51 -0700, Wvv wrote: I think it is an old idea, but nevertheless. Now we have next functions: if (a :: Bool) then x else y case b of a1 :: Bool - x1 a2 :: Bool - x2 ... Let we have generic conditions for 'if' and 'case': class Boolean a where toBool

[Haskell-cafe] Fwd: MVar problem in acid-state?

2013-09-02 Thread Corentin Dupont
Hi the list, I have compiled my application on my PC, it works fine, but when I copy it on my server (same architecture), I get: Nomyx: thread blocked indefinitely in an MVar operation I don't use MVars in my application, is it possible that it's coming from acid-state? Thanks, Corentin

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-02 Thread John MacFarlane
When the proposal was first being discussed, I suggested that instead of adding markdown support to haddock, one might enhance the existing haddock markup, making it more expressive, so that it could encode the same range of structural features as markdown. If I'm not mistaken, currently haddock

Re: [Haskell-cafe] Proposal: Generic conditions for 'if' and 'case'

2013-09-02 Thread Wvv
Thanks! It is a good toy for testing! Nicolas Trangez wrote Here's an example implementing your proposal: {-# LANGUAGE RebindableSyntax #-} import Prelude class Boolean a where toBool :: a - Bool instance Boolean Bool where toBool = id instance Boolean [a] where

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-02 Thread Mateusz Kowalczyk
On 02/09/13 19:43, John MacFarlane wrote: When the proposal was first being discussed, I suggested that instead of adding markdown support to haddock, one might enhance the existing haddock markup, making it more expressive, so that it could encode the same range of structural features as

[Haskell-cafe] Fw: Re: On Markdown in Haddock and why it's not going to happen

2013-09-02 Thread John MacFarlane
+++ Mateusz Kowalczyk [Sep 02 13 21:34 ]: On 02/09/13 19:43, John MacFarlane wrote: When the proposal was first being discussed, I suggested that instead of adding markdown support to haddock, one might enhance the existing haddock markup, making it more expressive, so that it could encode

[Haskell-cafe] stream interface vs string interface: references

2013-09-02 Thread damodar kulkarni
In a reply to the question on the thread titled Can I use String without in ghci?, Richard A. O'Keefe has noted that, It's also the what-Smalltalk-got-right-and-Java-got-wrong lesson: the right way to convert objects to text is via a *stream* interface, not a *string* interface. I didn't

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Eric Rasmussen
Might not be exactly what you're looking for, but Control.Arrow has a rich set of operators that can be used to combine functions. For instance, there's an example on http://en.wikibooks.org/wiki/Haskell/Understanding_arrows showing an addA function that can be used to apply two functions to the

[Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread yi lu
I want to know if it is possible that I use strings without . If I type *Preludefoo bar* which actually I mean *Preludefoo bar* However I don't want to type s. I have noticed if *bar* is predefined or it is a number, it can be used as arguments. But can other strings be used this way? Like in

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Bob Ippolito
Yes, you can do that, but you probably shouldn't. See also: http://www.haskell.org/haskellwiki/Num_instance_for_functions http://hackage.haskell.org/package/applicative-numbers On Sat, Aug 31, 2013 at 10:01 PM, Christopher Howard christopher.how...@frigidcode.com wrote: Hi. I was just

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Mateusz Kowalczyk
On 01/09/13 07:02, yi lu wrote: I want to know if it is possible that I use strings without . If I type *Preludefoo bar* which actually I mean *Preludefoo bar* However I don't want to type s. I have noticed if *bar* is predefined or it is a number, it can be used as arguments. But can

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Roman Cheplyaka
* Christopher Howard christopher.how...@frigidcode.com [2013-08-31 21:01:38-0800] Hi. I was just curious about something. In one of my math textbooks I see expressions like this f + g or (f + g)(a) where f and g are functions. What is meant is f(a) + g(a) Is there a way in

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Carter Schonwald
To clarify in Bobs remark : while you're still learning Haskell and the type system , things like lifted Num on functions can lead to some potentially confusing type errors. That said, it's absolutely doable, and can be a very nice / powerful tool when used appropriately. On Sunday, September 1,

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Christopher Howard
On 08/31/2013 09:27 PM, Charlie Paul wrote: I believe that this is what you want: http://www.haskell.org/haskellwiki/Num_instance_for_functions On Sat, Aug 31, 2013 at 10:01 PM, Christopher Howard christopher.how...@frigidcode.com wrote: The author seemed to be subtly mocking the idea. It

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-01 Thread Niklas Hambüchen
On 01/09/13 04:27, Mateusz Kowalczyk wrote: It doesn't have to be 1-to-1 but the features have to be expressible in both: it's useless if we have different features with one syntax but not the other. I don't find that useless. Markdown does not have definition lists, but we use a normal list

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Albert Y. C. Lai
On 13-09-01 02:02 AM, yi lu wrote: I have noticed if *bar* is predefined or it is a number, it can be used as arguments. But can other strings be used this way? Like in bash, we can use *ping 127.0.0.1* where *127.0.0.1* is an argument. Does Bash have a rich type system, like Haskell? Does

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Albert Y. C. Lai
On 13-09-01 02:41 AM, Mateusz Kowalczyk wrote: It's a bit like asking whether you can do addition everywhere by just typing the numbers to each other (no cheating and defining number literals as functions ;) ). To your horror, common math language does some of that. When 3 and ½ are typed

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Michael Sloan
Not that I really want to encourage such a stringly typed practice, but it wouldn't really be that much of a stretch. * Use haskell-src-exts[0] and haskell-src-meta[1] to make a quasiquoter that can parse Haskell syntax * Use syb[2] or some other generics to find VarE and ConE expressions. In

Re: [Haskell-cafe] Hoogle vs Hayoo

2013-09-01 Thread Neil Mitchell
Hi, Hoogle is definitely not deprecated. The reason you can't yet search all packages simultaneously is that it consumes too many resources - the number of Haskell packages exploded at a time when I wasn't able to spend enough time to allow Hoogle to keep up. It's definitely something on the todo

Re: [Haskell-cafe] Performance of delete-and-return-last-element

2013-09-01 Thread Harald Bögeholz
Am 31.08.13 14:35, schrieb Petr Pudlák: One solution would be to fold over a specific semigroup instead of a recursive function: |import Data.Semigroup import Data.Foldable(foldMap) import Data.Maybe(maybeToList) data Darle a =Darle {getInit :: [a],getLast ::a } deriving

Re: [Haskell-cafe] Compiler stops at SpecConstr optimization

2013-09-01 Thread Daniel Díaz Casanueva
Yes, that GHC ticket shows that this problem is well known. Thank you. On Fri, Aug 30, 2013 at 2:19 AM, Ben Lippmeier b...@ouroborus.net wrote: On 30/08/2013, at 2:38 AM, Daniel Díaz Casanueva wrote: While hacking in one of my projects, one of my modules stopped to compile for apparently

Re: [Haskell-cafe] On Markdown in Haddock and why it's not going to happen

2013-09-01 Thread Mateusz Kowalczyk
On 01/09/13 13:59, Niklas Hambüchen wrote: On 01/09/13 04:27, Mateusz Kowalczyk wrote: It doesn't have to be 1-to-1 but the features have to be expressible in both: it's useless if we have different features with one syntax but not the other. I don't find that useless. Markdown does not have

Re: [Haskell-cafe] Proposal: Polymorphic typeclass and Records

2013-09-01 Thread Wvv
Thanks! You do a great job! Adam Gundry wrote Haskell doesn't allow classes to be polymorphic in the names of their methods Yes, still not (( -- View this message in context: http://haskell.1045720.n5.nabble.com/Proposal-Polymorphic-typeclass-and-Records-tp5735096p5735365.html Sent from

[Haskell-cafe] Proposal: Generic conditions for 'if' and 'case'

2013-09-01 Thread Wvv
I think it is an old idea, but nevertheless. Now we have next functions: if (a :: Bool) then x else y case b of a1 :: Bool - x1 a2 :: Bool - x2 ... Let we have generic conditions for 'if' and 'case': class Boolean a where toBool :: a - Bool instance Boolean Bool where toBool = id

Re: [Haskell-cafe] Proposal: Generic conditions for 'if' and 'case'

2013-09-01 Thread Nicolas Trangez
I didn't test it, but you might want to look into the 'rebindable syntax' extension and its 'ifThenElse' feature. Nicolas On Sep 2, 2013 12:51 AM, Wvv vite...@rambler.ru wrote: I think it is an old idea, but nevertheless. Now we have next functions: if (a :: Bool) then x else y case b of

Re: [Haskell-cafe] function arithmetic?

2013-09-01 Thread Richard A. O'Keefe
On 1/09/2013, at 7:06 PM, Christopher Howard wrote: It seemed to be suggesting that a Num instance for functions would imply the need for constant number functions, which leads to difficulties. But I don't see why one would have to take it that far. You *cannot* make a type an instance of

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Richard A. O'Keefe
On 1/09/2013, at 6:02 PM, yi lu wrote: I want to know if it is possible that I use strings without . If I type Preludefoo bar which actually I mean Preludefoo bar However I don't want to type s. I have noticed if bar is predefined or it is a number, it can be used as arguments. But

Re: [Haskell-cafe] ANN: th-desugar simplifies Template Haskell processing

2013-09-01 Thread Richard Eisenberg
No, but I agree that this behavior is useful and in the spirit of th-desugar. I can add this to the next version, which should come out in a few days (tomorrow?), because I've noticed a bug with the scoping of as-patterns in let statements. Thanks for the suggestion! Richard On Aug 31, 2013,

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Rustom Mody
On Mon, Sep 2, 2013 at 5:43 AM, Richard A. O'Keefe wrote: A slogan I have programmed by since I first met C and recognised how vastly superior to PL/I it was for text manipulation _because_ it didn't have a proper string type is Strings are Wrong!. I wonder if you notice the irony in your

Re: [Haskell-cafe] Can I use String without in ghci?

2013-09-01 Thread Richard A. O'Keefe
On 2/09/2013, at 3:55 PM, Rustom Mody wrote: On Mon, Sep 2, 2013 at 5:43 AM, Richard A. O'Keefe wrote: A slogan I have programmed by since I first met C and recognised how vastly superior to PL/I it was for text manipulation _because_ it didn't have a proper string type is Strings are

<    2   3   4   5   6   7   8   9   10   11   >