Re: [Haskell-cafe] Tutorial on JS with Haskell: Fay or GHCJS?

2013-09-05 Thread Dmitry Vyal
On 09/04/2013 05:39 PM, Adam Bergmark wrote: Here are some points I'd like to emphasize in addition to the threads above, with the disclaimer that I'm the maintainer of Fay. Fay tries to be very simple, the code base is small (~4800 LoC). This really lowers the entry barrier for contributions

Re: [Haskell-cafe] Haskellers in Minsk, Belarus?

2013-10-06 Thread Dmitry Vyal
Hi Yuras, thanks for the link. That's the sad truth. I don't know the actual reasons, but suspect there are many. Overtime work, fatigue, greed and alienation which are ubiquitous it today's society are among them. I admire people who nevertheless manage to work on open source projects in spa

[Haskell-cafe] Any advices on optimizing an array processing in a pitch tuner

2012-02-11 Thread Dmitry Vyal
Hello Haskellers, Recently I've revived my old toy project. It's a sound spectrum analyzer with Gtk2hs interface. I decided to rewrite it into a pitch tuner. Basically I'm done, but I've ran into performance difficulties while trying to rise a resolution in a frequency space. The original co

Re: [Haskell-cafe] Can Haskell outperform C++?

2012-05-14 Thread Dmitry Vyal
On 05/11/2012 07:53 AM, Ertugrul Söylemez wrote: My point is: If you need C-like performance at a certain spot there is really no excuse for writing the entire application in C. Haskell has a working, powerful enough FFI. Also idiomatic Haskell code nowadays performs close to C. If your code do

[Haskell-cafe] Using CatchIO on StateT

2012-10-12 Thread Dmitry Vyal
ds on the current state. Can you give an advice how to get the behavior I need? Best regards, Dmitry Vyal ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

[Haskell-cafe] poor performance when generating random text

2012-10-17 Thread Dmitry Vyal
Hello anyone I've written a snippet which generates a file full of random strings. When compiled with -O2 on ghc-7.6, the generation speed is about 2Mb per second which is on par with interpreted php. That's the fact I find rather disappointing. Maybe I've missed something trivial? Any sugges

Re: [Haskell-cafe] poor performance when generating random text

2012-10-17 Thread Dmitry Vyal
On 10/17/2012 12:45 PM, Alfredo Di Napoli wrote: What about this? I've tested on my pc and seems pretty fast. The trick is to generate the gen only once. Not sure if the inlines helps, though: > What about this? I've tested on my pc and seems pretty fast. The trick is to generate the gen onl

[Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread Dmitry Vyal
Hello list! I've been experimenting with emulating subtyping and heterogeneous collections in Haskell. I need this to parse a binary representation of objects of a class hierarchy in C++ program. So far I implemented upcasting using a chain of type classes and now I'm playing with heterogene

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-18 Thread Dmitry Vyal
On 10/18/2012 03:20 PM, MigMit wrote: Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"? Hmm, looks like a nice idea. I tried it, unfortunately I can't cope with compiler error messages: tst.hs:32:15: Context reduction stack overflow; size = 201 Use -fcontext-stack=

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-19 Thread Dmitry Vyal
On 10/19/2012 06:14 AM, AntC wrote: Roman Cheplyaka ro-che.info> writes: * Dmitry Vyal gmail.com> [2012-10-18 17:31:13+0400] On 10/18/2012 03:20 PM, MigMit wrote: Why do you need "ALike x", "BLike x" etc.? Why not just "Like u x"? Hmm, looks like a ni

Re: [Haskell-cafe] A yet another question about subtyping and heterogeneous collections

2012-10-19 Thread Dmitry Vyal
Second, all your examples so far used structural subtyping (objects with the same fields have the same type) rather than nominal subtyping of C++ (distinct classes have distinct types even if they have the same fields; the subtyping must be declared in the class declaration). For the structural

Re: [Haskell-cafe] [Security] Put haskell.org on https

2012-10-28 Thread Dmitry Vyal
On 10/28/2012 03:20 AM, Niklas Hambüchen wrote: - abuse your hackage account and override arbitrary packages (especially since hackage allows everybody to override everything) Does hackage at least store the logs of packages uploads? What's the reason or such a security model? I guess it was

Re: [Haskell-cafe] Moscow Haskell Users Group (MskHUG) December meeting.

2012-12-03 Thread Dmitry Vyal
On 12/03/2012 07:13 PM, Serguey Zefirov wrote: I would like to announce MskHUG December meeting and invite everyone interested. Wow, great idea :) I'd like to participate. May I ask why don't you schedule the event on weekend or on Friday at least? Best wishes, Dmitry __

