Re: [Haskell-cafe] Re: How many "Haskell Engineer I/II/III"s are there?

2010-02-14 Thread Serguey Zefirov
2010/2/14 Florian Weimer : > Most of the time, the concern is about pause times and the lack of > upper bounds on them.  With traditional reference counting, this is > still a problem because if the last reference to a large data > structure goes away, you need to free the whole data structure at >

[Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
I tried the way described in http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html and i got this error message: ghc -shared -o test.dll --make test.hs [1 of 1] Compiling Test

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
> > Thanks, Neil > > On Tue, Feb 16, 2010 at 2:33 PM, Serguey Zefirov wrote: >> I tried the way described in >> http://www.haskell.org/ghc/docs/latest/html/users_guide/win32-dlls.html >> and i got this error message: >> >> ---

Re: [Haskell-cafe] DLL on Windows

2010-02-16 Thread Serguey Zefirov
ver wxHaskell for GUI development as there > was always a version that worked on Windows with the latest GHC > release. I think I might have to switch back to recommending C# for > GUI development... > > Thanks, Neil > > On Tue, Feb 16, 2010 at 5:19 PM, Serguey Zefirov wrote: >

Re: [Haskell-cafe] fast, strongly typed heterogeneous collections

2010-02-19 Thread Serguey Zefirov
2010/2/19 Alberto G. Corona : > What is the speed of hProjectByLabel/s in Data.HList.Record? . The > documentation in hackage does not mention it. Perhaps this is because Hlist > is designed for supposedly short records and this does not matter too much. > looking at the code I guess that everythin

Re: [Haskell-cafe] fast, strongly typed heterogeneous collections

2010-02-19 Thread Serguey Zefirov
2010/2/19 Khudyakov Alexey : >> And, actually, what looks like O(n) at the compile time is O(1) at >> runtime. This is so because it is really hard to create types at >> runtime. ;) > > What did you mean by "really hard"? One have to use black magic and ask demons > for help or possible but very di

Re: [Haskell-cafe] Computer Graphics and Haskell - Radiosity Methods

2010-03-01 Thread Serguey Zefirov
2010/3/1 Hector Guilarte : > Hello cafe, > While I was studying for my computer graphics test I have tomorrow I > realized that maybe some of the major problems I've read so far about > Radiosity Rendering Algorithms may be reduced significantly if it was > implemented in Haskell and taking advanta

Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-11 Thread Serguey Zefirov
2010/3/10 Tom Hawkins : > On Wed, Mar 10, 2010 at 8:07 AM, Warren Henning > wrote: >> Wow. Quite ambitious. >> >> Was this inspired by work at your current employer like with Atom and >> some of the other stuff you've released? > > Yes, we had an immediate need to debug some machine code.  I looke

Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-11 Thread Serguey Zefirov
2010/3/11 John Van Enk : > Serguey, > I'm working on a similar project. What's the chance you have your source > code in the open? > /jve I'll ask. But chances are pretty small. I'll think about reimplementing command description from scratch. > On Thu, Mar 1

Re: [Haskell-cafe] ANN: powerpc-0.0.1

2010-03-11 Thread Serguey Zefirov
rite to it). > On Thu, Mar 11, 2010 at 11:35 AM, Serguey Zefirov > wrote: >> >> 2010/3/11 John Van Enk : >> > Serguey, >> > I'm working on a similar project. What's the chance you have your source >> > code in the open? >> > /jve &g

Re: [Haskell-cafe] More Language.C work for Google's Summer of Code

2010-03-30 Thread Serguey Zefirov
I tried to devise a C preprocessor, but then I figured out that I could write something like that: --- #define A(arg) A_start (arg) A_end #define A_start "this is A_start definition." #define A_end "this is A_end definition." A ( #undef A_start #define A_start A_end )

Re: [Haskell-cafe] Apparently, Erlang does not have a static type system, since with hot code loading, this is intrinsically difficult.

2010-04-04 Thread Serguey Zefirov
2010/4/4 Casey Hawthorne : > Apparently, Erlang does not have a static type system, since with hot > code loading, this is intrinsically difficult. Apparently, this is doable with proper engineering even for such an unsafe language as C: http://www.cs.umd.edu/projects/PL/dsu/ > "Erlang Programmin

Re: [Haskell-cafe] Re: Hackage accounts and real names

2010-04-06 Thread Serguey Zefirov
2010/4/6 : > On Tue, 06 Apr 2010 20:06:27 +1000, Ivan Lazar Miljenovic > wrote: >>> I've been over this thread and couldn't see anywhere where you'd made >>> an attempt to refute these arguments, so I guess you take them as >>> solid. On the other hand, every argument put forward by the >>> pro-r

