Re: [Haskell-cafe] May all logos be freely used?

2009-05-27 Thread Jeff Wheeler
On Tue, 2009-05-26 at 18:36 +0200, Max Rabkin wrote: So at least any logos on the wiki should be usable under that license. Furthermore, I released all my logos (the lambda/bind combination that won) into the Public Domain. Of course, derive from them as you wish, and there are a couple of

Re: [Haskell-cafe] Re: I love purity, but it's killing me.

2009-05-27 Thread Paul L
Let-expression in the EDSL indeed solves the sharing problem, but only partially. Recursion appears when you have a leaf node pointing back to the root node or another branch and forming a cyclic graph in the data structure. It is often desirable to recover cyclic sharing when

[Haskell-cafe] Re: Purely logical programming language

2009-05-27 Thread Sebastian Fischer
On May 27, 2009, at 1:01 AM, Ahn, Ki Yung wrote: By the way, did Curry solved the problem of how to deal with IO and backtracking issues? (where and where not should IO happen kind of a thing) Curry uses the IO monad to specify where IO actions may happen. Non- determinism is not

Re: [Haskell-cafe] Re: I love purity, but it's killing me.

2009-05-27 Thread Paul L
BTW, I doubt the (cyclic) sharing problem relates that much to purity, because in an impure language (or the unsafe observable sharing), you still have to remember whether something has been traversed or not and in the worst case accumulates everything that's been traversed so far before releasing

[Haskell-cafe] Timing pure functions?

2009-05-27 Thread Magnus Therning
Yesterday I spent about 5 minutes trying to time a single function in haskell (after having spent about 30 minutes on the timeit module in Python). I found timeit[1] on Hackage but it only times an IO computation once, what I'd like to do is time a pure function several times. Timing it once was

Re: [Haskell-cafe] Timing pure functions?

2009-05-27 Thread Andrew Butterfield
Magnus Therning wrote: timeIt times ioa = let timeOnce = do t1 - getCPUTime a - ioa t2 - getCPUTime let t = fromIntegral (t2-t1) * 1e-12 return t in sequence $ take times $ repeat timeOnce main = do

Re: [Haskell-cafe] Timing pure functions?

2009-05-27 Thread Magnus Therning
On Wed, May 27, 2009 at 9:59 AM, Andrew Butterfield andrew.butterfi...@cs.tcd.ie wrote: Magnus Therning wrote:  timeIt times ioa = let          timeOnce = do              t1 - getCPUTime              a - ioa              t2 - getCPUTime              let t = fromIntegral (t2-t1) * 1e-12    

Re: [Haskell-cafe] Purely logical programming language

2009-05-27 Thread Matthias Görgens
Mercury also has type classes and other Haskellisms, so if you're interested in doing Prolog the Haskell way, you should definitely have a look at it. I have to admit that I am not very familiar with Mercury. But if you are looking for doing Prolog the Haskell way advertiseyou can also have

Re: [Haskell-cafe] Timing pure functions?

2009-05-27 Thread austin s
Excerpts from Magnus Therning's message of Wed May 27 03:51:19 -0500 2009: Yesterday I spent about 5 minutes trying to time a single function in haskell (after having spent about 30 minutes on the timeit module in Python). I found timeit[1] on Hackage but it only times an IO computation once,

RE: [Haskell-cafe] The essence of my monad confusion

2009-05-27 Thread Paul Keir
Thanks for all the help. The simplified example indeed threw away too much. There were no side effects. Brent, of course I couldn't create your function; though I gained through trying. I then found it useful to consider the type of: fmap (\x - putStrLn x) getLine which is IO (IO ()) and hence

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Sebastiaan Visser
On May 27, 2009, at 1:49 AM, Conal Elliott wrote: Hi Tom, I've been working on another code-generating graphics compiler, generating GPU code. As always, I run into the problem of efficient common subexpression elimination. In Pan, Vertigo Pajama, I used lazy memoization, using stable

Re: [Haskell-cafe] Bidirectional programming in Haskell

2009-05-27 Thread Artyom Shalkhakov
Hi, 2009/5/26 Shin-Cheng Mu s...@iis.sinica.edu.tw: Some of the early work in the PSD project (closely related to the lenses) were developed in Haskell,  http://www.iis.sinica.edu.tw/~scm/2007/inv/ It is not in active maintenance now, but if you are interested in doing something with it,

