Re: [Haskell-cafe] Where is SNMap for stable names?
On Sat, Sep 24, 2011 at 01:41, Edward Kmett wrote: > You still need IO to get the stable name out to use. :) > I don't understand this statement. Consider the lookup operation in the paper and in your System.Mem.StableName.Map: > lookupSNMap :: SNMap k v -> StableName k -> IO (Maybe v) > lookup :: StableName a -> Map f -> Maybe (f a) Unless you are intending f to be instantiated to IO -- which is not how I read it -- then, lookupSNMap is requiring some aspect of IO, probably mutability, and lookup is not. I am wondering if there is some fundamental difference between the two. Is the paper using immutability only for performance reasons? In that case, it's not a fundamental difference. Regards, Sean Sent from my iPad > > On Sep 23, 2011, at 5:33 AM, Sean Leather wrote: > > Hi Edward, > > On Thu, Sep 22, 2011 at 16:50, Edward Kmett wrote: > >> I have a "stable-maps" package that provides lookup and inserting into a >> map via stable names. > > > The paper mentions the need for a mutable finite map, and all the > operations are IO. Do you know why this is and what's different with your > pure implementation? > > Regards, > Sean > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fwd: problem with cabal install MissingH-1.1.1.0
On Thu, Sep 22, 2011 at 23:10, Mariano Cortesi wrote: > When i start EclipseFP, it tries to build the scion-browser, but it fails > inmediately with a message from cabal: > > cabal: The program ghc version >=6.4 is required but it could not be found. > > Google wasn't much help. Is anybody using EclipseFP? I've installed version > 2.1 in eclipse indigo. I'm a regular eclipse user, but with haskell i'm > lost. > You probably want to set $PATH from ~/.MacOSX/environment.plist instead of in the shell config files. http://developer.apple.com/library/mac/#qa/qa1067/_index.html Here's a preference pane to help maintain environment.plist: http://www.macupdate.com/app/mac/14617/rcenvironment (I use one which *used* to be available from Apple, but seems to have vanished along with a bunch of other stuff. Sigh.) -- brandon s allbery allber...@gmail.com wandering unix systems administrator (available) (412) 475-9364 vm/sms ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] A Missing Issue on Second Generation Strategies
Dear List, I am trying to parallelize RSA encryption and decryption by using below manner, but when I run executable output file with "+RTS -s -N2" command on Windows 7, output stats say 4 sparks are being created however none of them converted into real OS threads. -- SPARKS :4 (0 converted, 4 pruned) -- I was thinking that the problem could occur due to lack of forcing parallelization but, as far as I know 'rdeepseq' works for that aim. Briefly, I could not solve the issue why parallelization was not being implemented. I would be appreciated if any of you shed a light on the issue that I missed. Here is the mentioned part of code: split4ToEnc :: RSAPublicKey -> [Integer] -> [Integer] split4ToEnc (PUB n e) [] = [] split4ToEnc (PUB n e) (x:xs) = ((ersa (PUB n e) secondPart2) ++ (ersa (PUB n e) secondPart1) ++ (ersa (PUB n e) firstPart2) ++ (ersa (PUB n e) firstPart1)) `using` strategy where firstPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt ((length (x:xs)) `div` 2) (x:xs firstPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt ((length (x:xs)) `div` 2) (x:xs secondPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs secondPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs strategy res = do a <- rpar (ersa (PUB n e) (firstPart1) `using` rdeepseq) b <- rpar (ersa (PUB n e) (firstPart2) `using` rdeepseq) c <- rpar (ersa (PUB n e) (secondPart1) `using` rdeepseq) d <- rpar (ersa (PUB n e) (secondPart2) `using` rdeepseq) rdeepseq res Thanks a lot, Burak. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A Missing Issue on Second Generation Strategies
2011/9/24 Burak Ekici : > Dear List, > > I am trying to parallelize RSA encryption and decryption by using below > manner, > but when I run executable output file with "+RTS -s -N2" command on Windows > 7, > output stats say 4 sparks are being created however none of them converted > into > real OS threads. > > -- SPARKS :4 (0 converted, 4 pruned) -- > > I was thinking that the problem could occur due to lack of forcing > parallelization but, > as far as I know 'rdeepseq' works for that aim. > > Briefly, I could not solve the issue why parallelization was not being > implemented. > I would be appreciated if any of you shed a light on the issue that I > missed. > > Here is the mentioned part of code: > > split4ToEnc :: RSAPublicKey -> [Integer] -> [Integer] > split4ToEnc (PUB n e) [] = [] > split4ToEnc (PUB n e) (x:xs) = > ((ersa (PUB n e) secondPart2) ++ (ersa (PUB n e) secondPart1) ++ (ersa (PUB > n e) firstPart2) ++ (ersa (PUB n e) firstPart1)) `using` strategy > where > firstPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt > ((length (x:xs)) `div` 2) (x:xs > firstPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt > ((length (x:xs)) `div` 2) (x:xs > secondPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) > (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs > secondPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) > (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs > strategy res = do > a <- rpar (ersa (PUB n e) (firstPart1) `using` rdeepseq) > b <- rpar (ersa (PUB n e) (firstPart2) `using` rdeepseq) > c <- rpar (ersa (PUB n e) (secondPart1) `using` rdeepseq) > d <- rpar (ersa (PUB n e) (secondPart2) `using` rdeepseq) > rdeepseq res > This isn't an area I'm expert in, but your strategy looks off to me - since you're not using 'a', 'b', 'c' and 'd' anywhere, it would make sense that you're not seeing much speedup. Also, the strategy doesn't seem to be doing anything with it's input, which looks different from most of the examples I've seen. In summary, your strategy doesn't appear to have anything relating it to the computation you're doing with the `using`, if that makes any sense. > > Thanks a lot, > Burak. > > > > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A Missing Issue on Second Generation Strategies
On Sat, Sep 24, 2011 at 11:14 AM, Antoine Latter wrote: > 2011/9/24 Burak Ekici : >> Dear List, >> >> I am trying to parallelize RSA encryption and decryption by using below >> manner, >> but when I run executable output file with "+RTS -s -N2" command on Windows >> 7, >> output stats say 4 sparks are being created however none of them converted >> into >> real OS threads. >> >> -- SPARKS :4 (0 converted, 4 pruned) -- >> >> I was thinking that the problem could occur due to lack of forcing >> parallelization but, >> as far as I know 'rdeepseq' works for that aim. >> >> Briefly, I could not solve the issue why parallelization was not being >> implemented. >> I would be appreciated if any of you shed a light on the issue that I >> missed. >> >> Here is the mentioned part of code: >> >> split4ToEnc :: RSAPublicKey -> [Integer] -> [Integer] >> split4ToEnc (PUB n e) [] = [] >> split4ToEnc (PUB n e) (x:xs) = >> ((ersa (PUB n e) secondPart2) ++ (ersa (PUB n e) secondPart1) ++ (ersa (PUB >> n e) firstPart2) ++ (ersa (PUB n e) firstPart1)) `using` strategy >> where >> firstPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt >> ((length (x:xs)) `div` 2) (x:xs >> firstPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt >> ((length (x:xs)) `div` 2) (x:xs >> secondPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) >> (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs >> secondPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) >> (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs >> strategy res = do >> a <- rpar (ersa (PUB n e) (firstPart1) `using` rdeepseq) >> b <- rpar (ersa (PUB n e) (firstPart2) `using` rdeepseq) >> c <- rpar (ersa (PUB n e) (secondPart1) `using` rdeepseq) >> d <- rpar (ersa (PUB n e) (secondPart2) `using` rdeepseq) >> rdeepseq res >> > > This isn't an area I'm expert in, but your strategy looks off to me - > since you're not using 'a', 'b', 'c' and 'd' anywhere, it would make > sense that you're not seeing much speedup. Also, the strategy doesn't > seem to be doing anything with it's input, which looks different from > most of the examples I've seen. > > In summary, your strategy doesn't appear to have anything relating it > to the computation you're doing with the `using`, if that makes any > sense. > May a better way to phrase things is that your strategy never does anything to its input (like force any parts of it to evaluate), it merely sparks of computations that no one ever looks at. Which is why they get pruned. > > >> >> Thanks a lot, >> Burak. >> >> >> >> ___ >> Haskell-Cafe mailing list >> Haskell-Cafe@haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A Missing Issue on Second Generation Strategies
Thanks a lot for the quick answer. Accordingly, I have just changed the code into below one, however sparks are still being pruned. Do you have any other ideas? Bests, Burak. -- split4ToEnc :: RSAPublicKey -> [Integer] -> [Integer] split4ToEnc (PUB n e) [] = [] split4ToEnc (PUB n e) (x:xs) = ((ersa (PUB n e) secondPart2) ++ (ersa (PUB n e) secondPart1) ++ (ersa (PUB n e) firstPart2) ++ (ersa (PUB n e) firstPart1)) `using` strategy where firstPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt ((length (x:xs)) `div` 2) (x:xs firstPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt ((length (x:xs)) `div` 2) (x:xs secondPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs secondPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs strategy res = do (rpar `dot` rdeepseq) (ersa (PUB n e) firstPart1) (rpar `dot` rdeepseq) (ersa (PUB n e) firstPart2) (rpar `dot` rdeepseq) (ersa (PUB n e) secondPart1) (rpar `dot` rdeepseq) (ersa (PUB n e) secondPart2) rdeepseq res - > From: aslat...@gmail.com > Date: Sat, 24 Sep 2011 11:19:49 -0500 > Subject: Re: [Haskell-cafe] A Missing Issue on Second Generation Strategies > To: ekcbu...@hotmail.com > CC: haskell-cafe@haskell.org > > On Sat, Sep 24, 2011 at 11:14 AM, Antoine Latter wrote: > > 2011/9/24 Burak Ekici : > >> Dear List, > >> > >> I am trying to parallelize RSA encryption and decryption by using below > >> manner, > >> but when I run executable output file with "+RTS -s -N2" command on Windows > >> 7, > >> output stats say 4 sparks are being created however none of them converted > >> into > >> real OS threads. > >> > >> -- SPARKS :4 (0 converted, 4 pruned) -- > >> > >> I was thinking that the problem could occur due to lack of forcing > >> parallelization but, > >> as far as I know 'rdeepseq' works for that aim. > >> > >> Briefly, I could not solve the issue why parallelization was not being > >> implemented. > >> I would be appreciated if any of you shed a light on the issue that I > >> missed. > >> > >> Here is the mentioned part of code: > >> > >> split4ToEnc :: RSAPublicKey -> [Integer] -> [Integer] > >> split4ToEnc (PUB n e) [] = [] > >> split4ToEnc (PUB n e) (x:xs) = > >> ((ersa (PUB n e) secondPart2) ++ (ersa (PUB n e) secondPart1) ++ (ersa > >> (PUB > >> n e) firstPart2) ++ (ersa (PUB n e) firstPart1)) `using` strategy > >> where > >> firstPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) > >> (fst(Main.splitAt > >> ((length (x:xs)) `div` 2) (x:xs > >> firstPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) > >> (fst(Main.splitAt > >> ((length (x:xs)) `div` 2) (x:xs > >> secondPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) > >> (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs > >> secondPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) > >> (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs > >> strategy res = do > >> a <- rpar (ersa (PUB n e) (firstPart1) `using` rdeepseq) > >> b <- rpar (ersa (PUB n e) (firstPart2) `using` rdeepseq) > >> c <- rpar (ersa (PUB n e) (secondPart1) `using` rdeepseq) > >> d <- rpar (ersa (PUB n e) (secondPart2) `using` rdeepseq) > >> rdeepseq res > >> > > > > This isn't an area I'm expert in, but your strategy looks off to me - > > since you're not using 'a', 'b', 'c' and 'd' anywhere, it would make > > sense that you're not seeing much speedup. Also, the strategy doesn't > > seem to be doing anything with it's input, which looks different from > > most of the examples I've seen. > > > > In summary, your strategy doesn't appear to have anything relating it > > to the computation you're doing with the `using`, if that makes any > > sense. > > > > May a better way to phrase things is that your strategy never does > anything to its input (like force any parts of it to evaluate), it > merely sparks of computations that no one ever looks at. Which is why > they get pruned. > > > > > > >> > >> Thanks a lot, > >> Burak. > >> > >> > >> > >> ___ > >> Haskell-Cafe mailing list > >> Haskell-Cafe@haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > >> > >> > > ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A Missing Issue on Second Generation Strategies
On Saturday 24 September 2011, 18:01:10, Burak Ekici wrote: > Dear List, > > I am trying to parallelize RSA encryption and decryption by using below > manner, but when I run executable output file with "+RTS -s -N2" > command on Windows 7, output stats say 4 sparks are being created > however none of them converted into real OS threads. > > -- SPARKS :4 (0 converted, 4 pruned) -- > > I was thinking that the problem could occur due to lack of forcing > parallelization but, as far as I know 'rdeepseq' works for that aim. > > Briefly, I could not solve the issue why parallelization was not being > implemented. I would be appreciated if any of you shed a light on the > issue that I missed. > > Here is the mentioned part of code: > > split4ToEnc :: RSAPublicKey -> [Integer] -> [Integer] > split4ToEnc (PUB n e) [] = [] > split4ToEnc (PUB n e) (x:xs) = > ((ersa (PUB n e) secondPart2) ++ (ersa (PUB n e) secondPart1) ++ (ersa > (PUB n e) firstPart2) ++ (ersa (PUB n e) firstPart1)) `using` strategy > where > firstPart1 = fst (Main.splitAt((length (x:xs)) `div` 4) > (fst(Main.splitAt ((length (x:xs)) `div` 2) (x:xs firstPart2 = snd > (Main.splitAt((length (x:xs)) `div` 4) (fst(Main.splitAt ((length > (x:xs)) `div` 2) (x:xs secondPart1 = fst (Main.splitAt((length > (x:xs)) `div` 4) (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs > secondPart2 = snd (Main.splitAt((length (x:xs)) `div` 4) > (snd(Main.splitAt ((length (x:xs)) `div` 2) (x:xs strategy res = do > a <- rpar (ersa (PUB n e) (firstPart1) `using` > rdeepseq) b <- rpar (ersa (PUB n e) (firstPart2) `using` rdeepseq) c <- > rpar (ersa (PUB n e) (secondPart1) `using` rdeepseq) d <- rpar (ersa > (PUB n e) (secondPart2) `using` rdeepseq) rdeepseq res First, you are doing a lot of unnecessary recalculation, calculate the length once and reuse it, also the parts of input and output lists. If you don't give a name to the parts of your result, the strategy looks completely unrelated to the result to the compiler, hence no gain (if you're unlucky, they might be computed twice). split4ToEnc key [] = [] split4ToEnc key xs = d' ++ c' ++ b' ++ a' -- don't need (x:xs), after matching [] failed that's the only possibility -- and the first element isn't used where len = length xs (firstHalf,secondHalf) = splitAt (len `quot` 2) xs (firstPart1,firstPart2) = splitAt (len `quot` 4) firstHalf (secondPart1,secondPart2) = splitAt (len `quot` 4) secondHalf a = ersa key firstPart1 b = ersa key firstPart2 c = ersa key secondPart1 d = ersa key secondPart2 (a',b',c',d') = (a,b,c,d) `using` parTuple4 rdeepseq rdeepseq rdeepseq rdeepseq should give you some parallelism. People familiar with the topic can probably suggest better strategies. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Is there still at list of active Haskell projects
Hello, On http://www.haskell.org I didn't see a list of active Haskell projects. ?? Thanks, Bill ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is there still at list of active Haskell projects
Excerpts from Vasili I. Galchin's message of Sat Sep 24 23:42:06 +0200 2011: > On http://www.haskell.org I didn't see a list of active Haskell > projects. ?? What do you mean by "active" ? Some packages such as hasktags - are they dead? I still use it. However there have not been much updates recently. Eventually you're looking for hackage.haskell.org? Marc Weber ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is there still at list of active Haskell projects
The Haskell Communities and Activities Report it another good source to check for active Haskell projects. http://www.haskell.org/haskellwiki/Haskell_Communities_and_Activities_Report On Sep 24, 2011, at 4:42 PM, Vasili I. Galchin wrote: > Hello, > > On http://www.haskell.org I didn't see a list of active Haskell projects. > ?? > > > Thanks, > > Bill > ___ > Haskell-Cafe mailing list > Haskell-Cafe@haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe