Re: [Haskell-cafe] Problem building qtHaskell

2011-04-14 Thread Øystein Kolsrud
Thanks for the tip! I reinstalled everything from scratch here, and then I got it working. On Wed, Apr 13, 2011 at 2:26 AM, Mark Wright wrote: > On Tue, 12 Apr 2011 12:14:50 +0200, Øystein Kolsrud wrote: >> Hi! I am trying to install qtHaskell on a Windows 7 machine, but I am >> running into som

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Eduard Sergeev
Hi Dmitri, > *** Question: I wonder how to implement cache for this problem in Haskell? > At the moment, I am not so much interested in the speed of the code, as in > nice implementation. Yet another option for memoization implementation: to use "monad-memo" package [1] which provides memoization

Re: [Haskell-cafe] ghc7 bug? associated type + implicit parameters

2011-04-14 Thread Antoine Latter
Someone on the ghc-users list might have an idea. I recommend filing a bug report: http://hackage.haskell.org/trac/ghc/wiki/ReportABug Even if the behavior isn't wrong, in could use a better error message! Antoine 2011/4/14 Michal Konečný : > Hi, > > I have stumbled across some strange behaviou

Re: [Haskell-cafe] Experimental 64 bit installer fails

2011-04-14 Thread Andrew Pennebaker
I can confirm that Mark's Haskell 2011.2.0.0-x86_64 Mac OS X installer fix works :) cd /Library/Haskell/ghc-7.0.2/lib/registrations for c in *.conf; do echo == $c ==; ghc-pkg register --force $c; done My goal is to get Haskell ncurses working. c2hs is required, so I did: $ cabal --version cabal

Re: [Haskell-cafe] Experimental 64 bit installer fails

2011-04-14 Thread Mark Lentczner
Well that's no fun! The install looks like it mostly worked, execept that the final registration of the installed packages failed because for some reason the script has them out of order. You can "fix up" your install by doing this: cd /Library/Haskell/ghc-7.0.2/lib/registrations for c in *.conf;

[Haskell-cafe] ghc7 bug? associated type + implicit parameters