[Haskell-cafe] cabal-install

2010-05-18 Thread Serguey Zefirov
Why there is no switch to turn off any use of proxy in cabal-install? Or to supply username/password pair in command line. I have a strange situation: wget works like charm ignoring proxy (I downloaded Cabal and cabal-install to investigate the problem using wget), Firefox works like charm igoring

Re: [Haskell-cafe] Performance Issue

2010-05-18 Thread Serguey Zefirov
2010/5/18 Richard Warburton : >> GHC performs almost no common subexpression elimination, the reasons being >> that it can introduce space leaks and undesired extra laziness. > Is there any way to encourage it to do so, for example compilation > flags?  Or is it generally best to hand apply these k

Re: [Haskell-cafe] cabal-install

2010-05-18 Thread Serguey Zefirov
2010/5/19 Ivan Lazar Miljenovic : > Serguey Zefirov writes: >> Why there is no switch to turn off any use of proxy in cabal-install? >> Or to supply username/password pair in command line. >> I have a strange situation: wget works like charm ignoring proxy (I >> downloa

Re: [Haskell-cafe] Bug with [Double]

2010-05-19 Thread Serguey Zefirov
2010/5/19 Erik de Castro Lopo : > Dmitry Olshansky wrote: > >> It seems that I saw something like this in Cafe recevtly. But I am not >> sure... >> In GHC 6.12.1 (Platform 2010 on Windows Vista) I have > > > > >> Any comments? > > The problem you point out is not a problem with Haskell, but a pro

Re: [Haskell-cafe] cabal-install

2010-05-19 Thread Serguey Zefirov
>>> I tried it and it didn't work. I don't know reason, though, maybe it >>> was because my current password not entirely alphanumeric. >> Shouldn't matter as long as you put it within quotes. > I imagine things will go wrong if it includes an @... urlencoding is > probably a smart idea. Thank you

Re: [Haskell-cafe] TDD in Haskell

2010-05-25 Thread Serguey Zefirov
> I'm doing TDD in pretty much all of the languages that I know, and I want to > introduce it early in my Haskell learning process. I wonder though, if > there's some established process regarding TDD, not unit testing. TDD can be deciphered as Type Driven Design, and right now not so many languag

Re: [Haskell-cafe] How does one get off haskell?

2010-06-24 Thread Serguey Zefirov
2010/6/17 Günther Schmidt : > BTW this is not meant as a fun post, I'm actually quite serious, ie. I need > money, only way of getting it is doing Java, C# or PHP. > > So how does one get off haskell? Are there people in similar situations that > have managed? How did you do it? I should suggest c

Re: [Haskell-cafe] How easy is it to hire Haskell programmers

2010-06-30 Thread Serguey Zefirov
> On Wed, Jun 30, 2010 at 4:34 PM, Paul Johnson wrote: >> I'm starting to see job adverts mentioning Haskell as a "nice to have", and >> even in some cases as a technology to work with. >> >> However right now I'm looking at it from the other side.  Suppose someone >> wants to hire a Haskell devel

[Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Serguey Zefirov
Data.Map.Map and Data.Set.Set are exported abstractly, without exposing knowledge about their internal structure. I cannot directly create my own class instances for them because of that. But I found that I can write Template Haskell code that could do that - those data types could be reified just

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-03 Thread Serguey Zefirov
>> I cannot directly create my own class instances for them because of >> that. But I found that I can write Template Haskell code that could do >> that - those data types could be reified just fine. > Huh? Sure you can write class instances for them. > , > | instance SizeOf (Map k v) where >

Re: [Haskell-cafe] music-related problem

2010-07-04 Thread Serguey Zefirov
> The thing that is hard for me to understand is how, in a functional > paradigm, to update the entire Doc by chasing down every tie and making > all necessary updates. This looks like one of graph algorithms. Notes are nodes, ties are arcs. Measures, etc are parts of node label. soundedEnd prop

Re: [Haskell-cafe] music-related problem

2010-07-04 Thread Serguey Zefirov
>> Actually, it would be wise to parametrize Item with computed >> attributes so that you can clearly distinguish between documents where >> soundedEnd is set from documents where it is not. > Ah, this sounds like something I am looking for... parameterizing Item with > the computed attributes. But

Re: [Haskell-cafe] Re: Float instance of Data.Bits

2010-07-09 Thread Serguey Zefirov
2010/7/9 Ertugrul Soeylemez : > Sam Martin wrote: > Nobody would really need the operations (we have integer types and > UArray Int Bool for bit manipulation), and they would most likely be > very slow. They won't be slow using SSE2 or something. I can see where they could be beneficial. But I a

Re: [Haskell-cafe] Re: Float instance of Data.Bits

2010-07-09 Thread Serguey Zefirov
2010/7/9 Sam Martin : >> Some operations wouldn't make much sense with Float, for instance the >> 'complement' function.  What should it return?  Also note that bit >> manipulation functions could cover only a small window of the value >> range.  So it could happen that x .|. y = x, even though y i

Re: [Haskell-cafe] trees and pointers

2010-07-14 Thread Serguey Zefirov
2010/7/14 Sergey Mironov : > Hi cafe! I have a question of C-to-Haskell type:) > > Imagine web application wich allows users to browse some shared > filesystem located at the server. > Application stores every users's position within that filesystem > (current directory or file). > > In C this can

Re: [Haskell-cafe] trees and pointers

2010-07-15 Thread Serguey Zefirov
2010/7/15 Sergey Mironov : > 2010/7/15 Serguey Zefirov : >> 2010/7/14 Sergey Mironov : >>> Hi cafe! I have a question of C-to-Haskell type:) >>> >>> Imagine web application wich allows users to browse some shared >>> filesystem located at the server.