RE: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Sittampalam, Ganesh
Sebastiaan Visser wrote: On May 27, 2009, at 1:49 AM, Conal Elliott wrote: Hi Tom, I've been working on another code-generating graphics compiler, generating GPU code. As always, I run into the problem of efficient common subexpression elimination. In Pan, Vertigo Pajama, I used lazy

Re: [Haskell-cafe] Timing pure functions?

2009-05-27 Thread Johan Tibell
On Wed, May 27, 2009 at 12:02 PM, austin s a...@nijoruj.org wrote: Perhaps benchpress would be more to your liking: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/benchpress Note that since benchpress measures every single invocation of the provided IO action in order to

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Sebastiaan Visser
On May 27, 2009, at 12:51 PM, Sittampalam, Ganesh wrote: Sebastiaan Visser wrote: ... But again, I might be missing some important point here. That's exactly right. But it's pretty inconvenient to have your expression tree to blow up exponentially in relation to the code the user actually

[Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Sebastiaan Visser
Hello, While playing with embedded domain specific languages in Haskell I discovered the Num type class is a really neat tool. Take this simple example embedded language that can embed primitives from the output language and can do function application. data Expr :: * - * where Prim ::

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Edsko de Vries
+1. I agree completely, I've missed this often for exactly the same reasons. Edsko ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Miguel Mitrofanov
And I would certainly celebrate when if b then x else y expression becomes polymorphic in b. Edsko de Vries wrote on 27.05.2009 17:33: +1. I agree completely, I've missed this often for exactly the same reasons. Edsko ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Bool as type class to serve EDSLs.

2009-05-27 Thread Jason Dusek
2009/05/27 Miguel Mitrofanov miguelim...@yandex.ru: And I would certainly celebrate when if b then x else y expression becomes polymorphic in b. class Boolean b where fromBoolean :: b - Bool -- Jason Dusek ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Conal Elliott
Hi Wren, I considered the idea of hashing, but not *perfect* hashing. I don't know how to hash perfectly with something like expressions, which have infinitely many values. Since it's stateful, that means the smart constructors may need to be in an appropriate monad/applicative for passing the

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Conal Elliott
What do you mean with `exponential behavior'? Exponential related to what? I mean that the size of the observable tree can be exponential in the size of the unobservable dag representation. So the problem seems not to be CSE algorithm, but the fact that EDSL itself tends to blow up because

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Conal Elliott
In my experience [1], observable sharing using GHC's stable names is a pretty effective solution to this problem. Plus unsafePerformIO and weak references as in *Stretching the storage manager: weak pointers and stable names in Haskellhttp://citeseer.ist.psu.edu/peytonjones99stretching.html

Re: [Haskell-cafe] Lazy Parsing

2009-05-27 Thread Henning Thielemann
GüŸnther Schmidt schrieb: Hi all, is it possible to do lazy parsing with Parsec? I understand that one can do that with polyparse, don't know about uulib, but I happen to be already somewhat familiar with Parsec, so before I do switch to polyparse I rather make sure I actually have to.

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Conal Elliott
I just remembered: Andy Gill has a new paper Type Directed Observable Sharing (http://www.ittc.ku.edu/~andygill/paper.php?label=DSLExtract09) that looks very relevant. Abstract: Haskell is a great language for writing and supporting embedded Domain Specific Languages (DSLs). Some form of

[Haskell-cafe] Facebook puzzles allow for GHC solutions

2009-05-27 Thread David Leimbach
Interesting: http://www.facebook.com/careers/puzzles.php So they use Haskell at Facebook? Dave ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] Timing pure functions?

2009-05-27 Thread wren ng thornton
Johan Tibell wrote: austin s wrote: Perhaps benchpress would be more to your liking: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/benchpress Note that since benchpress measures every single invocation of the provided IO action in order to compute percentiles it's not good at

[Haskell-cafe] Stack overflow

2009-05-27 Thread Krzysztof Skrzętnicki
Hello Cafe I'm currently writing an app with heavy use of message passing. To see which messages takes most of the bandwidth I wrote the following code: -- data Counter = CNT !Int !Int !Int !Int cntMsg (CNT a b c d) (MoveOther _ _) = (CNT a+1 b c d) cntMsg (CNT a b c d) (MoveSelf _) = (CNT a

Re: [Haskell-cafe] Facebook puzzles allow for GHC solutions

2009-05-27 Thread Mattias Bengtsson
On Wed, 2009-05-27 at 08:20 -0700, David Leimbach wrote: Interesting: http://www.facebook.com/careers/puzzles.php So they use Haskell at Facebook? They could very well be having ghc installed on their puzzle test server without using it elsewhere. They got my attention though. Perhaps

RE: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread Sittampalam, Ganesh
Yes, though we don't bother with weak pointers as we only keep the stable names map around for the duration of CSE so there's no ongoing memory leak issue. From: haskell-cafe-boun...@haskell.org [mailto:haskell-cafe-boun...@haskell.org] On Behalf Of Conal

[Haskell-cafe] Beginner SOS

2009-05-27 Thread Manu Gupta
Dear anyone,I wish to learn HASKELL. However my institution does not teach it so plus I don't have a clue how to get around with it. Everything seems so unconventional and out of place Can you help me out in getting good tutorials that will help me to learn HASKELL by myself so that I can pursue

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Cristiano Paris
On Wed, May 27, 2009 at 7:14 PM, Manu Gupta manugu...@gmail.com wrote: Dear anyone, I wish to learn HASKELL. That's good for you. However my institution does not teach it so plus I don't have a clue how to get around with it. Everything seems so unconventional and out of place I know that

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Max Rabkin
Hi Manu Depending on your style, you might prefer Real World Haskell (available online or in print) or Learn You A Haskell (http://learnyouahaskell.com/). Of course, there are others, but my personal preference is for LYAH. --Max On Wed, May 27, 2009 at 7:14 PM, Manu Gupta manugu...@gmail.com

Re: [Haskell-cafe] Facebook puzzles allow for GHC solutions

2009-05-27 Thread David Leimbach
On Wed, May 27, 2009 at 9:34 AM, Mattias Bengtsson moonl...@dtek.chalmers.se wrote: On Wed, 2009-05-27 at 08:20 -0700, David Leimbach wrote: Interesting: http://www.facebook.com/careers/puzzles.php So they use Haskell at Facebook? They could very well be having ghc installed on

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Thomas DuBuisson
Manu, Did you skip over the dozens of links at haskell.org answering exactly these questions? There are links to some great tutorials [1] and IRC information where you can get real-time help [2]. Also there are some good books [3]. I think most recent learners learned from YAHT [4], Gentle

Re: [Haskell-cafe] Facebook puzzles allow for GHC solutions

2009-05-27 Thread Rick R
They are the creators of Thrift which they created for internal use and then published/open-sourced.. It is a multi-language RPC API/Service. When it went public, one of the languages interfaces they provided was Haskell. So yes. They use Haskell somewhere inside Facebook. On Wed, May 27, 2009

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Daniel Fischer
Am Mittwoch 27 Mai 2009 19:14:15 schrieb Manu Gupta: Dear anyone,I wish to learn HASKELL. Good :) However my institution does not teach it Bad :( so plus I don't have a clue how to get around with it. Everything seems so unconventional and out of place Can you help me out in getting good

[Haskell-cafe] Updating HsJudy to work with the latest Judy

2009-05-27 Thread Robin Green
I would like to use the HsJudy bindings to the Judy high-performance trie library (on hackage), but unfortunately they have bitrotted. I can have a go at mending them but I have no experience with FFI. Any tips? -- Robin ___ Haskell-Cafe mailing list

[Haskell-cafe] We tried this functional, higher-order stuff with LISP and look what happened...

2009-05-27 Thread Jason Dusek
What can we say to that? I'm well practiced in handling those who reject types outright (Python programmers), those who reject what is too different (C programmers), those who can not live without objects (Java programmers), those who insist we must move everything to message passing

Re: [Haskell-cafe] I love purity, but it's killing me.

2009-05-27 Thread wren ng thornton
Conal Elliott wrote: Hi Wren, I considered the idea of hashing, but not *perfect* hashing. I don't know how to hash perfectly with something like expressions, which have infinitely many values. An imperfect hash can work. You'll need a memo table with a source of unique symbols (e.g.

Re: [Haskell-cafe] Stack overflow

2009-05-27 Thread Bertram Felgenhauer
Krzysztof Skrzętnicki wrote: The code for modifying the counter: (\ msg - atomicModifyIORef ioref (\ cnt - (cntMsg cnt msg,( atomicModifyIORef does not force the new value of the IORef. If the previous contents of the IORef is x, the new contents will be a thunk, (\ cnt - (cntMsg cnt

Re: [Haskell-cafe] Updating HsJudy to work with the latest Judy

2009-05-27 Thread Bryan O'Sullivan
On Wed, May 27, 2009 at 11:02 AM, Robin Green gree...@greenrd.org wrote: I would like to use the HsJudy bindings to the Judy high-performance trie library (on hackage), but unfortunately they have bitrotted. I can have a go at mending them but I have no experience with FFI. Any tips? Just

Re: [Haskell-cafe] Facebook puzzles allow for GHC solutions

2009-05-27 Thread Bulat Ziganshin
Hello David, Wednesday, May 27, 2009, 7:20:33 PM, you wrote: Interesting: http://www.facebook.com/careers/puzzles.php So they use Haskell at Facebook? actually, of 5 compiled languages there, 3 are FP, and only 2 remaining are the most popular languages on planet - C++ and Java so this

Re: [Haskell-cafe] Stack overflow

2009-05-27 Thread Bertram Felgenhauer
I wrote: Krzysztof Skrzętnicki wrote: The code for modifying the counter: (\ msg - atomicModifyIORef ioref (\ cnt - (cntMsg cnt msg,( atomicModifyIORef does not force the new value of the IORef. If the previous contents of the IORef is x, the new contents will be a thunk,   (\ cnt -

Re: [Haskell-cafe] Stack overflow

2009-05-27 Thread Krzysztof Skrzętnicki
2009/5/27 Bertram Felgenhauer bertram.felgenha...@googlemail.com: I wrote: Krzysztof Skrzętnicki wrote: The code for modifying the counter: (\ msg - atomicModifyIORef ioref (\ cnt - (cntMsg cnt msg,( atomicModifyIORef does not force the new value of the IORef. If the previous contents

RE: [Haskell-cafe] Template Haskell very wordy w/r/t Decs and Types

2009-05-27 Thread Simon Peyton-Jones
Folks Quite a few people have asked for splices in Template Haskell *types*, and I have finally gotten around to implementing them. So now you can write things like instance Binary $(blah blah) where ... or f :: $(wubble bubble) - Int as requested, for example, in the message

RE: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Simon Peyton-Jones
Claus made a suggestion about type error messages: | Apart from bracketing fully applied type synonyms, the error message | could be improved by providing the missing bit of information about | 'Memo': | | D:\home\Haskell\tmp\desktop\types.hs:11:11: | Couldn't match expected type

Re: [Haskell-cafe] trying to understand space leaks....

2009-05-27 Thread Daryoush Mehrtash
So long as the [s] is a fixed list (say [1,2,3,4]) there is no space leak.My understanding was that the space leak only happens if there is computation involved in building the list of s. Am I correct? If so, I still don't have any feeling for what needs to be saved on the heap to be

Re: [Haskell-cafe] Template Haskell very wordy w/r/t Decs and Types

2009-05-27 Thread Miguel Mitrofanov
On 27 May 2009, at 23:38, Simon Peyton-Jones wrote: Folks Quite a few people have asked for splices in Template Haskell *types*, and I have finally gotten around to implementing them. So now you can write things like instance Binary $(blah blah) where ... or f :: $(wubble

RE: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Sittampalam, Ganesh
Simon Peyton-Jones wrote: NoMatchErr.hs:20:11: Couldn't match expected type `Memo d' against inferred type `Memo d1' NB: `Memo' is a (non-injective) type function In the second argument of `(.)', namely `appl' In the expression: abst . appl In the

Re[2]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Bulat Ziganshin
Hello Simon, Wednesday, May 27, 2009, 11:42:22 PM, you wrote: while we are here - i always had problems understanding what is inferred and what is expected type. may be problem is just that i'm not native speaker are other, especially beginners, had the same problem? Claus made a suggestion

Re: [Haskell-cafe] About the lazy pattern

2009-05-27 Thread Bulat Ziganshin
Hello 张旭, Wednesday, May 27, 2009, 11:51:34 PM, you wrote: Hi, I am really new to haskell. I am reading A gentle instruction to haskell now. And I just cannot understand the chapter below. Is there anybody who can gives me some hints about why the pattern matching for client is so early?

Re: Re[2]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Max Rabkin
On Wed, May 27, 2009 at 9:59 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Simon, Wednesday, May 27, 2009, 11:42:22 PM, you wrote: while we are here - i always had problems understanding what is inferred and what is expected type. may be problem is just that i'm not native

Re: [Haskell-cafe] We tried this functional, higher-order stuff with LISP and look what happened...

2009-05-27 Thread Tord Romstad
Hi all, Time to delurk. I'm a Lisper and mathematician who has been reading this group for about a year, but I haven't posted until now. On Wed, May 27, 2009 at 8:31 PM, Jason Dusek jason.du...@gmail.com wrote:  What can we say to that? I'm well practiced in handling those  who reject types

Re[4]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Bulat Ziganshin
Hello Max, Thursday, May 28, 2009, 12:14:50 AM, you wrote: As to whether it's confusing, I sometimes have to read these messages a few times (sometimes it's unclear which expression is being referred to, or why GHC thinks that the expression has a certain type), but the words themselves are

