Re: [Haskell-cafe] Mathematics and Statistics libraries

2012-03-26 Thread Ketil Malde
Tom Doris tomdo...@gmail.com writes: If you're interested in UI work, ideally we'd have something similar to RStudio as an environment, a simple set of windows encapsulating an editor, a repl, a plotting panel and help/history, this sounds superficial but it really has an impact when you're

Re: [Haskell-cafe] What happened with goa package repo?

2012-03-26 Thread Christopher Done
On 26 March 2012 07:24, Dmitry Malikov malikov@gmail.com wrote: Cloning into bare repository '/usr/portage/distfiles/egit-src/goa.git'... fatal: The remote end hung up unexpectedly  * ERROR: dev-haskell/goa- failed (unpack phase):  *   git-2_initial_clone: can't fetch from

Re: [Haskell-cafe] Mathematics and Statistics libraries

2012-03-26 Thread Richard O'Keefe
On 26/03/2012, at 8:35 PM, Ketil Malde wrote: Just to clarify (since I think the original suggestion was mine), I don't want to copy R's data frame (which I never quite understood, anyway) A data.frame is - a record of vectors all the same length - which can be sliced and diced like a 2d

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Jerzy Karczmarczuk
Le 26/03/2012 02:41, Chris Smith a écrit : Of course there are rings for which it's possible to represent the elements as lists. Nevertheless, there is definitely not one that defines (+) = zipWith (+), as did the one I was responding to. What? The additive structure does not define a ring.

[Haskell-cafe] Execute only one step in Hood-Melville Real time queue.

2012-03-26 Thread Xinyu LIU
Hi, I read the Hood-Melville real time queue realization in [1]. There are 2 lists maintained in queue, front and rear. When the queue gets unbalanced due to push/pop, it amortized the f ++ reverse r incrementally to build the new front list based on the below mechanism reverse r = reverse' r []

Re: [Haskell-cafe] Using HaXml

2012-03-26 Thread Yves Parès
Thanks! Apparently some also have problems to find tutorials/help with HaXml [1]. I'm curious to hear how HaXml compares to HXT / HXML / TagSoup. I'm curious too. I've read that HXML is old and not longer maintained. I believe besides the rewriting of the API to use arrows, HaXml adds checking

[Haskell-cafe] difficulty building (some) TH packages with ghc-7.4.1

2012-03-26 Thread John Lato
Hello, I've run into an odd problem when building certain packages that use Template Haskell with GHC-7.4.1. For example, RepLib: $ cabal --version cabal-install version 0.13.3 using version 1.14.0 of the Cabal library $ cabal install -O2 -w ~/.ghc-7.4.1/bin/ghc RepLib --reinstall Resolving

[Haskell-cafe] ANN: Latest package versions on Hackage as JSON/JSONP

2012-03-26 Thread Simon Hengel
Hi, I provide a relation between /package name/ and /latest version/ on Hackage as both JSON and JSONP. http://www.typeful.net/~tbot/hackage/ This are static files, and they are regenerated whenever new packages are uploaded (with a delay of about one minute). Two simple usage examples are

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Jake McArthur
This is interesting because it seems to be a counterexample to the claim that you can lift any Num through an Applicative (ZipList, in this case). It seems like maybe that only works in general for monoids instead of rings? On Mar 25, 2012 8:43 PM, Chris Smith cdsm...@gmail.com wrote: Jerzy

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Chris Smith
Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: Le 26/03/2012 02:41, Chris Smith a écrit : Of course there are rings for which it's possible to represent the elements as lists.  Nevertheless, there is definitely not one that defines (+) = zipWith (+), as did the one I was responding

Re: [Haskell-cafe] good lightweight web-framework like sinatra?

2012-03-26 Thread dag.odenh...@gmail.com
On 21 March 2012 03:45, serialhex serial...@gmail.com wrote: i'm looking for something lightweight, that dosnt need it's own server, can easily run on cgi on an apache with minimal work, and dosn't have many dependancies. i was looking at yesod, but it is bigger than i need for my site (at

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Jerzy Karczmarczuk
Le 26/03/2012 16:31, Chris Smith a écrit : If you were asking about why there is no ring on [a] that defines (+) = zipWith (+), then here's why. By that definition, you have [1,2,3] + [4,5] = [5,7]. But also [1,2,42] + [4,5] = [5,7]. Addition by [4,5] is not one-to-one, so [4,5] cannot be

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Chris Smith
On Mon, Mar 26, 2012 at 10:18 AM, Jerzy Karczmarczuk jerzy.karczmarc...@unicaen.fr wrote: So, * the addition* is not invertible, why did you introduce rings ... My intent was to point out that the Num instance that someone suggested for Num a = Num [a] was a bad idea. I talked about rings

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread wren ng thornton
On 3/26/12 8:16 AM, Jake McArthur wrote: This is interesting because it seems to be a counterexample to the claim that you can lift any Num through an Applicative (ZipList, in this case). It seems like maybe that only works in general for monoids instead of rings? I'm not so sure about that.

[Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Ting Lei
Hi, I was writing a code trying to use MonadPlus to detect some error cases (representing missing values etc. in pure code). With the Maybe monad, I can do this: can0 :: (a - Maybe b) - a - Bool can0 f x = case f x of Nothing - False Just x - True And I

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Jeff Shaw
can :: (MonadPlus m) = (a - m b) - a - Bool can f x = case f x of mzero - False _ - True I got a warning: __testError.hs:31:11: Warning: Pattern match(es) are overlapped In a case alternative: _ - ... Ok, modules loaded: Main. The problem here is that

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Tobias Brandt
On 26 March 2012 20:33, Ting Lei tin...@hotmail.com wrote: can :: (MonadPlus m) = (a - m b) - a - Bool can f x = case f x of     mzero - False     _ - True In the first pattern `mzero' is just a variable and matches anything, as does `_'. So, naturally, both patterns overlap.

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread dag.odenh...@gmail.com
On 26 March 2012 21:11, Jeff Shaw shawj...@msu.edu wrote: can :: (MonadPlus m) = (a - m b) - a - Bool can f x = case f x of mzero - False _ - True I got a warning: __testError.hs:31:11: Warning: Pattern match(es) are overlapped In a case

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Antoine Latter
On Mon, Mar 26, 2012 at 1:33 PM, Ting Lei tin...@hotmail.com wrote: Hi, I was writing a code trying to use MonadPlus to detect some error cases (representing missing values etc. in pure code). With the Maybe monad, I can do this: can0 :: (a - Maybe b) - a - Bool can0 f x = case f x of

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Harry Terkelsen
Jeff, I don't think your code works in general, since it is not guaranteed that x' == mzero is allowed unless (m b) is an instance of Eq. I'm unsure if you are able to test for mzero in general. Harry On Mon, Mar 26, 2012 at 3:11 PM, Jeff Shaw shawj...@msu.edu wrote: can :: (MonadPlus m) =

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Roman Cheplyaka
* Ting Lei tin...@hotmail.com [2012-03-26 11:33:16-0700] I was writing a code trying to use MonadPlus to detect some error cases (representing missing values etc. in pure code). You are probably looking for the MonadError class. There's also the MonadLogic class (which allows to literally

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Erik Hesselink
On Mon, Mar 26, 2012 at 21:24, Antoine Latter aslat...@gmail.com wrote: On Mon, Mar 26, 2012 at 1:33 PM, Ting Lei tin...@hotmail.com wrote: Hi, I was writing a code trying to use MonadPlus to detect some error cases (representing missing values etc. in pure code). With the Maybe monad, I can

Re: [Haskell-cafe] ANN: Latest package versions on Hackage as JSON/JSONP

2012-03-26 Thread aditya bhargava
Looks cool! One suggestion: make it a webservice I can use like: typeful.net/~tbot/hackage/[package name] example: typeful.net/~tbot/hackage/aeson So that I don't have to download an 83k file for every request. Adit On Mon, Mar 26, 2012 at 4:12 AM, Simon Hengel s...@typeful.net wrote: Hi,

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Ting Lei
Hi Antoine and Tobias (and everyone else), Thanks a lot for your answers. They are really helpful Can you please show me how to use the (Eq m) constraint to do this? Also, my general question (probably novice-level) is that in monadic programming, you can convert not necessarily monadic codes

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Richard O'Keefe
On 27/03/2012, at 5:18 AM, Jerzy Karczmarczuk wrote: But I don't care about using (+) = zipWith (+) anywhere, outside of a programming model / framework, where you keep the sanity of your data. In my programs I KNEW that the length of the list is either fixed, or of some minimal size (or

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Antoine Latter
On Mon, Mar 26, 2012 at 4:25 PM, Ting Lei tin...@hotmail.com wrote: Hi Antoine and Tobias (and everyone else), Thanks a lot for your answers. They are really helpful Can you please show me how to use the (Eq m) constraint to do this? Also, my general question (probably novice-level) is that

Re: [Haskell-cafe] adding the elements of two lists

2012-03-26 Thread Jake McArthur
Well, ZipList's pure is indeed repeat, but there is nothing about ZipList restricting it to infinite lists. As long as pure is repeat, I'm pretty sure any other value can still be finite without violating Applicative's laws. On Mar 26, 2012 1:02 PM, wren ng thornton w...@freegeek.org wrote: On

[Haskell-cafe] Need a backup GSOC to apply for? Last minute new proposal -- memory reuse analysis for GHC

2012-03-26 Thread Ryan Newton
Hi potential GSOC'ers, If there are multiple students interested in the project you're applying to it's a good idea to put in more than one application. This is a project proposal that would focus on performance analysis -- in particular in reusing some of the tools for analyzing memory access

Re: [Haskell-cafe] Is there a generic way to detect mzero?

2012-03-26 Thread Chris Wong
On Tue, Mar 27, 2012 at 11:03 AM, Antoine Latter aslat...@gmail.com wrote: On Mon, Mar 26, 2012 at 4:25 PM, Ting Lei tin...@hotmail.com wrote: Hi Antoine and Tobias (and everyone else), Thanks a lot for your answers. They are really helpful Can you please show me how to use the (Eq m)

Re: [Haskell-cafe] good lightweight web-framework like sinatra?

2012-03-26 Thread aditya bhargava
Here's another Miku / Sinatra-like framework that looks interesting: https://github.com/xich/scotty From the README: My issue with miku is that it uses the Hack2 interface instead of WAI (they are analogous, but the latter seems to have more traction), and that it is written using a custom