Re: [Haskell-cafe] Design for 2010.2.x series Haskell Platform site

2010-07-17 Thread Serguey Zefirov
2010/7/17 Don Stewart : > > Here's a first cut in the repo with the new design converted to CSS > >    http://code.haskell.org/haskell-platform/download-website/ > > If anyone would like to clean it up further, please send me patches to > the style.css file or index.html. I have big fonts (magnify

Re: [Haskell-cafe] Lists and monads

2010-07-26 Thread Serguey Zefirov
2010/7/26 Kevin Jardine : > I suspect that things are not quite as difficult as they appear, > however, but cannot find any tutorials on monadic list manipulation. I'd suggest that you get as many pure values as possible from impure world, apply to them easy to use pure functions (list processing,

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-28 Thread Serguey Zefirov
2010/7/28 Jonas Almström Duregård : > Hi, > >> I cannot write classes that see into internal structure. For example, >> I cannot write my own (de)serialization without using from/toAscList. > > Actually I don't believe you can do this with TH either. TH splices > code into the module where you use

Re: [Haskell-cafe] Template Haskell sees into abstract data types

2010-07-28 Thread Serguey Zefirov
2010/7/28 Simon Peyton-Jones : > I assume you've seen http://hackage.haskell.org/trac/ghc/ticket/4222 > There are non-obvious design choices here Yes, I've seen that. Right now I just cannot grok it fully. I feel like I should share my current understanding with cafe, so I wrote them in my answer

[Haskell-cafe] Type Families: deleting from HList.

2010-07-31 Thread Serguey Zefirov
Is it possible to delete an element from heterogenous list using type families alone? I can do it using multiparameter type classes: class Del a list result instance Del a (a,list) list instance Del a list list' => Del a (a',list) list' instance Del a () () I tried to express the same using type

Re: [Haskell-cafe] Re: Microsoft's Singularity Project and Haskell

2010-07-31 Thread Serguey Zefirov
2010/7/31 David Leimbach : > Haskell's great and all but it does have a few warts when it comes to how > much real trust one  should put into the type system. > Some compromises still exist like unsafePerformIO that you can't detect > simply by looking at the types of functions. Okay, you should l

Re: [Haskell-cafe] Combining Gtk2hs and Fieldtrip

2010-08-08 Thread Serguey Zefirov
Gtk2hs has an OepnGL binding. So you can create OpenGL context and draw there. I don't think you will still be able to use parallel threads, but path to hardware renderer will be shorter for sure. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org ht

[Haskell-cafe] Is there any experience using Software Transactional Memory in substantial applications?

2010-08-08 Thread Serguey Zefirov
Recently we discussed Haskell and especially types in Russian part of LiveJournal and of course we talk about STM. My opponent gave me that link: http://logicaloptimizer.blogspot.com/2010/06/so-microsofts-experiments-with-software.html It says that performance with STM in Microsoft Research was m

Re: [Haskell-cafe] Is there any experience using Software Transactional Memory in substantial applications?

2010-08-08 Thread Serguey Zefirov
stantial applications? > To: Serguey Zefirov > > > This first papers is the first that describes the preliminary haskell > implementation and the performance data says that STM scales well with the > number of CPU cores  Blocking does not scale, as expected. > http://research.mi

Re: [Haskell-cafe] Is there any experience using Software Transactional Memory in substantial applications?