Re: [Haskell-cafe] Updating HsJudy to work with the latest Judy

2009-05-27 Thread Don Stewart
bos: On Wed, May 27, 2009 at 11:02 AM, Robin Green gree...@greenrd.org wrote: I would like to use the HsJudy bindings to the Judy high-performance trie library (on hackage), but unfortunately they have bitrotted. I can have a go at mending them but I have no experience with FFI.

[Haskell-cafe] platform/cabal problems

2009-05-27 Thread Johannes Waldmann
Hi all. I've written some Haskell program, and I wanted to give it to a friend, in source form, so he can run and modify it, and learn some Haskell while doing so. I was using some cabalized extra packages but hey, this looks like the typical use case for the haskell-platform. So: I told him to

Re: Re[4]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Max Rabkin
On Wed, May 27, 2009 at 10:28 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: can you recall early times of your work with GHC? i think that these words are non-obvious for novices. finally it becomes part of your instincts as anything else often used. but it can be learning barrier.

[Haskell-cafe] Who takes care of Haskell mailing lists?

2009-05-27 Thread Maurício
Hi, I would like to create a mailing list for Portuguese speaking Haskell programmers. I tried checking haskell.org mailing lists page, but the only contact e-mail I see is 'mail...@haskell.org', and a message sent to that address is replied with an automatic message saying I'm not authorized to