2011-04-14 Thread Michal Konečný
Hi, I have stumbled across some strange behaviour in ghc7. The following compiles fine with ghc 6.12.3: {-# LANGUAGE ImplicitParams #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE NoMonomorphismRestriction #-} module Test where class C t where type TF t ttt :: TF t -> t b :: (C t, ?x :

[Haskell-cafe] Experimental 64 bit installer fails

2011-04-14 Thread Andrew Pennebaker
I downloaded the experimental 64 bit installer for from Haskell Platform. It fails with the message "The installation failed." In case Haskell Platform i386 was interfering, I uninstalled it. But the 64 bit installer still yields "The installation fail

Re: [Haskell-cafe] Questioning seq

2011-04-14 Thread Albert Y. C. Lai
On 11-04-14 01:57 PM, Andrew Coppin wrote: 3. How is pseq different from seq? An example to show that there are non-unique evaluation orders to fulfill the mere strictness promise of seq: import Data.List(foldl') () & () = () main = print (foldl' (&) () (replicate 250 ())) with ghc with

Re: [Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Chris Dew
Thanks, that link's very relevant to what I'm trying. For the time being I'll accept a partial solution where the last two types are now the same, and try to improve it when my knowledge of Haskell improves. I really want ("hello" ->> bracket) in ("hello" ->> bracket ->> putStrLn) to have a type

Re: [Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Stephen Tetley
On 14 April 2011 20:35, Chris Dew wrote: > Could you suggest how these constraints could be expressed in the > Haskell type system? > Hi Chris I'm afriad I'd have to decline - generally in Haskell implicit "lifters" are problematic, so it isn't something I'd be looking to solve. There was a t

Re: [Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Chris Dew
@Stephen Tetley - The stream class exists simply to allow for the creation of a ->> operator which can be used to 'Stream' data through multiple pure and IO functions, on the way to some form of output. It's probably not a great idea, as there are more idiomatic solutions in Haskell - I'm sure some

Re: [Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Chris Dew
@Neil Brown - That did it. It's not the ideal solution, as all ->> are 'coerced' into being 'IO x' (if the rightmost term is an 'IO x'. But it'll do for the time being. Many thanks, Chris. On 14 April 2011 13:50, Neil Brown wrote: > On 14/04/11 13:00, Chris Dew wrote: >> >> class Stream a b c

Re: [Haskell-cafe] Questioning seq

2011-04-14 Thread austin seipp
As usual, I'm foolish and forget to hit 'reply to all'. Original message unedited below, so it can be sent to -cafe. To answer question #3, pseq and seq are semantically equivalent (indeed, if you look at the source for Control.Parallel, if you are not using GHC, pseq is defined as 'pseq = seq'.)

Re: [Haskell-cafe] Questioning seq

2011-04-14 Thread Janis Voigtländer
Am 14.04.2011 18:57:35 schrieb Andrew Coppin: A couple of questions: 1. Why is the existence of polymorphic seq bad? See http://www.iai.uni-bonn.de/~jv/acta.pdf, Sections 1 and 2 and pointers therein. Also, numerous discussions on this list over the years. Best, Janis. 2. Why would the exi

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Luke Palmer
On Thu, Apr 14, 2011 at 4:29 AM, Dmitri O.Kondratiev wrote: > 3n+1 is the first, "warm-up" problem at Programming Chalenges site: > > http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110101&format=html > > (This problem illustrates Collatz conjecture: > > http://en.wikipedi

[Haskell-cafe] Questioning seq

2011-04-14 Thread Andrew Coppin
A couple of questions: 1. Why is the existence of polymorphic seq bad? 2. Why would the existence of polymorphic rnf be worse? 3. How is pseq different from seq? That is all... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskel

[Haskell-cafe] parallel-haskell mailing list

2011-04-14 Thread Eric Y. Kow
Hi everybody, I thought I should point out that there is a mailing list dedicated to parallelism and concurrency in Haskell. The group exists to bring together the various groups in the Haskell community that are working on parallelism. It is intended to provide some visibility into the various e

[Haskell-cafe] Munich functional programmers' UG

2011-04-14 Thread Dr. Heinrich Hördegen
Dear all, last week, there have been thoughts to create a user group for functional programmers in Munich, Germany. People who are interessted can join the new mailing list: http://www.fs.lmu.de/cgi-bin/mailman/listinfo/high-order-munich The idea is to have meetings every now and then with

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Sebastian Fischer
Hi Dimitri, > When asking "how to implement cache in Haskell" I was hopping that there > exists some solution without using Data.Array, more "functional" approach, > if I may say so  ... Steven's second solution is purely functional. It uses so-called tries to cache results instead of mutable arr

Re: [Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Stephen Tetley
Hi Chris What does the Stream class *do* though? class Stream a b c d where (->>) :: a -> (b -> c) -> d Even with Neil's change its still quite unusual: class Stream a b c where (->>) :: a -> (b -> c) -> c In the first formulation there is an input of type a, a function (b -> c) and a

Re: [Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Neil Brown
On 14/04/11 13:00, Chris Dew wrote: class Stream a b c d where (->>) :: a -> (b -> c) -> d instance Stream (IO d) d (IO c) (IO c) where f ->> g = f>>= g instance Stream d d (IO c) (IO c) where f ->> g = g f instance Stream d d c c where x ->> y = y $ x I notice tha

[Haskell-cafe] Type Classes in Haskell - how can I make GHC make a choice of types, when the type chosen doesn't matter?

2011-04-14 Thread Chris Dew
This is a question about the use of type classes in Haskell. I get an error (below) when trying to compile the code (below and at https://github.com/chrisdew/haskell-sandbox/blob/master/not_working_but_clean.hs ). As someone just learning Haskell, I have tried following GHC's advice, but I think

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Christian Maeder
Am 14.04.2011 12:29, schrieb Dmitri O.Kondratiev: 3n+1 is the first, "warm-up" problem at Programming Chalenges site: http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110101&format=html

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Dmitri O.Kondratiev
Thanks, everybody! Your feedback is a great food for my mind (as Lewis Carroll once wrote :) When asking "how to implement cache in Haskell" I was hopping that there exists some solution without using Data.Array, more "functional" approach, if I may say so ... I must be wrong, though (need more ti

Re: [Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Angel de Vicente
Hi, On 14/04/11 12:16, Dmitri O.Kondratiev wrote: Angel, thanks! This site looks good. Do you know if "spoj.pl " has a search utility for problems? It would be great if they have 3n+1 problem I wrote about in a separate thread here. yes they have a search utility. Searching for

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Ryan Ingram
So if we were to emulate your Java solution, we'd do import Data.Array cacheSize :: Int cacheSize = 65536 table :: Array Int Integer table = listArray (1,cacheSize) (1 : map go [2..cacheSize]) where go n | even n = 1 + lookup (n `div` 2) | otherwise = 1 + lookup (3 * n + 1)

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Dmitri O.Kondratiev
Thanks, Felipe! Sure I will try to code solution myself. Doing it all by yourself is the main fun of everything, isn't it? I was just asking about the *idea* of implementing cache in Haskell, in general, not just in this case only. On Thu, Apr 14, 2011 at 3:11 PM, Felipe Almeida Lessa < felipe.le.

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Steven Keuchel
Hi Dmitri, As a reference you might want to take a look at the Project Euler problem #14 and the corresponding dubious entry in the HaskellWiki: http://www.haskell.org/haskellwiki/Euler_problems/11_to_20#Problem_14 . > *** Question: I wonder how to implement cache for this problem in Haskell? > A

[Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Dmitri O.Kondratiev
Angel de Vicente wrote: On 14/04/11 10:29, Dmitri O.Kondratiev wrote: >* I am looking for a site providing on-line automatic judge for *>* Programming Challenges that can be coded in Haskell. *>* For example this site: *>* http://www.programming-challenges.com *>* provides lots of interesting prog

Re: [Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Felipe Almeida Lessa
This is very similar to the Problem 14 on Project Euler [1]. Should you really want a nice solution in Haskell, and noting that this is a big spoiler, there are some on the wiki [2]. But I highly recommend you to try coding your own solutions before looking at the site =). Cheers! [1] http://pr

Re: [Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Mats Rauhala
http://codechef.com accepts Haskell entries. pgpa3li6zz0gF.pgp Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] Programming Chalenges: The 3n+1 problem

2011-04-14 Thread Dmitri O.Kondratiev
3n+1 is the first, "warm-up" problem at Programming Chalenges site: http://www.programming-challenges.com/pg.php?page=downloadproblem&probid=110101&format=html (This problem illustrates Collatz conjecture: http://en.wikipedia.org/wiki/3n_%2B_1#Program_to_calculate_Collatz_sequences ) As long as t

Re: [Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Pedro Vasconcelos
On Thu, 14 Apr 2011 13:29:48 +0400 "Dmitri O.Kondratiev" wrote: > Hello, > I am looking for a site providing on-line automatic judge for > Programming Challenges that can be coded in Haskell. > For example this site: > http://www.programming-challenges.com > provides lots of interesting programmi

Re: [Haskell-cafe] IO and Cont as monads

2011-04-14 Thread Roel van Dijk
On 13 April 2011 21:26, Tim Chevalier wrote: > IO doesn't obey the monad laws, due to the presence of seq in Haskell. > Sad but true... See also a previous discussion about IO and the Monad laws: http://www.haskell.org/pipermail/haskell-cafe/2010-March/074001.html __

Re: [Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Angel de Vicente
Hi On 14/04/11 10:29, Dmitri O.Kondratiev wrote: I am looking for a site providing on-line automatic judge for Programming Challenges that can be coded in Haskell. For example this site: http://www.programming-challenges.com provides lots of interesting programming provlems: http://www.programmi

[Haskell-cafe] Haskell on-line judge for Programming Challenges / Contests ?

2011-04-14 Thread Dmitri O.Kondratiev
Hello, I am looking for a site providing on-line automatic judge for Programming Challenges that can be coded in Haskell. For example this site: http://www.programming-challenges.com provides lots of interesting programming provlems: http://www.programming-challenges.com/pg.php?page=index Yet, unf

Re: [Haskell-cafe] Template Haskell tutorials?

2011-04-14 Thread Zoe Clifford
On Wed, Apr 13, 2011 at 10:43 PM, Kenneth Hoste wrote: > Hi, > The links to the supposedly brilliant Template Haskell tutorials by Bulat are > broken. > > http://www.haskell.org/bz/thdoc.htm > http://www.haskell.org/bz/th3.htm > > Does anyone know if these tutorials moved to somewhere else? > > g