2010-08-08 Thread Serguey Zefirov
2010/8/8 Johnny Morrice : >> My opponent gave me that link: > http://logicaloptimizer.blogspot.com/2010/06/so-microsofts-experiments-with-software.html > > I enjoy the article you linked but I sort of skimmed it because it was a > little boring, however its main point seem to be: > > 1. Ghostbuster

Re: [Haskell-cafe] Support for lock-free/wait-free programming?

2010-08-17 Thread Serguey Zefirov
2010/8/17 Gregory Collins : > Does GHC expose any primitives for things like atomic compare-and-swap? I think that STM could qualify as LL/SC. It does LL with TVars and bulk SC with transaction commit. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@haske

Re: [Haskell-cafe] Higher-order algorithms

2010-08-23 Thread Serguey Zefirov
2010/8/23 Eugene Kirpichov : > For example, parser combinators are not so interesting: they are a > bunch of relatively orthogonal (by their purpose) combinators, each of > which is by itself quite trivial, plus not-quite-higher-order > backtracking at the core. This is only if you're not quite co

Re: [Haskell-cafe] Fast Integer Input

2010-08-23 Thread Serguey Zefirov
2010/8/23 <200901...@daiict.ac.in>: > This function takes 1.8 seconds to > convert 2000 integers of length 10^13000. I need it to be smaller that > 0.5 sec. Is it possible? 2000 integers of magnitude 10^13000 equals to about 26 MBytes of data (2000 numbers each 13000 digits long). Rounding 1.8 se

Re: [Haskell-cafe] Fast Integer Input

2010-08-23 Thread Serguey Zefirov
2010/8/23 Bertram Felgenhauer : > Serguey Zefirov wrote: > The timings seem about right. Thank you for letting me know about divide-and-conquer variant. But I am still amuzed that producing 1200 words of data from 13Kbytes of text took those little 200 cycles of CPU. This is quite inter

[Haskell-cafe] Ordering TypeRep from Data.Typeable.

2010-08-26 Thread Serguey Zefirov
I think, that TypeRep type from Data.Typeable needs Ord class instance. It is unnecessary, but is handy when needed. My use case follows. I try to create graph whose node and arc labels are differently typed. So I can add Int node, Float node and link them by Conversion arc. Right now I am quit

Re: [Haskell-cafe] Announce: lhae

2010-09-03 Thread Serguey Zefirov
2010/9/3 abau : > lhae is a spreadsheet program. It features a simple formula language and > some basic statistical methods, like descriptive statistics and pivot > tables. Interesting. You had selected wxWidgets because of what? Also, how long did it took (especially GUI part)?

[Haskell-cafe] Haskell Platform on Windows - cabal update problems.

2010-09-04 Thread Serguey Zefirov
I've installed recent Haskell Platform and tried to wrap my head around cabal to finally figure out how to use it. First thing I bumped into is that cabal.exe does not know about any remote repositories, even about hackage. So after googling I found that I should add a line "remote-repo: hackage.h

Re: [Haskell-cafe] Re: Haskell Platform on Windows - cabal update problems.

2010-09-04 Thread Serguey Zefirov
2010/9/5 Mikhail Glushenkov : > Try removing the 'Application Data/cabal' directory and running > 'cabal update'. You probably made a syntax error in the config > file. You are clearly a magician. ;) Now it works flawlessly. Thank you very much. ___ Ha

Re: [Haskell-cafe] overloaded list literals?

2010-09-06 Thread Serguey Zefirov
2010/9/6 Bulat Ziganshin : > Hello Johannes, > > Monday, September 6, 2010, 2:23:35 PM, you wrote: > >> so how about using list syntax ( [], : ) >> for anything list-like (e.g., Data.Sequence)? > > i'vwe found my own proposal of such type: > http://www.mail-archive.com/haskell-cafe@haskell.org/msg1

Re: Re[2]: [Haskell-cafe] overloaded list literals?

2010-09-06 Thread Serguey Zefirov
2010/9/6 Bulat Ziganshin : > Hello Serguey, > Monday, September 6, 2010, 7:57:46 PM, you wrote: >>> http://www.mail-archive.com/haskell-cafe@haskell.org/msg15656.html >> Will Data.Map with its' empty, insert, findMin, etc, "methods" conform >> to your proposed type? > but Data.Map isn't sequential

Re: Re[4]: [Haskell-cafe] overloaded list literals?

2010-09-06 Thread Serguey Zefirov
2010/9/6 Bulat Ziganshin : > Hello Serguey, > > Monday, September 6, 2010, 8:16:03 PM, you wrote: >> Basically, you - and others, - propose to add another class isomorphic >> to already present lists. I think, most benefits of that class can be >> achieved by using list conversion and RULE pragma.

Re: [Haskell-cafe] Scraping boilerplate deriving?

