Re: [Haskell-cafe] unable to load package `regex-posix-0.94.2' (On Vista x64)

2010-12-21 Thread Stephen Tetley
Maybe you want to hide the old version of regex-posix: ghc-pkg hide regex-posix-0.94.2 http://www.haskell.org/ghc/docs/7.0.1/html/users_guide/packages.html Note - I don't use cabal install myself so this might not be the right way to do things, however ghc-pkg hide ... is reversible with

Re: [Haskell-cafe] Data.Judy and StablePtr

2010-12-21 Thread Diego Souza
Thanks Gregory! Probably the solution would be recreating the FFI in a way that doesn't need the StablePtr. Not sure how to do this though. I'm going to test other things, like HashTable, before trying this. And let's see how it goes. ~dsouza On Mon, Dec 20, 2010 at 2:40 PM, Gregory Collins

[Haskell-cafe] Haskell Parse Tree

2010-12-21 Thread Jane Ren
Hi, Does anyone know how to get the parse tree of a piece of Haskell code? Any recommended documentation? Thanks ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] type class design

2010-12-21 Thread Jean-Marie Gaillourdet
Hi, sorry for answering to such an old thread. David Menendez d...@zednenem.com writes: On Fri, Oct 29, 2010 at 8:33 AM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Hi, Uwe Schmidt wrote: In the standard Haskell classes we can find both cases, even within a single class.

Re: [Haskell-cafe] Haskell Parse Tree

2010-12-21 Thread Serguey Zefirov
2010/12/21 Jane Ren j2...@ucsd.edu: Does anyone know how to get the parse tree of a piece of Haskell code? Any recommended documentation? ghc as a library? http://www.haskell.org/haskellwiki/GHC/As_a_library ___ Haskell-Cafe mailing list

[Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread John Smith
Monads seem to use fail in one of three ways: -Regular monads leave it at the default definition of error -MonadPlus sometimes redefines it to mzero -IO redefines it to failIO Are there any other definitions of fail? If not, does the special case of IO really need a class-level definition, or

[Haskell-cafe] Proof in Haskell

2010-12-21 Thread Patrick Browne
Hi, In a previous posting[1] I asked was there a way to achieve a proof of mirror (mirror x) = x in Haskell itself. The code for the tree/mirror is below: module BTree where data Tree a = Tip | Node (Tree a) a (Tree a) mirror :: Tree a - Tree a mirror (Node x y z) = Node (mirror z) y

[Haskell-cafe] ANNOUNCE: new version of uu-parsinglib:2.5.6

2010-12-21 Thread S. Doaitse Swierstra
An old problem popped up in the uu-parsinglib. When combining two parsers with |, it is checked to see which alternative accepts the shortest input; this is done in order to prevent infinite insertions, which may occur as a result of choosing a recursive alternative when inserting of some

Re: [Haskell-cafe] Haskell Parse Tree

2010-12-21 Thread Malcolm Wallace
The haskell-src-exts package? http://hackage.haskell.org/package/haskell-src-exts On 21 Dec 2010, at 09:35, Serguey Zefirov wrote: 2010/12/21 Jane Ren j2...@ucsd.edu: Does anyone know how to get the parse tree of a piece of Haskell code? Any recommended documentation? ghc as a

Re: [Haskell-cafe] Haskell Parse Tree

2010-12-21 Thread JP Moresmau
Also, Scion is a library that wraps the GHC API. It already provides things like search at location and retrieving the high level interesting elements for an outline. See http://code.google.com/p/scion-lib/ and https://github.com/JPMoresmau/scion (the outline code is only in the second repo).

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread Alberto Ruiz
Hi Phil, On 12/20/2010 10:49 PM, gutti wrote: Hi all, In Matlab the following line of code: V3 = V1.*(V20) (V20) gives a Bool-Vector with ones (trues) and zero's where elements of V2 are 0; Then this Bool vector is used to multiply all elements in V1 to zero where the condition V20 is not

[Haskell-cafe] Darcs failure

2010-12-21 Thread Andrew Coppin
I'm running a VM with Ubuntu 10.10 (Maverick Meerkat). I installed Darcs 2.4.4 using apt-get, but it keeps CONSTANTLY failing with the error message darcs: bug at src/URL.hs:246 compiled Sep 12 2010 20:24:56 Another possible bug in URL.waitNextUrl: curl_multi_perform() - no running handles

[Haskell-cafe] internal Haddock or GHC error: de-package: openBinaryFile:

2010-12-21 Thread Johannes Waldmann
Hi. I try to use haddock (2.8.1) but it breaks with haddock: internal Haddock or GHC error: de-package: openBinaryFile: does not exist (No such file or directory) Why would it want to read a file with the name de-package? (Is de related to the locale? But the error also happens with LC_ALL=C)

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread Henning Thielemann
On Tue, 21 Dec 2010, Alberto Ruiz wrote: Vectorized boolean operations are not yet implemented but I hope to get them ready soon, including a find function. In the meantime you can use zipVectorWith, as mentioned by Henning. I would not find it a great idea to support the MatLab style of

[Haskell-cafe] Installing snap-server with gnutls on OS X with Homebrew

2010-12-21 Thread Benedict Eastaugh
Hi -café, I installed Snap 0.3 last night on my Mac, and had some problems getting it to build with SSL support. This is just a quick note of the extra flags I had to pass in when installing it in case someone else has a setup similar to mine. These instructions presume that you are using the

[Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Aaron Gray
I have been trying to build the Scheme in 24 Hours on WikiBooks :- http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours http://jonathan.tang.name/files/scheme_in_48/code/listing10.hs But I am getting an error :- scheme.hs:289:6: `noMsg' is not a (visible) method of

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Jonathan Geddes
I'd love for the compiler to give an error (or maybe just a warning) in the case that I have a pattern match in a monad that just blows up (throws an exception) on a pattern match failure. Currently there's no way to know the behavior of failed pattern match failures without looking at the

