Re: [Haskell-cafe] Either example

2013-02-06 Thread Alvaro Gutierrez
Often, Either is used to represent, exclusively, a value or a failure, in a more detailed way than Maybe can. For example, a function like `parse` ( http://hackage.haskell.org/packages/archive/parsec/latest/doc/html/Text-Parsec-Prim.html#v:parse), which is part of Parsec, might have a type like:

Re: [Haskell-cafe] ANN: monad-bool 0.1

2013-01-25 Thread Alvaro Gutierrez
A brief stylistic note: to me, defunct has a connotation similar to that of deprecated, just stronger; meaning, it implies something closer to NoLongerOnHackage rather than wren's more general NotOnHackage. In this case, the distinction is moot, because the code did happen to exist on Hackage, but

Re: [Haskell-cafe] ANN: LambdaCube 3D (purely functional rendering engine) is back in business

2012-09-08 Thread Alvaro Gutierrez
On Sat, Sep 8, 2012 at 4:39 AM, Patai Gergely patai_gerg...@fastmail.fm wrote: Hello all, We recently rebooted the LambdaCube project, which aims to provide a purely functional interface for GPU programming. The details and the background are described in our new blog [1], while the code can

Re: [Haskell-cafe] Over general types are too easy to make.

2012-09-04 Thread Alvaro Gutierrez
On Tue, Sep 4, 2012 at 5:14 AM, Andreas Abel andreas.a...@ifi.lmu.de wrote: I agree with Timothy. In the Agda code base, we have many occurrences of Timothy's pattern aux (OneSpecificConstructor args) = ... aux _ = __IMPOSSIBLE__ where __IMPOSSIBLE__

[Haskell-cafe] stripSuffix

2012-07-17 Thread Alvaro Gutierrez
Hi all -- Pardon me if this has been answered before: how come there's a stripPrefix in Data.List, but no matching stripSuffix? Thanks! Alvaro ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] stripSuffix

2012-07-17 Thread Alvaro Gutierrez
On Tue, Jul 17, 2012 at 11:34 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: Here are two other possible reasons. It's not just easier, stripPrefix pfx lst is *possible* as long as pfx is finite, even when lst is infinite. The same would not be true of a suffix stripper. Isn't this the case

Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-07-03 Thread Alvaro Gutierrez
On Tue, Jun 26, 2012 at 6:19 PM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: How would you implement this requirement in Haskell without changing the line amount (Leaf x) = x? The hflags library [http://hackage.haskell.org/package/hflags] seems to do that, however... (I actually

Re: [Haskell-cafe] Martin Odersky on What's wrong with Monads

2012-07-03 Thread Alvaro Gutierrez
On Thu, Jun 28, 2012 at 2:53 PM, Dominique Devriese dominique.devri...@cs.kuleuven.be wrote: 2012/6/27 Tillmann Rendel ren...@informatik.uni-marburg.de: How would you implement this requirement in Haskell without changing the line amount (Leaf x) = x? I may be missing the point here, but

Re: [Haskell-cafe] Threads and hGetLine

2012-04-28 Thread Alvaro Gutierrez
Hi -- I am not well-versed in Haskell-specific multi-threading, but usually there is a better way to do what you want that does not involve killing threads (which in most cases is bad idea.) For example, using non-blocking IO and e.g. a synchronized condition variable; hWaitForInput might work

Re: [Haskell-cafe] JSON library suggestions?

2012-04-25 Thread Alvaro Gutierrez
On Wed, Apr 25, 2012 at 10:42 PM, Richard O'Keefe o...@cs.otago.ac.nz wrote: Note that the conversion *IS* lossy in practice. If you send a JSON message to a Javascript program, or a Python program, or a Go program (if I am reading src/pkg/encoding/json/decode.go correctly) what you get will

Re: [Haskell-cafe] JSON library suggestions?

2012-04-24 Thread Alvaro Gutierrez
JSON numbers are not equivalent to JavaScript/ECMAScript numbers, even if they are nominally related; the key differences are that in JSON, numeric literals: (a) can have any non-zero number of digits, effectively making JSON numbers both unbounded and arbitrarily precise (though actual

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-23 Thread Alvaro Gutierrez
Thanks for the write-up -- it's been very helpful! On Mon, Apr 23, 2012 at 12:03 AM, wren ng thornton w...@freegeek.orgwrote: Consider one of my own libraries (chosen randomly via Safari's url autocompletion):

[Haskell-cafe] Correspondence between libraries and modules

2012-04-22 Thread Alvaro Gutierrez
Hi there, I've only dabbled in Haskell, so please excuse my ignorance: why isn't there a 1-to-1 mapping between libraries and modules? As I understand it, a library can provide any number of unrelated modules, and conversely, a single module could be provided by more than one library. I can see

Re: [Haskell-cafe] Correspondence between libraries and modules

2012-04-22 Thread Alvaro Gutierrez
Thanks for your response. On Sun, Apr 22, 2012 at 4:45 PM, Brandon Allbery allber...@gmail.comwrote: One reason: modules serve multiple purposes; one of these is namespacing, and in the case of interfaces to foreign libraries that may force a division that would otherwise not exist.