[Haskell-cafe] Composing monads (sort of)

2006-12-16 Thread Mark Wassell
Hi, I have a set of functions: f1 :: DBRecord - Maybe Int f2 :: Int - IO Maybe DBRecord f3 :: DBRecord - Maybe Int The odd numbered functions are field accessors, accessing a field that might hold an identifier for another record. The even numbered functions are record fetch functions that

Re: [Haskell-cafe] Re: Aim Of Haskell

2006-12-16 Thread [EMAIL PROTECTED]
OK, there's the option of replacing working tools with hype. It worked for C++, and it worked for Java. Pity I don't have the slightest idea how to work up a hype for Haskell. Who would want such a hype? Why not simply start picking up fruits before the mainstream notices? ;-)

[Haskell-cafe] Why is this array use wrong?

2006-12-16 Thread Maurí­cio
Hi, I'm trying this in ghci: let b = array (1,33) [(i,False) | i - [1..33]] after :m Data.Array.IArray. It gives me that error message: interactive:1:8: No instance for (IArray a Bool) arising from use of `array' at interactive:1:8-12 Probable fix: add an instance

Re: [Haskell-cafe] Re: Aim Of Haskell

2006-12-16 Thread Bulat Ziganshin
Hello Joachim, Friday, December 15, 2006, 10:31:35 PM, you wrote: Because a mainstream language has more tools, more libraries, and an easier job search. once i've got job offer just because i know Haskell. although the job was nothing common with FP, he searched programmers on this maillist

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-16 Thread Bulat Ziganshin
Hello Felix, Thursday, December 14, 2006, 6:00:53 PM, you wrote: The program isn't that well written so the overflow did not surprise me, I expected that it might run out of memory. What did surprise me was the *stack* overflow. I do not use recursion in my program except for a couple of

Re: [Haskell-cafe] Re: Building the community

2006-12-16 Thread Bulat Ziganshin
Hello Joachim, Friday, December 15, 2006, 11:34:09 PM, you wrote: This problem affects all libraries, not just the Prelude. The only solution that I know is explicit version numbering: wxHaskell 5.3.1 needs the Prelude 3.1.574, and there's a respository somewhere (on the net or locally or

Re: [Haskell-cafe] Why is this array use wrong?

2006-12-16 Thread Marc A. Ziegert
b needs a type. [code] Prelude Data.Array.IArray :t array array :: (Ix i, IArray a e) = (i, i) - [(i, e)] - a i e Prelude Data.Array.IArray let b = array (1,33) [(i,False) | i - [1..33]] :: Array Int Bool Prelude Data.Array.IArray :t b b :: Array Int Bool Prelude Data.Array.IArray b array (1,33)

[Haskell-cafe] Re: Well-typed functions with nonexisting signatures [Was: type variable question]

2006-12-16 Thread apfelmus
[EMAIL PROTECTED] wrote: Is there a canonical example example that exhibits this behavior? Yes, it was discussed back in 2003. Here's the canonical form: g::(Show a,Show b) = a-b g = undefined --h :: Show a = b - a h x = g(h x) Both Hugs and GHC (in the pure Haskell98 mode!) are happy

Re: [Haskell-cafe] Composing monads (sort of)

2006-12-16 Thread Chris Eidhof
Hey Mark, How can I concisely compose these functions without having to write a cascade of case statements such as: case f1 rec1 of Nothing - return Nothing Just id1 - do rec2 - f2 id2 return $ case rec2 of

[Haskell-cafe] Re: [Haskel-cafe] Re: what are the points in pointsfree?

2006-12-16 Thread Steve Downey
I spent time working with cubic mappings. With two critical points, there are Julia sets that consist of infinitely many disconnected components that are still locally connected, corresponding two one critical point escaping and one falling into one of the basins of attraction. Of course that was

Re: [Haskell-cafe] Stack, Heap and GHC

2006-12-16 Thread Ian Lynagh
On Fri, Dec 15, 2006 at 10:05:38AM +, Felix Breuer wrote: On Thu, 14 Dec 2006 15:31:54 -0800, David Roundy [EMAIL PROTECTED] wrote: main = do putStrLn strict foldl1 print $ foldl1' (\a b - a + 1) $ [1..largenum] putStrLn lazy foldl1 print $ foldl1 (\a

[Haskell-cafe] Re: automonadization of code?

2006-12-16 Thread Chung-chieh Shan
Adam Megacz [EMAIL PROTECTED] wrote in article [EMAIL PROTECTED] in gmane.comp.lang.haskell.cafe: Is there any work on automatic translation of code in some tiny imperative language into Haskell code that uses the ST and/or IO monads (or perhaps even pure functional code)? Is it possible to

Re: [Haskell-cafe] Composing monads (sort of)

2006-12-16 Thread Pepe Iborra
Wait, there are two monads in scene here, IO and Maybe. The right solution is to compose them indeed. One could use the MaybeT monad transformer defined in the 'All about monads' tutorial [1], or we could just define the IOmaybe monad: import Data.Traversable (mapM) newtype IOMaybe a =

[Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Waldemar Biernacki
Hello! I'd like to start programming in Haskell. But as an industry programmer I have a hope to use Haskell in my every-day work. Big part of my every-day work are GUI applications (in MS-Windows) working with SQL databases (PostgreSQL on Linux servers). My question: Is there a TRUE

Re: [Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Duncan Coutts
On Sat, 2006-12-16 at 19:50 +0100, Waldemar Biernacki wrote: Hello! I'd like to start programming in Haskell. But as an industry programmer I have a hope to use Haskell in my every-day work. Big part of my every-day work are GUI applications (in MS-Windows) working with SQL databases

Re: [Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Mark Wassell
Hi, Take a look at http://www.haskell.org/haskellwiki/HGene which uses HSQL and Gtk2hs. I don't have any code to release yet - only parts work and the code is in an extreme state of flux; I am currently refactoring (see my post on monads). More generally you might be interested in the other

Re: [Haskell-cafe] Fwd: Build failure on FC6, ghc66

2006-12-16 Thread Ian Lynagh
Hi Conrad, On Mon, Dec 11, 2006 at 09:56:35AM +0900, Conrad Parker wrote: I received the following bug report from someone trying to build HOgg on Fedora Core 6 (FC6) with its ghc66 package. The build error is: Could not find module `Data.Map': it is a member of package base, which

Re: [Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Bryan Burgers
That said, if I was writing a GUI+database thing, which doesn't do a lot of substantial processing (more just Add/Edit/Delete buttons), I'd definately use C# over Haskell. Haskell can do this, but you are walking a relatively new path. On the other hand C# developers do this day in, day out, and

Re: [Haskell-cafe] Fwd: Build failure on FC6, ghc66

2006-12-16 Thread Ian Malone
On 16/12/06, Ian Lynagh [EMAIL PROTECTED] wrote: Hi Conrad, On Mon, Dec 11, 2006 at 09:56:35AM +0900, Conrad Parker wrote: I received the following bug report from someone trying to build HOgg on Fedora Core 6 (FC6) with its ghc66 package. The build error is: Could not find module

Re: Re: [Haskell-cafe] Composing monads (sort of)

2006-12-16 Thread Nicolas Frisby
Once I start needing to combine Maybe with other monads, I usually take a moment to generalize the appropriate Maybe parts to MonadError e m = m. Then we can just use the (ErrorT e IO) monad. Nick On 12/16/06, Pepe Iborra [EMAIL PROTECTED] wrote: Wait, there are two monads in scene here, IO

[Haskell-cafe] Re: Re : Aim Of Haskell

2006-12-16 Thread Joachim Durchholz
minh thu schrieb: With the arrival of Java, people get used to have scores of libraries which are 'right there', just 'part' of the java api. Actually, the importance of libraries predates Java. However, Java may have been the first language where writing the libraries was a conscious

[Haskell-cafe] Re: Aim Of Haskell

2006-12-16 Thread Joachim Durchholz
John Meacham schrieb: I think we need some sort of signal, to show that one means I understand why haskell doesn't allow this in general, but am interested in a compiler specific trick or some theoretical background on the issue rather than I am learning haskell and am somewhat confused due to

[Haskell-cafe] Re: I'd like start with Haskell, but...

2006-12-16 Thread Artem Gr
There are several GUI libs that were started but not maintained. The main ones that are maintained are Gtk2Hs and wxHaskell. There is no current release of Gtk2Hs or wxHaskell for GHC 6.6 on Windows (that i know about), in my opinion that means they are not supported enough to actually use.

Re: [Haskell-cafe] what are the points in pointsfree?

2006-12-16 Thread Dan Piponi
'Point free' is standard mathematical terminology for nothing more than the style of defining functions without making direct reference to the elements the functions act on. This style is exemplified by category theory and the reason it's called 'point free' rather than 'element free' is that

Re: [Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Joachim Breitner
Hi, Am Samstag, den 16.12.2006, 20:23 +0100 schrieb Duncan Coutts: I don't actually know of anyone using one of the GUI libs in combination with one of the DB libs. It's an obvious thing to do but you'll not find a lot of pre-existing examples or infrastructure to help you. Just for the

Re: [Haskell-cafe] I'd like start with Haskell, but...

2006-12-16 Thread Neil Mitchell
Hi Waldemar, The final aim of the aproach is to get a tool in which there will be no syntactic errors during modelling bussiness logic. Recently I've finished very primary version of the tool (0.001:-). Ah, now that sounds like Haskell might be good for :) Haskell isn't great at writing a

Re: [Haskell-cafe] Re: Aim Of Haskell

2006-12-16 Thread David Roundy
On Sat, Dec 16, 2006 at 10:40:10PM +0100, Joachim Durchholz wrote: John Meacham schrieb: I think we need some sort of signal, to show that one means I understand why haskell doesn't allow this in general, but am interested in a compiler specific trick or some theoretical background on the