Re: Re[2]: [Haskell-cafe] Big Arrays

2010-10-04 Thread Hemanth Kapila
Just out of curiosity, may I know a use case of such huge arrays? At such sizes, I thought, the array would not have the expected array properties (constant access time) due to thrashing. thanks, Hemanth ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Ketil Malde
Max Bolingbroke batterseapo...@hotmail.com writes: [1] http://hackage.haskell.org/trac/haskell-prime/ticket/41 I tried to find anything about lambda-if in there, but failed (Trac and I aren't on very friendly terms, so it's probably my fault). Is there more information about the rationale and

Re: [Haskell-cafe] Problem with monad transformer stack

2010-10-04 Thread Michael Vanier
Hmm, it seems like MonadState can be derived even with a non-concrete type, for instance: -- {-# LANGUAGE GeneralizedNewtypeDeriving #-} import Control.Monad.Error import Control.Monad.State import Data.Typeable data SomeError = Error1 | Error2 | ErrorFail deriving (Eq,

[Haskell-cafe] Re: Suggestions for improvement

2010-10-04 Thread N. Raghavendra
At 2010-10-03T13:49:34-07:00, Gregory Crosswhite wrote: It is worth noting that such a function already exists in the standard libraries; it is the operator in Control.Arrow: blowup = uncurry (++) . (blowup . allButLast lastToTheLength) Thanks for that. More reading material!

[Haskell-cafe] Re: Suggestions for improvement

2010-10-04 Thread N. Raghavendra
At 2010-10-04T01:52:05+04:00, Victor Nazarov wrote: I suggest to pay more attention to haskell's standard library. allButLast is called init in Data.List module. Thanks for that. I should keep printouts of the Prelude handy. Second, do not use explicit recursion. You can capture recursion

Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Bulat Ziganshin
Hello Ketil, Monday, October 4, 2010, 11:30:48 AM, you wrote: Prelude (if then Haskell else Cafe) False lambda-if is easily implemented in terms of usual functions. and we even have one named bool: bool: Bool - a - a - a lambda-case cannot be implemented as a function since we need matching

Re: [Haskell-cafe] Re: EDSL for Makefile

2010-10-04 Thread Neil Mitchell
Hi Telling from the video and the slide, Neil's make system is actually really cool. Indeed something I would really enjoy to use. Thanks :-) So you use want and need to tell the system about the static and dynamic dependencies. The want at the beginning just tells which targets to start.

[Haskell-cafe] Template Haskell: hiding declarations

2010-10-04 Thread Jonas Almström Duregård
Hi Café, I'm doing some code generation with Template Haskell that results in few hundred top level declaration, of which only 10 or so should actually be exposed to the user (the rest are only used by generated code). Since I cant splice stuff into the module header (i.e. into the export list),

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Christopher Done
On 4 October 2010 10:55, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Ketil, Monday, October 4, 2010, 11:30:48 AM, you wrote: Prelude (if then Haskell else Cafe) False lambda-if is easily implemented in terms of usual functions. and we even have one named bool: bool: Bool - a -

[Haskell-cafe] Re: EDSL for Makefile

2010-10-04 Thread steffen
Telling from the video and the slide, Neil's make system is actually really cool. Indeed something I would really enjoy to use. It support dynamic and static dependency tracking (more or less) out of the box (by storing dependencies in a database file). So you use want and need to tell the system

Re: [Haskell-cafe] Template Haskell: hiding declarations

2010-10-04 Thread Vo Minh Thu
2010/10/4 Jonas Almström Duregård jonas.dureg...@chalmers.se: Hi Café, I'm doing some code generation with Template Haskell that results in few hundred top level declaration, of which only 10 or so should actually be exposed to the user (the rest are only used by generated code). Since I

[Haskell-cafe] Re: Suggestions for improvement

2010-10-04 Thread N. Raghavendra
At 2010-10-03T20:03:22-04:00, wren ng thornton wrote: And just to play a little Haskell golf: lastToTheLength = ap (flip map) (const . last) Thanks for that. Regards, Raghavendra. -- N. Raghavendra ra...@mri.ernet.in | http://www.retrotexts.net/ Harish-Chandra Research Institute |

Re[2]: [Haskell-cafe] Big Arrays

2010-10-04 Thread Bulat Ziganshin
Hello John, Monday, October 4, 2010, 7:57:13 AM, you wrote: Sure it does; a 32-bit system can address much more than 2**30 elements. Artificially limiting how much memory can be allocated by depending on a poorly-specced type like 'Int' is a poor design decision in Haskell and GHC. are you

Re: [Haskell-cafe] CCC MyType

2010-10-04 Thread Lafras Uys
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/10/2010 23:35, Brent Yorgey wrote: On Fri, Oct 01, 2010 at 01:18:29PM +0200, Lafras Uys wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I can now find explicit bindings for apply and curry, however not for uncurry. The type signature

Re: [Haskell-cafe] A question regarding cmdargs package

2010-10-04 Thread Arie Peterson
On Sun, 03 Oct 2010 19:18:08 +0200, Ben Franksen ben.frank...@online.de wrote: How can I disable the standard arguments 'help' and 'version'? If you're not fully committed to the cmdargs package, you might try my package 'console-program' instead

Re: [Haskell-cafe] Template Haskell: hiding declarations

2010-10-04 Thread Liam O'Connor
Perhaps try importing the huge module with lots of imports in another module, and then only export the ones you want. Cheers. ~Liam 2010/10/4 Vo Minh Thu not...@gmail.com: 2010/10/4 Jonas Almström Duregård jonas.dureg...@chalmers.se: Hi Café, I'm doing some code generation with Template

Re: Re[2]: [Haskell-cafe] Big Arrays

2010-10-04 Thread John Millikin
On Mon, Oct 4, 2010 at 01:51, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello John, Monday, October 4, 2010, 7:57:13 AM, you wrote: Sure it does; a 32-bit system can address much more than 2**30 elements. Artificially limiting how much memory can be allocated by depending on a

Re: [Haskell-cafe] Why isn't there a cheaper split-in-two operation for Data.Set?

2010-10-04 Thread Bertram Felgenhauer
Ryan Newton wrote: Would there be anything wrong with a Data.Set simply chopping off half its (balanced) tree and returning two approximately balanced partitions ... cleave :: Set a - (Set a, Set a) cleave Tip = (Tip, Tip) cleave (Bin _ x l r) | size l size r = (l, insertMin x r) |

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Donn Cave
Quoth Ketil Malde ke...@malde.org, Max Bolingbroke batterseapo...@hotmail.com writes: ... Prelude (if then Haskell else Cafe) False Cafe Presumably, this extends to Prelude (if False then else Cafe) Haskell Cafe and Prelude (if then Haskell else) False Cafe Cafe as well? I think

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Roel van Dijk
I really like the lambda-case. There are dozens of places in my code where I could use it. Not so sure about the lambda-if. It is just as easily done using an ordinary function. lambda-case: +1 lambda-if: neutral ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Haskell Platform, Hackage and Cabal : The 2nd Year : Status Report

2010-10-04 Thread Henning Thielemann
Ketil Malde schrieb: Matthias Kilian k...@outback.escape.de writes: http://www.vimeo.com/15462768 And is there any way to just *download* the video? For people not using adobe flash? +1. I'd like to watch video offline on my phone, so Flash isn't really a good option. It doesn't

Re: [Haskell-cafe] Suggestions for improvement

2010-10-04 Thread Richard O'Keefe
On 4/10/2010, at 8:52 AM, N. Raghavendra wrote: I am reading the book `The Haskell Road to Math, Logic, One of the exercises in the first chapter asks for a function that maps a string abcd to abbccc and bang! to baannn!. answer s = concat $ zipWith replicate [1..] s I

Re: [Haskell-cafe] CCC MyType

2010-10-04 Thread Brent Yorgey
On Mon, Oct 04, 2010 at 08:24:33AM +0200, Lafras Uys wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 02/10/2010 23:35, Brent Yorgey wrote: On Fri, Oct 01, 2010 at 01:18:29PM +0200, Lafras Uys wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 I can now find explicit

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Richard O'Keefe
On 4/10/2010, at 8:30 PM, Ketil Malde wrote: Prelude (case of 1 - One; _ - Not-one) 1 One Prelude :q case of looks a bit weird, but I like the points brought up about avoiding to name a one-use variable (e.g., getArgs = case of ...) AFACS, this isn't easily implemented in Haskell

[Haskell-cafe] Re: Haskell Helper

2010-10-04 Thread c8h10n4o2
And why b - between (char ',') (char '=') (sepBy alphaNum (char ',') ) does not return [String] ? -- View this message in context: http://haskell.1045720.n5.nabble.com/Haskell-Helper-tp3093854p3198511.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com.

Re: [Haskell-cafe] Re: Haskell Helper

2010-10-04 Thread Ozgur Akgun
On 4 October 2010 23:10, c8h10n4o2 asaferibei...@ymail.com wrote: And why b - between (char ',') (char '=') (sepBy alphaNum (char ',') ) does not return [String] ? alphaNum :: Parser Char sepBy :: Parser a - Parser sep - Parser [a] sepBy alphaNum sepP :: Parser [Char] or Parser String but

[Haskell-cafe] Re: Haskell Helper

2010-10-04 Thread c8h10n4o2
I read the parsec documentation and saw my mistake. By the way, there is a parser that returns [String] for my case? -- View this message in context: http://haskell.1045720.n5.nabble.com/Haskell-Helper-tp3093854p3198573.html Sent from the Haskell - Haskell-Cafe mailing list archive at

[Haskell-cafe] Re: A question regarding cmdargs package

2010-10-04 Thread Ben Franksen
Arie Peterson wrote: On Sun, 03 Oct 2010 19:18:08 +0200, Ben Franksen ben.frank...@online.de wrote: How can I disable the standard arguments 'help' and 'version'? If you're not fully committed to the cmdargs package, you might try my package 'console-program' instead

Re: [Haskell-cafe] Re: Haskell Helper

2010-10-04 Thread Ozgur Akgun
On 4 October 2010 23:54, c8h10n4o2 asaferibei...@ymail.com wrote: By the way, there is a parser that returns [String] for my case? If you are trying to parse strings (of alphaNum's) separated by commas, you can use many alphaNum (or many1 alphaNum depending on what you want) instead of simply

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Donn Cave
Quoth Richard O'Keefe o...@cs.otago.ac.nz, ... Erlang manages fine with multiclause 'fun': (fun (1) - One ; (_) - Not-one end)(1) ML manages fine with multiclause 'fn': (fn 1 = one | _ = not-one)(1) In both cases, the same notation is used for multiclause lambda as for single

Re: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Richard O'Keefe
On 5/10/2010, at 12:49 PM, Donn Cave wrote: Just to be sure, are you saying, rather than case of 1 - f 2 - g you'd like to see \ support pattern matching etc. like named functions - \ 1 - f 2 - g Absolutely.For the record, lambda DOES support pattern

[Haskell-cafe] Network.HTTP, BasicAuth+Headers

2010-10-04 Thread Tony Morris
I'm trying to send a simple request using Network.HTTP and getting a bit lost in all the possibilities. I've experimented with both Network.HTTP and Network.Browser but have been unable to come up with something specific to my needs, which are quite simple. I'd like to send a request equivalent

[Haskell-cafe] Re: Suggestions for improvement

2010-10-04 Thread N. Raghavendra
At 2010-10-05T09:21:51+13:00, Richard O'Keefe wrote: answer s = concat $ zipWith replicate [1..] s I looked at the examples and said, hmm, elements are being repeated varying numbers of times. Looked up repeat, found that that was the wrong function, and saw replicate, which is the right

Re: Re[2]: [Haskell-cafe] Lambda-case / lambda-if

2010-10-04 Thread Dean Herington
At 12:05 PM +0200 10/4/10, Christopher Done wrote: On 4 October 2010 10:55, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Ketil, Monday, October 4, 2010, 11:30:48 AM, you wrote: Prelude (if then Haskell else Cafe) False lambda-if is easily implemented in terms of usual

[Haskell-cafe] Re: Suggestions for improvement

2010-10-04 Thread N. Raghavendra
At 2010-10-03T22:45:30+02:00, Dominique Devriese wrote: You need a function like the following for that: comma :: (a - b) - (a - c) - a - (b,c) comma f g x = (f x, g x) Then you could say: blowup = (uncurry (++)) . comma (blowup . allButLast) lastToTheLength Ignore this if you haven't