2010-09-14 Thread Serguey Zefirov
2010/9/14 Kevin Jardine : > I would like to use some macro system (perhaps Template Haskell?) to > reduce this to something like > > defObj MyType > > I've read through some Template Haskell documentation and examples, > but I find it intimidatingly hard to follow. Does anyone has some code > sugge

Re: [Haskell-cafe] Help to create a function to calculate a n element moving average ??

2010-09-26 Thread Serguey Zefirov
2010/9/26 rgowka1 : > Type signature would be Int -> [Double] -> [(Double,Double)] > > Any thoughts or ideas on how to calculate a n-element moving average > of a list of Doubles? > > Let's say [1..10]::[Double] > > what is the function to calculate the average of the 3 elements? > > [(1,0),(2,0),(

Re: [Haskell-cafe] Relaxing atomicity of STM transactions

2010-09-28 Thread Serguey Zefirov
2010/9/29 Tom Hawkins : > In the embedded domain, this could be a fault monitor that > reads a bunch of constantly changing sensors. I think that sensor reading belongs to IO, not STM. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.has

Re: [Haskell-cafe] I still cannot seem to get a GUI working under Windows.

2010-09-30 Thread Serguey Zefirov
2010/9/30 Andrew Coppin : > And even then, your > developed application will only run on Windows boxes that have GTK+ > installed (i.e., none of them). You can copy GTK+ DLLs with application. It works very well. ___ Haskell-Cafe mailing list Haskell-Ca

Re: [Haskell-cafe] Haskellers.com profiles: advice requested

2010-10-06 Thread Serguey Zefirov
2010/10/6 Michael Snoyman : > Hi all, > > After finally getting OpenID 2 support worked out, I've now put up the > Haskellers.com website[1]. Not all features are implemented yet, but > the basics are in. Would it be possible to be able to login or consolidate two (or more) different OpenID? For

Re: [Haskell-cafe] Haskellers.com profiles: advice requested