Re: [Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Henning Thielemann
Aaron Gray schrieb: if I try importing them :- import Control.Monad.Error (noMsg, strMsg) I think it was moved to Control.Monad.Error.Class. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Lauri Alanko
On Tue, Dec 21, 2010 at 08:31:08AM -0700, Jonathan Geddes wrote: I'd love for the compiler to give an error (or maybe just a warning) in the case that I have a pattern match in a monad that just blows up (throws an exception) on a pattern match failure. You will be interested to know that

Re: [Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Daniel Fischer
On Tuesday 21 December 2010 16:40:38, Henning Thielemann wrote: Aaron Gray schrieb: if I try importing them :- import Control.Monad.Error (noMsg, strMsg) I think it was moved to Control.Monad.Error.Class. But it's still re-exported from Control.Monad.Error, so they ought to be in

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Johannes Waldmann
everything you ask for already was in Haskell ages ago: those were the days ... where the method in Functor method was called map, and zero was a method of, guess what, MonadZero... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Aaron Gray
On 21 December 2010 15:40, Henning Thielemann schlepp...@henning-thielemann.de wrote: Aaron Gray schrieb: if I try importing them :- import Control.Monad.Error (noMsg, strMsg) I think it was moved to Control.Monad.Error.Class. Great, importing Control.Monad.Error.Class does the

Re: [Haskell-cafe] Do we need Monad fail (or MonadFail)?

2010-12-21 Thread Jonathan Geddes
I'd be really interested in learning the rationale behind those changes. I'm sure it wasn't done for capricious or arbitrary reasons, but I can't help but see it as a step back. --Jonathan Geddes (sent from android mobile) On Dec 21, 2010 8:47 AM, Lauri Alanko l...@iki.fi wrote: On Tue, Dec 21,

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread aditya siram
I don't know the formal definition, but dependent types seem analogous to checking an invariant at runtime. -deech On Tue, Dec 21, 2010 at 5:53 AM, Patrick Browne patrick.bro...@dit.ie wrote: Hi, In a previous posting[1] I asked was there a way to achieve a proof of mirror (mirror x) = x in

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Iavor Diatchki
Hi Patrick, Indeed, you cannot really write proofs in Haskell because it is just an ordinary (more or less) programming language and not a theorem prover. (As an aside: you could write tests, i.e. properties which may or may not be theorems about your program, and test them on random data (see

[Haskell-cafe] ANN: The attosplit package splits lazy bytestrings lazily

2010-12-21 Thread Yitzchak Gale
This is a belated announcement of a package I uploaded to hackage last week. When processing a large input stream, one of the most important techniques is to split the input into smaller pieces and process each piece separately. If that large input stream happens to be a lazy bytestring, the

Re: [Haskell-cafe] type class design

2010-12-21 Thread David Menendez
On Tue, Dec 21, 2010 at 4:30 AM, Jean-Marie Gaillourdet j...@gaillourdet.net wrote: Hi, sorry for answering to such an old thread. David Menendez d...@zednenem.com writes: On Fri, Oct 29, 2010 at 8:33 AM, Tillmann Rendel ren...@informatik.uni-marburg.de wrote: Hi, Uwe Schmidt wrote:

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread austin seipp
Patrick, Dependent types are program types that depend on runtime values. That is, they are essentially a type of the form: f :: (a :: X) - T where 'a' is a *value* of type 'X', which is mentioned in the *type* 'T'. You do not see such things in Haskell, because Haskell separates values from

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Felipe Almeida Lessa
On Tue, Dec 21, 2010 at 3:57 PM, austin seipp a...@hacks.yi.org wrote: However, at one point I wrote about proving exactly such a thing (your exact code, coincidentally) in Haskell, only using an 'extraction tool' that extracts Isabelle theories from Haskell source code, allowing you to prove

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Daniel Fischer
On Tuesday 21 December 2010 19:34:11, Felipe Almeida Lessa wrote: Theorem mirror_mirror : forall A (x : Tree A), mirror (mirror x) = x. induction x; simpl; auto. rewrite IHx1; rewrite IHx2; trivial. Qed. Since mirror (mirror x) = x doesn't hold in Haskell, I take it that Coq doesn't

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Daniel Fischer
I wrote: On Tuesday 21 December 2010 19:34:11, Felipe Almeida Lessa wrote: Theorem mirror_mirror : forall A (x : Tree A), mirror (mirror x) = x. induction x; simpl; auto. rewrite IHx1; rewrite IHx2; trivial. Qed. Since mirror (mirror x) = x doesn't hold in Haskell, I take it that Coq

Re: [Haskell-cafe] Darcs failure

2010-12-21 Thread Jason Dagit
This question is more appropriate on the darcs-users mailing list. I've CC'd your message there. Jason On Tue, Dec 21, 2010 at 4:47 AM, Andrew Coppin andrewcop...@btinternet.comwrote: I'm running a VM with Ubuntu 10.10 (Maverick Meerkat). I installed Darcs 2.4.4 using apt-get, but it keeps

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Colin Paul Adams
Daniel == Daniel Fischer daniel.is.fisc...@googlemail.com writes: Daniel On Tuesday 21 December 2010 19:34:11, Felipe Almeida Lessa wrote: Theorem mirror_mirror : forall A (x : Tree A), mirror (mirror x) = x. induction x; simpl; auto. rewrite IHx1; rewrite IHx2; trivial.

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Daniel Fischer
On Tuesday 21 December 2010 20:11:37, Colin Paul Adams wrote: Daniel == Daniel Fischer daniel.is.fisc...@googlemail.com writes: Daniel On Tuesday 21 December 2010 19:34:11, Felipe Almeida Lessa wrote: Theorem mirror_mirror : forall A (x : Tree A), mirror (mirror x) = x.

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread gutti
Hi Henning, Hi Alberto, thanks for the quick and comprehensive help. - I managed to implement Hennings suggestion with mapVector and zipWithVector. -- However have a type inference problem with zipVectorWith -- probably a stupid beginners mistake. (have a look below). I want to look into the

Re: [Haskell-cafe] Problem with class Control.Monad.Error noMsg usage

2010-12-21 Thread Ross Paterson
On Tue, Dec 21, 2010 at 03:28:22PM +, Aaron Gray wrote: I have been trying to build the Scheme in 24 Hours on WikiBooks :- http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours http://jonathan.tang.name/files/scheme_in_48/code/listing10.hs But I am getting an error

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread Henning Thielemann
thanks for the quick and comprehensive help. - I managed to implement Hennings suggestion with mapVector and zipWithVector. -- However have a type inference problem with zipVectorWith -- probably a stupid beginners mistake. (have a look below). I want to look into the matrix thing as well, but

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread gutti
Hi Henning, Yes I just realised my mistake myself - I hand over the function instead of the result. A really facinating concept by the way. Thanks again for the Matrix notation - will give it a go right away now. And the manoever critics on the code is really nice. - Helps me a lot to embrace

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Brandon Moore
- Original Message From: Colin Paul Adams co...@colina.demon.co.uk To: Daniel Fischer daniel.is.fisc...@googlemail.com Cc: haskell-cafe@haskell.org Sent: Tue, December 21, 2010 1:11:37 PM Subject: Re: [Haskell-cafe] Proof in Haskell Daniel == Daniel Fischer

Re: [Haskell-cafe] Proof in Haskell

2010-12-21 Thread Felipe Almeida Lessa
On Tue, Dec 21, 2010 at 5:02 PM, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: On Tuesday 21 December 2010 19:34:11, Felipe Almeida Lessa wrote: Theorem mirror_mirror : forall A (x : Tree A), mirror (mirror x) = x.   induction x; simpl; auto.   rewrite IHx1; rewrite IHx2; trivial.

Re: [Haskell-cafe] Matlab Style Logic Operations ala V1.*(V20) on Vectors and Matrices with HMatrix ??

2010-12-21 Thread Henning Thielemann
On Tue, 21 Dec 2010, gutti wrote: One thing that still confuses me a litte: polynom: double - double -double polynom x y = y^2 + x^2 + 2*x*y Type declaration for this polynom with two inputs I guess you mean upper case Double, otherwise it's a type variable and the compiler will ask for

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-21 Thread Ryan Ingram
First, let's make some useful operations in your GeneratorState monad: -- State :: (s - (a,s)) - State s a -- random :: Random a = StdGen - (a, StdGen) genRandom :: Random a = GeneratorState a genRandom = State random -- similar genRandomR :: Random a = (a,a) - GeneratorState a genRandomR =

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-21 Thread michael rice
Thanks, Ryan. I rewrote it yesterday. Here's my updated version. Better? Michael == import Data.Functor (($)) import System.Random data Craps a = Roll a | Win a | Lose a deriving (Show) -- Returns an infinite list of die throws rollDice :: IO [Int] rollDice =  randomRs (1,6) $

Re: [Haskell-cafe] Why is Haskell flagging this?

2010-12-21 Thread michael rice
I changed your die function to rollDie in function roll2Dice (I assume that's what you meant) but get the errors listed below. Michael import Control.Monad.State import Control.Monad import System.Random type GeneratorState = State StdGen genRandom :: Random a =