Re: [Haskell-cafe] Most used functions in hackage

2013-01-28 Thread Dmitry Vyal
On 01/29/2013 11:21 AM, Casey Basichis wrote: Is there any link that counts the use of all functions in all packages in Hackage and lists them by frequency or by other stats? I'm still new to haskell but I've been working my way through tons and tons of tutorials and books. It would be very

Re: [Haskell-cafe] Most used functions in hackage

2013-01-30 Thread Dmitry Vyal
On 01/29/2013 12:23 PM, Casey Basichis wrote: Why do you think browsing function by function is a bad idea? It seems that knowing exactly what the most used functions are would be an extremely effective way of finding both which parts of the Prelude and Hackage are most broadly useful (inste

Re: [Haskell-cafe] Erlang's module discussion

2011-05-28 Thread Dmitry Vyal
On 28.05.2011 07:10, Tom Murphy wrote: Hi All, I sure love Hackage, but there's a very interesting discussion going on, on the Erlang mailing list, about completely restructuring the module-model. Before you dismiss it as crazy, know that the topic was brought up by Joe Armstrong, one

Re: [Haskell-cafe] Trying to implement this code

2005-04-18 Thread Dmitry Vyal
Lizz Ross wrote: Hi im new to Haskell (really just learning). Im trying to code a function to take in a List of Strings (e.g.) [apple, orange, banana, orange, apple, orange] , and create a binary search tree containing the Strings and integers (where the integers are the number of occurrences of e

[Haskell-cafe] Re: Trying to implement this code

2005-04-18 Thread Dmitry Vyal
Lizz Ross wrote: This gives me the error message :28 - Syntax error in input (unexpected symbol "wrap") Sorry. Looks like my mailer ate tabulation. Just correct the intendation: -- loads list of strings in the tree ins_list :: [String] -> BinTree Word_stat ins_list lst = foldl ins_in_tree Leaf (

Re: [Haskell-cafe] Trying to implement this code

2005-04-18 Thread Dmitry Vyal
Scott Turner wrote: It's a valid approach. Rather than declare an Updateable class, I'd just have the update function be a parameter of ins_in_tree. Also, the key and value types can be independent parameters of BinTree. I started to refactor my code as you suggested. I inserted update function

[Haskell-cafe] How to speed things up

2005-04-28 Thread Dmitry Vyal
Hello everybody. I have a long list consisted of a small number (about a dozen) of elements repeating in random pattern. I know all the possible elements. I need to count number of occurences of each particular element and to do i quickly. For example quick_func Eq a => [a] -> [(a,Int)] quick

Re: [Haskell-cafe] How to speed things up

2005-04-28 Thread Dmitry Vyal
Cale Gibbard wrote: I'd use a Map in GHC 6.4: count xs = toList $ fromListWith (+) (zip xs (repeat 1)) or a FiniteMap in earlier versions: count xs = fmToList $ addListToFM_C (+) emptyFM (zip xs (repeat 1)) both of these seem to be quite fast. - Cale Thanks, this is significaly faster than variant

[Haskell-cafe] Haskell thread preemption

2005-08-31 Thread Dmitry Vyal
Hello, all. I'm experimenting with concurrent haskell using GHC 6.4. I wrote these fuctions as described in "Tackling the Awkward Squad": par_io :: IO a -> IO a -> IO a par_io t1 t2 = do c <- newEmptyMVar :: IO (MVar a) id1 <- forkIO $ wrapper c t1 id2 <- fork

[Haskell-cafe] Concurrency question

2005-09-04 Thread Dmitry Vyal
Hi, everyone! I have a function, which sometimes takes a long time to compute or even may loop forever. So I want to limit it in time somehow. I tried to run it in another thread in order to kill it after its time lapsed. But it seems to lock out other threads so they can't terminate it. I wond

Re: [Haskell-cafe] Concurrency question

2005-09-04 Thread Dmitry Vyal
Donald Bruce Stewart wrote: Maybe your loop does no allocations, so the scheduler can't get in and do a context switch. You could put the computation in an external program, and run it over a fork, using unix signals in the external program to kill the computation after a period of time. I t