Re: [Haskell-cafe] Introducing Instances in GHC point releases

2009-05-27 Thread Henning Thielemann
On Sun, 24 May 2009, Ketil Malde wrote: Duncan Coutts duncan.cou...@worc.ox.ac.uk writes: The PVP says: 1. If any entity was removed, or the types of any entities or the definitions of datatypes or classes were changed, or instances were added

Re[6]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Bulat Ziganshin
Hello Max, Thursday, May 28, 2009, 12:49:20 AM, you wrote: I don't remember having any trouble, but that was a few years ago, and type errors are confusing generally. I think that the main difficulty with type errors is not the error *messages*, but I'm sure there is room for improvement.

[Haskell-cafe] Type class context propagation investigation

2009-05-27 Thread Paul Keir
Hi, How does the context of a class instance declaration affect its subclasses? The Num class instance outlined below has its requirement for Eq and Show satisfied on the preceding lines, and the code will compile. But if I, say, add an (Eq a) constraint to the Eq instance, in preparation for

Re: [Haskell-cafe] Design in Haskell?

2009-05-27 Thread Henning Thielemann
Dan schrieb: Hi, When I was learning to program in imperative languages like Java, there were plenty of resources to learn from about how to design large programs. Ideas like the GoF Design Patterns gave useful models that one could then scale up. You will also find remarks on good

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Brent Yorgey
On Wed, May 27, 2009 at 10:39:20AM -0700, Thomas DuBuisson wrote: Manu, Did you skip over the dozens of links at haskell.org answering exactly these questions? There are links to some great tutorials [1] and IRC information where you can get real-time help [2]. Also there are some good