2010-10-06 Thread Serguey Zefirov
2010/10/6 Michael Snoyman : >>> * How granular should we get? For web programming, for instance, >>> should we ask about Yesod, Happstack, Snap, etc? >> >> I think that "skill cloud" would be nice so I can add my new skills >> (packages, programs, domain specific knowledge) as I acquire them (or >>

Re: [Haskell-cafe] Packaging a Gtk2hs based program for Windows

2010-10-07 Thread Serguey Zefirov
2010/10/7 Dmitry V'yal : > It sounds: How to make a neat Windows installer for a nice Gtk2hs program I > wrote last week? How to solve the problem of dependency on GTK? Should I ask > my users to install a GTK package or it would be better to package all the > dynamic libraries needed along with my

Re: [Haskell-cafe] Help me TH code.

2010-10-26 Thread Serguey Zefirov
2010/10/27 Andy Stewart : > Hi all, > > I want use TH write some function like below: > >  data DataType = StringT >                | IntT >                | CharT > >  parse :: [(String,DataType)] -> (TypeA, TypeB, ... TypeN) > > Example: > >  parse [("string", StringT), ("001", IntT), ("c", CharT

Re: [Haskell-cafe] Help me TH code.

2010-10-27 Thread Serguey Zefirov
2010/10/27 Andy Stewart : > Serguey Zefirov writes: >> I think that you should use TH properly, without compiler and logical errors. >> >> What actually do you want? > I'm build multi-processes communication program. You don't need TH here, I think. You can wri

[Haskell-cafe] Strange problem with type classes (ghc 6.8.2 looks allright and ghc 6.10.1 doesn't).

2009-09-22 Thread Serguey Zefirov
I try to create yet another hardware description language embedded in Haskell and faced a (perceived) bug in ghc 6.10.1 type checker. In ghc 6.8.2 everything works fine. I need a type class that can express relationship between type and its' "size in wires" (the number of bits needed to represent

[Haskell-cafe] Strange problem with type classes (ghc 6.8.2 looks allright and ghc 6.10.1 doesn't).

2009-09-22 Thread Serguey Zefirov
(followup to my previous letter with the same subject) I found the way to break 6.8.2 type checker. It's as easy as to uncomment Div case alternative in valueIndex. Weird. I found a solution, though. Instead of (valueIndex (x_38,(x_36,x_37))) in that Div alternative I should create expression (

[Haskell-cafe] What does "mkUsageInfo: internal name?" mean? (ghc 6.10.1, Template Haskell)

2009-10-10 Thread Serguey Zefirov
I get a bunch of messages like "mkUsageInfo: internal name? WritebackCmd{tc a1eZY}" while transforming my program using Template Haskell. It displayed for every data type and for every constructor - I generate some instances for my data types. ___ Haskel

Re: [Haskell-cafe] Exponential complexity of type checking (Was: Type-level naturals & multiplication)

2009-10-13 Thread Serguey Zefirov
2009/10/13 Lennart Augustsson : > Yes, there are simple H-M examples that are exponential. > x0 = undefined > x1 = (x1,x1) > x2 = (x2,x2) > x3 = (x3,x3) > ... > > xn will have a type with 2^n type variables so it has size 2^n. Reformulated: let dup x = (x,x) :t dup . dup . dup . dup ... type will

Re: [Haskell-cafe] ANN: mecha-0.0.2

2009-11-01 Thread Serguey Zefirov
http://iat.ubalt.edu/summers/math/platsol.htm and http://hyperfun.org/wiki/doku.php?id=frep:main CSG on implicitly specified surfaces (F(r)=0) and volumes (F(r)>=0). Min(F,G) is a union, max(F,G) is an intersection. 2009/11/1 Tom Hawkins : >> Neat!  What a cool idea. >>> data Solid = Solid (Vecto

Re: [Haskell-cafe] I miss OO

2009-11-25 Thread Serguey Zefirov
2009/11/25 Michael Mossey : > I'm fairly new to Haskell, and starting to write some big projects. > Previously I used OO exclusively, mostly Python. I really miss the > "namespace" capabilities... a class can have a lot of generic method names > which may be identical for several different classes

Re: [Haskell-cafe] Partially applied functions

2009-11-28 Thread Serguey Zefirov
> The question is still open though, if somebody has some magic to extract the > prameter from an applied function... It isn't possible. Closest solution will be a list of pairs (function,arg) and a special apply function that takes those pairs and apply to function an argument and.them, apply so

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Serguey Zefirov
>> If the number of buckets was fixed, one could use an array of STRefs >> to lists.  I believe this would avoid the bug from Ticket #650? > now i see what you mean. no, i mean trivial transformation. #650 says > about slow GC. why it's slow? because once you made any update to the > array, the ent

Re: Re[6]: [Haskell-cafe] Boxed Mutable Arrays

2009-12-15 Thread Serguey Zefirov
>>> now i see what you mean. no, i mean trivial transformation. #650 says >>> about slow GC. why it's slow? because once you made any update to the >>> array, the entire array is marked as updated and scanned on next minor GC >>> (which occurs after every 512 kbytes allocated, afaik). let's replace

Re: [Haskell-cafe] Boxed Mutable Arrays

2009-12-16 Thread Serguey Zefirov
2009/12/16 Matt Morrow : > What are peoples' thoughts on this? > http://hackage.haskell.org/trac/ghc/ticket/650#comment:16 I think it won't get any better. Either we have O(log(N)) updates because we have to update hierarchical structure to speed up GC scanning (to get it to O(Mlog(N)), where M i

Re: [Haskell-cafe] Pattern matching, and bugs

2009-12-18 Thread Serguey Zefirov
> I would like to have a way for Haskell, not to crash, when my coders write > pattern matching without the above mentioned general case. > Like having the compiler auto-include those general cases for us, > but when those cases got hit, then instead of crashing, it should report > some error on st

[Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
A pair of problems: 1) How to write a parser that could be restarted? Like, it will be represented by a function that returns something along the lines data ParseStepResult input result = Success (Maybe (input -> ParseStepResult input result)) (Maybe result) | Failure (ie, parsers using str

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
2009/12/25 Valery V. Vorotyntsev : >> 1) How to write a parser that could be restarted? Like, it will be >> represented by a function that returns something along the lines >> >> data ParseStepResult input result = >>    Success (Maybe (input -> ParseStepResult input result)) (Maybe result) >>  | F

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
2009/12/25 Felipe Lessa : >> I am looking more for the way to serialize intermediate parser >> computations. The first problem is, actually, easy one. ;) > > Probably you'll have to create a data constructor for each step > of your parser. > > AFAIK, one of HAppS modules does a similar transformati

Re: [Haskell-cafe] Continuable and serializable parsers.

2009-12-25 Thread Serguey Zefirov
>> AFAIK, one of HAppS modules does a similar transformation via >> Template Haskell.  The functions specify transactions, and each >> transaction is converted to a serializable data type.  Then it's >> possible to create a transaction log by serializing them before >> their execution. > > The happ

Re: [Haskell-cafe] OT: Literature on translation of lambda calculus to combinators

2010-01-28 Thread Serguey Zefirov
Also see http://www.haskell.org/haskellwiki/Super_combinator Wiki page. Fixed set of combinators gives you complexity of translation that is more than linear of the length of lambda expression. The length of output string is O(3^length(lambdaExpression)) for SK combinator pair. 2010/1/28 Dušan K

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell : > Hi Cafe. > > I've made a basic game of life implementation with Haskell and OpenGL: > https://github.com/sordina/Life/ > > I'm intending to improve the performance, and add more advanced > features, but I thought I'd get some feedback first. Can anyone see a > way to ma

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell : > I chose the array mainly for the fast lookup time compared to lists, > are you suggesting something like creating a "Map (X,Y) Health"? I'm > not currently updating any structures, rather creating the successor > from scratch. I can see how the map may work very well fo

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Lyndon Maydwell : > I'm avoiding hard-coding bools anywhere as I intend to allow > fuzzy-representations at some point. What is the meaning of fuzzy Game of Life? Where can I read about? Or you're planning to average field over some time interval? In the latter case you still will be fa

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Jon Harrop : > On Tuesday 02 February 2010 16:10:05 Serguey Zefirov wrote: >> Actually, your solution with arrays is the most often occured solution >> an imperative programmer will come with. It is simple but not scalable >> and not particularly fast. > > Wh

Re: [Haskell-cafe] Game of life in haskell.

2010-02-02 Thread Serguey Zefirov
2010/2/2 Jon Harrop : >> Or, you're asking about scalability and speed? > > I meant the scalability and speed. An imperative solution should be simpler, > more scalable and faster than any purely functional solution. So, please, provide any and we'll discuss difference between ours. Mine is here:

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Serguey Zefirov
2010/2/4 Günther Schmidt : > Hello Ron, > > thank you, but it was not the run-time stack size I meant. It was the stack > size for nested types which defaults to 20 or so IIRC. My nested types > currently go to about 23 deep. -fcontext-stack=100 ___ Hask

Re: [Haskell-cafe] Re: Nested Types stack size ...

2010-02-04 Thread Serguey Zefirov
2010/2/4 Günther Schmidt : > Hello Serguey, > > great, that's the one! > > Can I set this in the source code itself too? No, as far as I know. Last time I tried it on 6.10.1, so it's pretty far from now. ;) ___ Haskell-Cafe mailing list Haskell-Cafe@has

Re: [Haskell-cafe] Simulation of interconnect network

2010-02-06 Thread Serguey Zefirov
2010/2/5 Roger King : > I am building a simulator for an interconnect network for a multiprocessor > computer.  I would like to develop it in Haskell as an opportunity to learn > Haskell. > > The network will have a number of routers with input ports and output ports > and crossbars between them

[Haskell-cafe] Data.Map traversal.

2008-06-07 Thread Serguey Zefirov
I found that I often need predecessor and successor of some key in Data.Map.Map. Just like that: predKey, succKey :: Ord k => Data.Map.Map k a -> k -> Maybe k predKeyElem, succKeyElem :: Ord k => Data.Map.Map k a -> k -> Maybe (k,a) Data.Map has operations like that on key indexes, but it is sl

[Haskell-cafe] Composing analyses.

2012-01-04 Thread Serguey Zefirov
I am trying to create a stack of analyses. There are basic analyses then there are derived analyses that create a DAG of analyses. I thought I can express their relationship through type classes, but I failed. I've attached the source of my failure. Main points are below: getAnalysisResult :: Ena

Re: [Haskell-cafe] Data.IntMap union complexity

2012-02-24 Thread Serguey Zefirov
2012/2/24 Clark Gaebel : > Since insertion [2] is O(min(n, W)) [ where W is the number of bits in an > Int ], wouldn't it be more efficient to just fold 'insert' over one of the > lists for a complexity of O(m*min(n, W))? This would degrade into O(m) in > the worst case, as opposed to the current O

[Haskell-cafe] Data Kinds and superfluous (in my opinion) constraints contexts

2012-05-06 Thread Serguey Zefirov
I decided to take a look at DataKinds extension, which became available in GHC 7.4. My main concerns is that I cannot close type classes for promoted data types. Even if I fix type class argument to a promoted type, the use of encoding function still requires specification of context. I consider t

Re: [Haskell-cafe] Data Kinds and superfluous (in my opinion) constraints contexts

2012-05-17 Thread Serguey Zefirov
hen the behavior depends on which type is being used). > > > > > On Sun, May 6, 2012 at 9:48 AM, Serguey Zefirov wrote: >> >> I decided to take a look at DataKinds extension, which became >> available in GHC 7.4. >> >> My main concerns is that I cannot clo

Re: [Haskell-cafe] Large graphs

2012-05-20 Thread Serguey Zefirov
2012/5/20 Benjamin Ylvisaker : > I have a problem that I'm trying to use Haskell for, and I think I'm running > into scalability issues in FGL.  However, I am quite new to practical > programming in Haskell, so it's possible that I have some other bone-headed > performance bug in my code.  I tri

Re: [Haskell-cafe] class instances for kinds with finite ty constrs, does this make sense?

2012-06-15 Thread Serguey Zefirov
2012/6/8 Brent Yorgey : > On Thu, Jun 07, 2012 at 07:32:45PM +0100, ex falso wrote: >> >> we always have to put the class restriction (TupleLength l) there, >> even though all possible type constructors of [*] have a TupleLength >> instance defined! > > Yes, and this is a feature, for at least two

Re: [Haskell-cafe] Wanted: Haskell binding for libbdd (buddy)

2012-08-20 Thread Serguey Zefirov
2012/8/20 Johannes Waldmann : > Are there any Haskell bindings for BDD libraries > (reduced ordered binary decision diagrams)? > > E.g., it seems "buddy" is commonly used > http://packages.debian.org/squeeze/libbdd-dev > and it has an Ocaml binding. > > Yes, there is http://hackage.haskell.org/pack

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

2012-12-03 Thread Serguey Zefirov
I would like to announce MskHUG December meeting and invite everyone interested. The meeting will take place December 13th, 20:00 to 23:30 in the nice conference center in centre of Moscow: http://www.nf-conference.ru/ The meeting's agenda is to start more intense discussions. Most probably, ther

Re: [Haskell-cafe] C++

2012-12-11 Thread Serguey Zefirov
This array is for dynamic programming. You can diagonalize it into a list and use technique similar to the Fibonacci numbers. The resulting solution should be purely declarative. 2012/12/11 mukesh tiwari : > Hello All > I am trying to transform this C++ code in Haskell. In case any one > interes

Re: [Haskell-cafe] Race Condition in threads

2012-12-18 Thread Serguey Zefirov
2012/12/18 mukesh tiwari : > Hello All > I have two questions. > 1. I wrote this code to create 10 simultaneous threads. Could some one > please tell me if this is correct or not ? > > incr_count :: MVar () -> MVar Int -> IO () > incr_count m n = ( forM_ [ 1..1 ] $ \_ -> modifyMVar_ n ( return

Re: [Haskell-cafe] Assembly EDSL in Haskell

2013-04-01 Thread Serguey Zefirov
You have fixed the type of list by move RAX RAX. Now it has type Instruction SNDREG SNDREG Make your Instruction a GADT and require that MOV should have appropriate constraints: {-# LANGUAGE DatatypeContexts, GADTs #-} data SREG = RIP data DREG = RBX data SNDREG = RAX data Instruction where

[Haskell-cafe] Reduceron: reduced to numbers.

2010-11-27 Thread Serguey Zefirov
I decided to calculate Reduceron's number of transistors (I had to, we have some argument here;). Reduceron allocate 14% of 17300 slices of Virtex-5 FPGA. If we assume that each slice correspond to 8 4-input NAND-NOT elements, we will get 2 4-input NAND. Each 4-input NAND contains 8 transistor

Re: [Haskell-cafe] Digests

2010-12-02 Thread Serguey Zefirov
2010/12/3 Permjacov Evgeniy : > The data integrity checks is well-known problem. A common soluting is > use of 'checksums'. Most of them , however, are built in quite > obfuscated manner (like md5) that results in ugly and error-prone > implementations (see reference implementation for same md5). >

Re: [Haskell-cafe] Digests

2010-12-02 Thread Serguey Zefirov
2010/12/3 Permjacov Evgeniy : >> Most of the time you can get away with usual block ciphers (and even >> with weaker parameters). There is a scheme that transforms block >> cipher into hash function: >> http://en.wikipedia.org/wiki/CRHF#Hash_functions_based_on_block_ciphers > */me wrote it into to_

Re: [Haskell-cafe] Digests

2010-12-03 Thread Serguey Zefirov
2010/12/3 Permjacov Evgeniy : >>> */me wrote it into to_read list. The problem is, however, that block >>> ciphers are quite unfriendly to plain word8 streams. It is not a deadly >>> problem, but i'd like to avoid block collections. >> All one-way hashes do block collections. This is unavoidable. >

Re: [Haskell-cafe] Digests

2010-12-03 Thread Serguey Zefirov
2010/12/4 Permjacov Evgeniy : >> near cryptographic) security. To quote Wikipedia again: "The avalanche >> effect is evident if, when an input is changed slightly (for example, >> flipping a single bit) the output changes significantly (e.g., half >> the output bits flip)." > This simply means, tha

  1   2   >