Re: [Haskell-cafe] Facebook puzzles allow for GHC solutions

2009-05-27 Thread Gaius Hammond
On 27 May 2009, at 19:45, Bulat Ziganshin wrote: actually, of 5 compiled languages there, 3 are FP, and only 2 remaining are the most popular languages on planet - C++ and Java so this list shows their huge respect to FP It is well known that Facebook are heavy Erlang users.

Re: [Haskell-cafe] Lazy Parsing

2009-05-27 Thread Henning Thielemann
On Wed, 27 May 2009, Gü?nther Schmidt wrote: is it possible to do lazy parsing with Parsec? I understand that one can do that with polyparse, don't know about uulib, but I happen to be already somewhat familiar with Parsec, so before I do switch to polyparse I rather make sure I actually

[Haskell-cafe] cabal option to specify the ghc version?

2009-05-27 Thread Johannes Waldmann
Hi. How can I tell cabal (= the executable from cabal-install) to use a specific ghc version (and not the one that's currently linked to ghc)? - Thanks, J.W. signature.asc Description: OpenPGP digital signature ___ Haskell-Cafe mailing list

[Haskell-cafe] Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Max Rabkin
On Wed, May 27, 2009 at 11:05 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: i mean just changing the words to make obvious what type was got in what way. and check it on beginners who don't yet read your explanations, for example teachers may test it on their students my English is

[Haskell-cafe] Re: Strange type error with associated type synonyms

2009-05-27 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: while we are here - i always had problems understanding what is inferred and what is expected type. may be problem is just that i'm not native speaker The shape of the brick you are trying to push through a hole is analysed (inferred) by the

Re: [Haskell-cafe] cabal option to specify the ghc version?

2009-05-27 Thread David Menendez
On Wed, May 27, 2009 at 5:25 PM, Johannes Waldmann waldm...@imn.htwk-leipzig.de wrote: Hi. How can I tell cabal (= the executable from cabal-install) to use a specific ghc version (and not the one that's currently linked to ghc)? - Thanks, J.W. According to

[Haskell-cafe] Re: Strange type error with associated type synonyms

2009-05-27 Thread Achim Schneider
Bulat Ziganshin bulat.zigans...@gmail.com wrote: Error: type of x is Integer while type of read argument should be String The problem with this is that the compiler can't know whether or not the type of arguments to read should be a String, as someone could have messed up read's signature.

[Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Bulat Ziganshin
Hello Max, Thursday, May 28, 2009, 1:30:28 AM, you wrote: I prefer this wording: The inferred type of `True' is `Bool', while the type of the first argument of `f' should be `Int'. In the expression: f True yes, it's also self-explanatory I prefer all three to Hugs's ERROR - Type

Re: [Haskell-cafe] Re: Strange type error with associated type synonyms

2009-05-27 Thread Bulat Ziganshin
Hello Achim, Thursday, May 28, 2009, 1:34:55 AM, you wrote: Error: type of x is Integer while type of read argument should be String The problem with this is that the compiler can't know whether or not the type of arguments to read should be a String, as someone could have messed up

Re: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Jeff Wheeler
On Thu, 2009-05-28 at 01:45 +0400, Bulat Ziganshin wrote: for me, it was better than ghc errmsg. main thing is that i don't feel automatically what is expected and what is inferred. here Hugs says that True is Bool and the remaining is Int, so i feel the situation I absolutely agree about

Re[6]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Henning Thielemann
On Thu, 28 May 2009, Bulat Ziganshin wrote: read x Error: type of x is Integer while type of read argument should be String I also have my problems with inferred/expected and find your suggested message easier to understand in this case. But can it be generalized? I think that inferred

Re: [Haskell-cafe] cabal option to specify the ghc version?

2009-05-27 Thread Henning Thielemann
On Wed, 27 May 2009, Johannes Waldmann wrote: Hi. How can I tell cabal (= the executable from cabal-install) to use a specific ghc version (and not the one that's currently linked to ghc)? - Thanks, J.W. cabal install --with-compiler=/usr/local/lib/ghc-6.4.2/whatknowi

Re: [Haskell-cafe] Beginner SOS

2009-05-27 Thread Thomas DuBuisson
 There are links to some great tutorials [1] and IRC information where you can get real-time help [2].  Also there are some good books [3]. I think most recent learners learned from YAHT [4], Gentle Introduction [5], and LYAH [6].  I personall read [3] [4] and eventually discovered [7],

Re: [Haskell-cafe] trying to understand space leaks....

2009-05-27 Thread Ryan Ingram
There's still the space used by the closure b. An example: expensiveParser :: Parser Char ExpensiveStructure simple :: Parser Char Int withExpensive :: ExpensiveStructure - Parser Char Int withExpensive _ = mzero -- actually always fails, not using its argument. example = do e -

Re: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Max Rabkin
On Thu, May 28, 2009 at 12:03 AM, Jeff Wheeler j...@nokrev.com wrote: I absolutely agree about expected/inferred. I always forget which is which, because I can figure both could apply to each. That's actually true for me too. When you say it like that, I remember times when I've had the same

Re[7]: [Haskell-cafe] Strange type error with associated type synonyms

2009-05-27 Thread Bulat Ziganshin
Hello Henning, Thursday, May 28, 2009, 2:06:36 AM, you wrote: Prelude let a = 'a'; b = b in a==b interactive:1:27: Couldn't match expected type `Char' against inferred type `[Char]' Is the type of 'a' wrong or that of 'b'? it is not important, well, at least we can live

Re[2]: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Bulat Ziganshin
Hello Jeff, Thursday, May 28, 2009, 2:03:30 AM, you wrote: I absolutely agree about expected/inferred. I always forget which is which, because I can figure both could apply to each. thank you, it's what i meant! compiler infers types of both caller and its argument and then expect to see

Re[2]: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Bulat Ziganshin
Hello Max, Thursday, May 28, 2009, 2:14:19 AM, you wrote: I absolutely agree about expected/inferred. I always forget which is which, because I can figure both could apply to each. That's actually true for me too. When you say it like that, I remember times when I've had the same confusion.

Re: [Haskell-cafe] Re: Error message reform

2009-05-27 Thread Henning Thielemann
Bulat Ziganshin schrieb: actually, i don't have much problems with errrmsgs now, but trying to grok how i interpret them i've found that i mainly use *position* part of message, it's enough for me most times :) I have heard the statement users are only interested in the error position in a

Re[2]: [Haskell-cafe] Re: Error message reform

2009-05-27 Thread Bulat Ziganshin
Hello Henning, Thursday, May 28, 2009, 2:30:18 AM, you wrote: Bulat Ziganshin schrieb: actually, i don't have much problems with errrmsgs now, but trying to grok how i interpret them i've found that i mainly use *position* part of message, it's enough for me most times :) I have heard the

Re: [Haskell-cafe] About the lazy pattern

2009-05-27 Thread Ryan Ingram
Hi nemo. I had a lot of trouble with that section of the tutorial as well, and I believe that once you get it, a lot of Haskell becomes a lot simpler. The way I eventually figured it out is using this idealized execution model for Haskell: you just work by rewriting the left side of a function

Re: [Haskell-cafe] Template Haskell very wordy w/r/t Decs and Types

2009-05-27 Thread Matt Morrow
Spectacular! How difficult would it be to implement splicing in decls? I'm interested in having a go at it, and it seems like a perfect time since I can cheat off the fresh diff. In particular I'd love to be able to do stuff like this (without the current vicious hackery i'm using) (and granted,

Re: [Haskell-cafe] platform/cabal problems

2009-05-27 Thread Duncan Coutts
On Wed, 2009-05-27 at 22:43 +0200, Johannes Waldmann wrote: Hi all. I've written some Haskell program, and I wanted to give it to a friend, in source form, so he can run and modify it, and learn some Haskell while doing so. I was using some cabalized extra packages but hey, this looks like

Re: [Haskell-cafe] Type class context propagation investigation

2009-05-27 Thread Ryan Ingram
Think of classes like data declarations; an instance with no context is a constant, and one with context is a function. Here's a simple translation of your code into data; this is very similar to the implementation used by GHC for typeclasses: data EqDict a = EqDict { eq :: a - a - Bool } data

[Haskell-cafe] What's the problem with iota's type signature?

2009-05-27 Thread michael rice
Still exploring monads. I don't understand why the type signature for double is OK, but not the one for iota. Michael = --double :: (Int a) = a - Maybe b --double x = Just (x + x) iota :: (Int a) = a - [b] iota  n = [1..n] --usage: [3,4,5] = iota --should produce

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-27 Thread Lionel Barret de Nazaris
On 28/05/2009 04:33, michael rice wrote: Still exploring monads. I don't understand why the type signature for double is OK, but not the one for iota. Michael = --double :: (Int a) = a - Maybe b --double x = Just (x + x) iota :: (Int a) = a - [b] iota n = [1..n] --usage:

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-27 Thread David Leimbach
On Wed, May 27, 2009 at 7:33 PM, michael rice nowg...@yahoo.com wrote: Still exploring monads. I don't understand why the type signature for double is OK, but not the one for iota. Michael = --double :: (Int a) = a - Maybe b --double x = Just (x + x) iota :: (Int a) = a

Re: [Haskell-cafe] Stack overflow

2009-05-27 Thread Tim Docker
Thanks for the tip, although it seems tricky to get it right. I wonder why there is no strict version of atomicModifyIORef? Dually there might be a strict version of IORef datatype. Alternatively, you could use STM, where you can write your own atomic update function, which has the strictness

Re: [Haskell-cafe] What's the problem with iota's type signature?

2009-05-27 Thread Lee Duhem
On Thu, May 28, 2009 at 10:33 AM, michael rice nowg...@yahoo.com wrote: Still exploring monads. I don't understand why the type signature for double is OK, but not the one for iota. Michael = --double :: (Int a) = a - Maybe b --double x = Just (x + x) Prelude let double x

Re: Re[2]: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Alexander Dunlap
On Wed, May 27, 2009 at 3:24 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Max, Thursday, May 28, 2009, 2:14:19 AM, you wrote: I absolutely agree about expected/inferred. I always forget which is which, because I can figure both could apply to each. That's actually true for me

Re: [Haskell-cafe] the problem of design by negation

2009-05-27 Thread David Fox
What I do like about this so-called negative approach is that it represents a part of a program's documentation that is usually omitted. You can look at the code and see exactly how and (to a certain extent) why the program does what it does, but what you can't see is all the things it doesn't

Re: [Haskell-cafe] We tried this functional, higher-order stuff with LISP and look what happened...

2009-05-27 Thread Jason Dusek
2009/05/27 Tord Romstad tord.roms...@gmail.com: I think you rarely meet embittered Lisp programmers simply because we Lispers are rarely embittered... I have a very small sample size :) -- Jason Dusek ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Data.Binary and little endian encoding

2009-05-27 Thread David Leimbach
Sorry took so long to get back... Thank you for the response. Been really busy lately :-) On Sat, May 16, 2009 at 3:46 AM, Khudyakov Alexey alexey.sklad...@gmail.com wrote: On Friday 15 May 2009 06:52:29 David Leimbach wrote: I actually need little endian encoding... wondering if anyone

Re: [Haskell-cafe] Type class context propagation investigation

2009-05-27 Thread wren ng thornton
Ryan Ingram wrote: Think of classes like data declarations; an instance with no context is a constant, and one with context is a function. Here's a simple translation of your code into data; this is very similar to the implementation used by GHC for typeclasses: data EqDict a = EqDict { eq ::

Re: Re[2]: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread John Dorsey
I like the expected/inferred vocabulary. Maybe it comes from being a native English speaker, but to me, it says this is what we expected to get, but instead (through type inference), we got this type for this term. As another native English speaker, I found expected/inferred very intuitive

Re: [Haskell-cafe] trying to understand space leaks....

2009-05-27 Thread Daryoush Mehrtash
I (think) I understand the problem. What I don't have any intuition about is how much space would Expensive Structure take if it was basically an IO Char computation fed into a simple function (say checks for char being equal to a). Is there any way to guess, know the size of the buffer that

Re: Re[2]: [Haskell-cafe] Re: Error message reform (was: Strange type error with associated type synonyms)

2009-05-27 Thread Jeff Wheeler
On Wed, 2009-05-27 at 23:59 -0400, John Dorsey wrote: There was one hang-up; it wasn't at all clear which referred to the term, and which referred to the context. (Really both types are inferred.) This stopped bothering me when I decided it didn't matter which was which, and I could

  1   2   >