Re: RFC: Dropping Windows XP support
Hello Austin, Friday, November 7, 2014, 9:16:22 PM, you wrote: For one, Microsoft doesn't support XP anymore, so most people are moving off it anyway. 'Soon' even XP Embedded will be obsoleted. at the end of http://freearc.org/Statistics.aspx page you can find stats about OS used by ysers of my program - archiver written in haskell. these are 14% of *geeks* using the l;atest alpha version (stable version of my program ddoesn't report this parameter) so dropping XP support means that newer GHC can't be used anymore to compile general-purpose programs targeting large user audience -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
optimizing StgPtr allocate (Capability *cap, W_ n)
Hello Glasgow-haskell-users, i'm looking a the https://github.com/ghc/ghc/blob/23bb90460d7c963ee617d250fa0a33c6ac7bbc53/rts/sm/Storage.c#L680 if i correctly understand, it's speed-critical routine? i think that it may be improved in this way: StgPtr allocate (Capability *cap, W_ n) { bdescr *bd; StgPtr p; TICK_ALLOC_HEAP_NOCTR(WDS(n)); CCS_ALLOC(cap-r.rCCCS,n); /// here starts new improved code: bd = cap-r.rCurrentAlloc; if (bd == NULL || bd-free + n bd-end) { if (n = LARGE_OBJECT_THRESHOLD/sizeof(W_)) { } if (bd-free + n = bd-start + BLOCK_SIZE_W) bd-end = min (bd-start + BLOCK_SIZE_W, bd-free + LARGE_OBJECT_THRESHOLD) goto usual_alloc; } } /// and here it stops usual_alloc: p = bd-free; bd-free += n; IF_DEBUG(sanity, ASSERT(*((StgWord8*)p) == 0xaa)); return p; } i think it's obvious - we consolidate two if's on the crirical path into the single one plus avoid one ADD by keeping highly-useful bd-end pointer further improvements may include removing bd==NULL check by initializing bd-free=bd-end=NULL and moving entire if body into separate slow_allocate() procedure marked noinline with allocate() probably marked as forceinline: StgPtr allocate (Capability *cap, W_ n) { bdescr *bd; StgPtr p; TICK_ALLOC_HEAP_NOCTR(WDS(n)); CCS_ALLOC(cap-r.rCCCS,n); bd = cap-r.rCurrentAlloc; if (bd-free + n bd-end) return slow_allocate(cap,n); p = bd-free; bd-free += n; IF_DEBUG(sanity, ASSERT(*((StgWord8*)p) == 0xaa)); return p; } this change will greatly simplify optimizer's work. according to my experience current C++ compilers are weak on optimizing large functions with complex execution paths and such transformations really improve the generated code -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: The future of the haskell2010/haskell98 packages - AKA Trac #9590
Title: Re: The future of the haskell2010/haskell98 packages - AKA Trac #9590 Hello Brandon, Wednesday, October 1, 2014, 1:02:54 AM, you wrote: On Tue, Sep 30, 2014 at 5:00 PM, Malcolm Wallace malcolm.wall...@me.com wrote: How about doing the honest thing, and withdrawing both packages in ghc-7.10? Haskell'98 is now 15 years old, and the 2010 standard was never really popular anyway. There are apparently educators using both, although they're not used much if at all in production. does they need latest GHC version? an option may be to drop support of Haskell'98 in GHC 7.10, then implement superclass proposal in GHC 7.12 and return haskell'98 support -- brandon s allbery kf8nhsine nomine associates allber...@gmail.comballb...@sinenomine.net unix, openafs, kerberos, infrastructure, xmonadhttp://sinenomine.net -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Common syntax for casing/matching (Re[2]: Call to arms: lambda-case is stuck and needs your help)
Hello wagnerdm, Thursday, July 5, 2012, 7:22:38 PM, you wrote: After 21 months of occasional arguing the lambda-case proposal(s) is this reminded me old joke about PL/I: camel is the horse created by committee i propose to return back and summarize all the requirements we have in this area. and then try to develop global solution matching them all. my summary of requirements follows: Now we have 3 ways to performing casing/matching: function definition: f (Just x) (Just y) | x0 = ... multi-line, multi-parameter case statement: case ... of Just x | x0 - ... multi-line, single-parameter, different syntax lambda: \(Just x) (Just y) - ... single-line, multi-parameter, case-like syntax What we probably need is to have common syntax for all 3 cases. another interesting feature may be ruby-style matching defined by execution of special function `match` instead of pattern matching: switch var of 1+1 - print var==2 [5..10] - print var in [5..10] (20) - print var20 where (var `match` (1+1)), (var `match` [5..10]), (var `match` (20)) is tested -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Win64 support
Hello glasgow-haskell-users, the one thing that users of my program asked most is the Win64 support: http://code.google.com/p/freearc/issues/list . we have waited for a several years, but it's still not in GHC, so i want to know at least: why it's not going forward? can we have unregisterized build at least? -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: Win64 support
Hello Ian, Wednesday, May 9, 2012, 7:12:03 PM, you wrote: The Industrial Haskell Group has been funding work on the Win64 port. It will be released with GHC 7.6. wow! what is the current state, when it planned to be released, how it's implemented (gcc/mingw64?) ? may be this port has its own webpage or some progress list? i would be glad to alpha-test it http://hackage.haskell.org/trac/ghc/ticket/1884 says nothing on it - i'm pretty sure that you will find a lot of testers here too -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Behavior of the -H RTS option, possible doc/impl mismatch
Hello Akio, Wednesday, February 16, 2011, 11:24:31 AM, you wrote: ./a.out +RTS -N7 -A256M -H2G uses around 7 GBytes of memory ./a.out +RTS -N7 -A256M -H6G uses around 13 GBytes of memory ghc uses copying GC by default - when heap overflows, it copies all the live data to the new heap and use space of old heap for new allocations. it means that memory usage may grow in 2x jumps in the worst case and that memory usage may differ 2x from run to run due to minor changes in input data or RTS heap options if you need to decrease memory usage, consider -F and -c options. -M will be especially useful if you know memory usage in advance -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: Parallel, Incremental Linking
Hello John, Tuesday, December 7, 2010, 11:54:22 AM, you wrote: The bottleneck for building on my multi-core machine is ld, which afaik, there was some alternative linker, at least for linux systems -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] Out of memory if compiled with -O2, why?
Hello Jason, Wednesday, December 1, 2010, 8:54:58 PM, you wrote: I'm using ghc7 here. If I run your program with -O2, it takes 1943 MB of memory max. If I comment out everything except g then with -O2 it takes 1521 MB. I'm not sure where the extra 400 MB of memory are going. i think, it's because memory isn't collected immediately, so in first case you just have more garbage hanging around. if you need to measure real workset of your program, you should apply very aggressive (and slow) garbage collection settings -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Same compiled program behaving differently when called from ghci and shell
Hello Bruno, Sunday, November 21, 2010, 8:49:52 AM, you wrote: ghc --make ftest2.hs may be your versions of ghc and (win)ghci are different? the behavior was changed in latest versions afaik -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: 6.12.3: hs_add_root crashes
Hello Bulat, Monday, November 15, 2010, 4:20:14 PM, you wrote: hs_init(NULL, NULL); hs_add_root(__stginit_Main); but it crashes on hs_add_root call. what may be source of problem? just in minutes after presing Send i've found reason of problem. it was due to NULLs passed to hs_init. it was crashed on hs_add_root though that is why i haven't checked this possibility sooner -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
6.12.3: hs_add_root crashes
Hello , ghc 6.12.3. i use the following code to initialize my haskell dll: extern C { #include HsFFI.h void __stginit_Main(); void haskell_init (void) { static bool initialized = FALSE; if (!initialized) { initialized = TRUE; hs_init(NULL, NULL); hs_add_root(__stginit_Main); } } } but it crashes on hs_add_root call. what may be source of problem? without hs_add_root, it works ok, but crashes on multiple calls from C to haskell functions, probably due to GC of unused code :) -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: [Haskell-cafe] Haskell is a scripting language inspired by Python.
Hello Gregg, Tuesday, November 9, 2010, 2:12:12 AM, you wrote: Doesn't COBOL have significant layout anyway as an inspiration to both? Yes and no. What it actually has relates strongly to punched cards and is more like assemblers of the day. i never programmed in COBOL, but afaik data structures usually was organized this way - together with level numbers at left. it was just easier to read it this way -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Rigid types fun
Hello Mitar, Friday, November 5, 2010, 12:45:21 PM, you wrote: from - newChan for - newChan let nerve = Nerve (Axon from) (AxonAny for) create = do from - newChan for - newChan return$ Nerve (Axon from) (AxonAny for) main = do nerve - create ... -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: Rigid types fun
Hello Mitar, Friday, November 5, 2010, 2:08:52 PM, you wrote: I would like to call it like create (Axon undefined) (AxonAny undefined) and get in that case Nerve (Axon a) (AxonAny b) as a result. If I would call it like create (AxonAny undefined) (AxonAny undefined) I would get Nerve (AxonAny a) (AxonAny b) as a result. And so on. look into HsLua sources. it does something like you asking (converting return type into sequence of commands) so it mau be what you are looking for. it uses typeclasses for this effect. the same technique used in haskell printf implementation afaik -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
[Haskell-cafe] Re: Rigid types fun
Hello Mitar, Friday, November 5, 2010, 12:45:21 PM, you wrote: from - newChan for - newChan let nerve = Nerve (Axon from) (AxonAny for) create = do from - newChan for - newChan return$ Nerve (Axon from) (AxonAny for) main = do nerve - create ... -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re[2]: Rigid types fun
Hello Mitar, Friday, November 5, 2010, 2:08:52 PM, you wrote: I would like to call it like create (Axon undefined) (AxonAny undefined) and get in that case Nerve (Axon a) (AxonAny b) as a result. If I would call it like create (AxonAny undefined) (AxonAny undefined) I would get Nerve (AxonAny a) (AxonAny b) as a result. And so on. look into HsLua sources. it does something like you asking (converting return type into sequence of commands) so it mau be what you are looking for. it uses typeclasses for this effect. the same technique used in haskell printf implementation afaik -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Most popular haskell applications
Hello haskell, people, are you know haskell apps that has more than 50k downloads per month (or more than 25k users) ? -- Best regards, Bulat mailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Most popular haskell applications
Hello Ivan, Saturday, November 6, 2010, 4:05:38 AM, you wrote: Possible candidates: * GHC * XMonad * Darcs for me, darcs and ghc are programmer's instruments. xmonad is real application, having some utility outside of programmers community. i'm looking for utility of haskell for real world. i know that it's used in-house (as in Deutsche Bank) or to build some solutions. what i'm looking for is shareware or so, things that are usually written with Delphi-class languages Of course, it's hard to tell: do people actually use those packages once they've downloaded them? How do you measure downloads when some people use downstream binaries? for windows application download counter is good enough measure, at least while we compare one program with another. unfortunately, xmonad isn't a windows app :D -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: Unicode windows console output.
Hello Max, Wednesday, November 3, 2010, 1:26:50 PM, you wrote: 1. You need to use chcp 65001 to set the console code page to UTF8 2. It is very likely that your Windows console won't have the fonts required to actually make sense of the output. Pipe the output to foo.txt. If you open this file in notepad you will see the correct characters show up. it will work even without chcp. afaik nor ghc nor windows adjusts text being output to current console codepage -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] What is simplest extension language to implement?
Hello Permjacov, Tuesday, November 2, 2010, 9:04:00 AM, you wrote: Let us think, that we need some scripting language for our pure haskell project and configure-compile-run is not a way. In such a case a reasonably simple, yet standartized and wide known language should be implemented. What such language may be? http://www.haskell.org/haskellwiki/HsLua or python -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Converting Values Between Lua And Haskell
Hello aditya, Sunday, October 24, 2010, 8:05:55 AM, you wrote: HsLua page is nothing more but my fantasy about future HsLua development :) you may find even XXX type where i don't found good name :) Hi all, The HsLua page [1] says that Int,Double,String,Bool,[a] and [(a,b)] types can be converted to and from Lua values. However the on hslua API page I don't see a StackValue instance [2] for [a] or [(a,b)]. Am I missing something? -deech [1] http://www.haskell.org/haskellwiki/HsLua#Exchanging_data_between_Haskell_and_Lua_worlds [2] http://hackage.haskell.org/packages/archive/hslua/latest/doc/html/Scripting-Lua.html#t:StackValue -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] concurrency vs. I/O in GHC
Hello Claude, Saturday, October 23, 2010, 11:57:23 PM, you wrote: Is that true? The last time we discussed this in Haskell Cafe the conclusion I drew from the discussion was that unsafe foreign functions block the current thread but not any other thread. The conclusion I drew was that unsafe foreign functions block the current capability (OS thread) and any threads (Haskell forkIO etc) currently scheduled on that capability, but other capabilities and threads continue executing as normal. yes, it blocks entire capability but afaik only one haskell thread can be scheduled on some capability at any concrete moment -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] concurrency vs. I/O in GHC
Hello John, Monday, October 18, 2010, 8:15:42 PM, you wrote: If anyone is listening, I would very much like for there to be a mechanism by which external functions can be called unsafe-ly, but without blocking all other Haskell threads. I have code that does this: +RTS -N2 -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] readProcess exception
Hello Leskó, Friday, October 22, 2010, 1:50:54 AM, you wrote: I run into a problem with readProcessWithExitCode (from System.Process module). Basically what i want is to start an exe file, giving it some input on stdin and receiving the results on stdout. But id the stdin and look for other functions in the library. one that you need should read and write data simultaneously, for example by using separate thread -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Lambda-case / lambda-if
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 ability of case -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Big Arrays
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 understand that the poor design decision makes array access several times faster and doesn't limit anything except for very rare huge Bool arrays? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] EDSL for Makefile
Hello C, Sunday, October 3, 2010, 6:59:25 PM, you wrote: Thanks Neil, main = do want [file1] file1 * \x - do need [file2] putStrLn Hello putStrLn World What if I want to mention file1 only once? mention_only_once file action = do want [file] file * action main = mention_only_once file1 $ \x - do need [file2] putStrLn Hello putStrLn World -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Big Arrays
Hello Henry, Sunday, October 3, 2010, 7:54:49 PM, you wrote: It looks like array ranges can only be Ints, and not Int64 or Word64 types. yes, it's Int internally got efficiency reasons. you can do your own implementation to override this limit :) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: I still cannot seem to get a GUI working under Windows.
Hello Heinrich, Saturday, October 2, 2010, 1:36:48 PM, you wrote: Would you put a flattr button [1] on the wxHaskell page? This way, people like me would be able to show their appreciation by donating a this page doesn't describe how to pay and how to got the money received. if Jeremy lives in right country, i suggest to use PayPal donations system. it allows to pay by credit card and then receive money to author's credit card PayPal provides you the donation button like one i used at http://freearc.org/Donations.aspx -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Why can't libraries/frameworks like wxHaskell/gtk2hs/... be used with newer versions of ghc/wxWidgets/GTK+/... ?
Hello caseyh, Monday, September 27, 2010, 9:55:14 PM, you wrote: Why can't libraries/frameworks like wxHaskell/gtk2hs/... be used with newer versions of ghc/wxWidgets/GTK+/... ? because you don't compile from source code. ghc does massive inlining so parts of old ghc libraries are compiled into gtk2hs object files -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] FFI and concurrency
Hello Johannes, Friday, September 10, 2010, 2:25:58 PM, you wrote: just forkIO in threaded RTS works for me. try: main = do forkIO expensiveCalc forkIO expensiveCalc forkIO expensiveCalc expensiveCalc What's the story with FFI calls and concurrency? I have an expensive calculation performed by some C function, which I call from Haskell land. (This works like a charm.) I have several cores available. How could I run several of these calculations in parallel? Thanks, Johannes. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Style and a problem
Hello Wanas, Friday, September 10, 2010, 12:55:14 AM, you wrote: a) I want to write a function that generates lists of lists of size $n$. All having the property that sum lst = sum [1..n]. a-1) After that, I want to remove all permutations. My idea of you have very interesting questions. hopefully it was already answered at http://www.haskell.org/haskellwiki/Homework_help -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: HEAD: Deterioration in ByteString I/O
Hello Daniel, Thursday, September 9, 2010, 3:28:04 AM, you wrote: - bytestring allocates a 32K buffer to be filled and asks ghc for 32760 bytes in that buffer - ghc asks the OS for 8192 bytes (and usually gets them) btw, we made benchmarking that shown that the most efficient read/write chunk in Windows Vista is 32-64 kb one -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: [Haskell-cafe] Re: ghc HEAD
Hello Brandon, Tuesday, September 7, 2010, 8:37:32 PM, you wrote: I'd call this incomplete because programs compiled with RTS options enabled are still insecure. The correct fix is to ignore GHCRTS and die on +RTS *when setuid*. Since i strongly agree -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] overloaded list literals?
Hello Johannes, Monday, September 6, 2010, 2:23:35 PM, you wrote: i had such idea several years ago and proposed to name class ListLike. this class was finally implemented by John Goerzen and it does everything we can w/o changing language the main thing about literals is that they need to be recognized also at left side of equations, so that length (s:xs) = 1 + length xs length [] = 0 will work for ByteStrings and arrays like it work for list. if it will be implemented, then most programs manipulating on lists/strings, can be converted to more efficient ones simply by replacing imports Haskell 1.0 views may be the way to go, virtually converting other containers to lists, back and forth. of course, only if these virtual conversions will be optimized away by smart compiler I think left-biased (= singly linked) lists are much overrated in Haskell coding (and teaching). The language (syntax and Prelude) makes it just too easy to use them, and old habits (from LISP) die hard. Sure, lists serve a purpose: * they model (infinite, lazy) streams, used in the producer/transformer/consumer pattern * they are an algebraic data type, so you can use them to teach recursion ((co-)induction); but more often, lists are (mis-)used when actually * you want some efficiently index-able and concat-able sequence type * or you don't need the indexing, just membership, so you actually want Data.Set (disregarding strictness and unwanted Ord instances for the moment). It is an empirical law that in 90 percent of the cases where a computer science student says list he means set. * you avoid/forget to tell your students about algebraic data types in general. Hypothetically now ... We have overloaded numerical literals (Num.fromInteger) and we can overload string literals (IsString.fromString), so how about using list syntax ( [], : ) for anything list-like (e.g., Data.Sequence)? Of course some minor details would need to be worked out, like what methods should go in the hypothetical class IsList (is is Foldable?) and what to do about pattern matching (perhaps we don't need it?) IIRC there was a time when list comprehension would actually mean monad comprehension (when there was no do notation) but that's not what I'm getting at here. Or is it? Do we have a Haskell museum of ideas from the past? Best - J.W. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] overloaded list literals?
Hello Stefan, Monday, September 6, 2010, 3:47:11 PM, you wrote: In general, it is kind of unfortunate that type classes and type constructors share a namespace, even though there is no way to ever mix them up. btw, i also had proposal to automatically convert typeclasses used in type declarations into constraints, so that: putStr :: StringLike - IO () treated as putStr :: StringLike s = s - IO () and length :: ListLike a - Int treated as length :: ListLike (c a) = c a - Int Together with proposals i mentioned previously, it will allow to treat existing code dealing with lists/strings as generic code working with any sequential container type -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] overloaded list literals?
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/msg15656.html -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] overloaded list literals?
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 container. instead, it maps arbitrary keys to values -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[4]: [Haskell-cafe] overloaded list literals?
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. what i propose should allow to convert algorithm dealing with strings into algorithm dealing with ByteStrings, simply by changing import statement it's a cute goal - keep Haskell strings easy of use but add ByteString performance -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Operator precedence
Hello michael, Monday, September 6, 2010, 9:00:32 PM, you wrote: Is there a handy list of operators and their precedence somewhere? unlike most languages, operators are user-definable in haskell. so there is no comprehensive list any function with two arguments van be used as operator: a `min` b any operator may be defined or used as a function: () a b = ... main = print (() True False) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] On to applicative
Hello michael, Tuesday, August 31, 2010, 9:27:17 PM, you wrote: f :: Int - Int i.e. it's used when you define function types So it's a type constructor, not a type? Could you please provide a simple example of its usage? Michael --- On Tue, 8/31/10, Vo Minh Thu not...@gmail.com wrote: From: Vo Minh Thu not...@gmail.com Subject: Re: [Haskell-cafe] On to applicative To: michael rice nowg...@yahoo.com Cc: haskell-cafe@haskell.org Date: Tuesday, August 31, 2010, 1:17 PM 2010/8/31 michael rice nowg...@yahoo.com Learn You a Haskell ... says that (-) is a type just like Either. Where can I find its type definition? You can't define it *in* Haskell as user code. It is a built-in infix type constructor (Either or Maybe are type constructors too, not just types). In fact, if you want to implement a simple, typed functional language, you'll find it is the only built-in type constructor you have to implement (as the implementor of the language). Also, Show a = a is a type too, but you won't find a definition for 'a' or for '='. All those things are defined by the language. Cheers, Thu -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Arrow transformers: how to make them wright?
Hello Permjacov, Tuesday, August 31, 2010, 10:07:38 PM, you wrote: what operations should be in arrow transformer class? oh, these Russians :) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: String vs ByteString
Hello Johan, Tuesday, August 17, 2010, 12:20:37 PM, you wrote: I agree, Data.Text is great. Unfortunately, its internal use of UTF-16 makes it inefficient for many purposes. It's not clear to me that using UTF-16 internally does make Data.Text noticeably slower. not slower but require 2x more memory. speed is the same since Unicode contains 2^20 codepoints -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[4]: [Haskell-cafe] Re: String vs ByteString
Hello Johan, Tuesday, August 17, 2010, 1:06:30 PM, you wrote: So it's not clear to me that using UTF-16 makes the program noticeably slower or use more memory on a real program. it's clear misunderstanding. of course, not every program holds much text data in memory. but some does, and here you will double memory usage -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[4]: [Haskell-cafe] Re: String vs ByteString
Hello Tako, Tuesday, August 17, 2010, 12:46:35 PM, you wrote: not slower but require 2x more memory. speed is the same since Unicode contains 2^20 codepoints This is not entirely correct because it all depends on your data. of course i mean ascii chars -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Embedded scripting Language for haskell app
Hello Hemanth, Tuesday, August 17, 2010, 2:05:44 PM, you wrote: btw, i've written unfinished hslua tutorial: http://haskell.org/haskellwiki/HsLua -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: String vs ByteString
Hello Tom, Tuesday, August 17, 2010, 2:09:09 PM, you wrote: In the first iteration of the Text package, UTF-16 was chosen because it had a nice balance of arithmetic overhead and space. The arithmetic for UTF-8 started to have serious performance impacts in situations where the entire document was outside ASCII (i.e. a Russian or Arabic document), but UTF-16 was still relatively compact i don't understand what you mean. are you support all 2^20 codepoints in Data.Text package? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: String vs ByteString
Hello Tako, Tuesday, August 17, 2010, 3:03:20 PM, you wrote: Unless a Char in Haskell is 32 bits (or at least more than 16 bits) it con NOT encode all Unicode points. it's 32 bit -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: philosophy of Haskell
Hello Tillmann, Sunday, August 15, 2010, 7:40:54 PM, you wrote: But in a world passing interpretation of IO, print is supposed to be a pure Haskell function. So the value world2 can only depend on the values of print and world1, but not on the actions of some concurrent thread. the whole World includes any concurrent thread though ;) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: String vs ByteString
Hello Bryan, Sunday, August 15, 2010, 10:04:01 PM, you wrote: shared on Friday, and boiled it down to a simple test case: how long does it take to read a 31MB file? GNU wc -m: there are even slower ways to do it if you need :) if your data aren't cached, then speed is limited by HDD. if your data are cached, it should be 20-50x faster. try cat nul -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: String vs ByteString
Hello Daniel, Sunday, August 15, 2010, 10:39:24 PM, you wrote: That's great. If that performance difference is a show stopper, one shouldn't go higher-level than C anyway :) *all* speed measurements that find Haskell is as fast as C, was broken. Let's see: D:\testingread MsOffice.arc MsOffice.arc 317mb -- Done Time 0.407021 seconds (timer accuracy 0.00 seconds) Speed 779.505632 mbytes/sec -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Compiled OpenGL program has DOS window?
Hello Henk-Jan, Friday, August 13, 2010, 2:23:58 PM, you wrote: You can do this with the flag -optl-mwindows; this passes the flag -mwindows to the linker. Because this is a linker option, you cannot find it in the GHC documentation. This solution also works for other GUIs, like wxHaskell. it may be added to some GHC FAQ though -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Unwrapping long lines in text files
Hello michael, Saturday, August 14, 2010, 5:38:46 AM, you wrote: The program below takes a text file and unwraps all lines to 72 columns, but I'm getting an end of file message at the top of my output. How do I lose the EOF? use isEOF function. even better, use interact -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] What is -
Hello michael, Sunday, August 8, 2010, 5:36:05 PM, you wrote: i highly recommend you to read http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html that is the best introduction into monads i know and then http://haskell.org/all_about_monads/html/index.html - comprehensive tutorial about many useful monads both are mentioned at http://en.wikipedia.org/wiki/Monad_%28functional_programming%29 What is - ? Couldn't find anything on Hoogle. 1) main = do x - getLine -- get the value from the IO monad putStrLn $ You typed: ++ x 2) pythags = do z - [1..] --get the value from the List monad? x - [1..z] y - [x..z] guard (x^2 + y^2 == z^2) return (x, y, z) From: http://en.wikibooks.org/wiki/Haskell/Syntactic_sugar Do and proc notation Sweet Unsweet Monadic binding do x - getLIne getLine = \x - putStrLn $ You typed: ++ x putStrLn $ You typed: ++ x So, Example 2 desugared becomes... [1..] == \z - ? Michael -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] trees and pointers
Hello Jake, Friday, July 16, 2010, 7:26:22 AM, you wrote: Excluding DiffArray under certain usage patterns of course, but DiffArray is slow for unknown reasons besides algorithmic complexity. unknown reason = MVar usage ArrayRef library contains parameterized DiffArray implementation that may be specialized either to MVar or IORef usage -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: Lazy IO and asynchronous callbacks?
Hello Evan, Friday, July 9, 2010, 3:01:28 AM, you wrote: There may very well be a better way to do this, but it definitely feels better to me than relying on unsafeInterleaveIO magic. Your chan reader has to be in IO, but that's as it should be and you can still pass the chunks off to pure functions. unsafeInterleaveIO isn't magic, it's just a way to convert IO calls to pure lazy list. one should look into getContents implementation in this case longRunningReadOperation should read from the channel when it needs more data -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]
Hello Andrew, Saturday, July 3, 2010, 1:57:22 PM, you wrote: (I suppose I'm just bitter because any Haskell libraries involving C are almost guaranteed to not work on Windows...) haskell code is easily ported between OSes, unlike C one. when i ported my application from Win to Linux, i spend one day on haskell code and 3 days on C one, despite the fact that haskell code dealed with OS interaction and C used purely for computations C works on windows as well as it works on Unix, it just need some work to be ported between OSes, and since most developers just use one OS, C code has much more chances to remain OS-specific -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Are you a Haskell expert? [How easy is it to hire Haskell programmers]
Hello Ivan, Saturday, July 3, 2010, 3:24:34 PM, you wrote: haskell code is easily ported between OSes, unlike C one. when i ported my application from Win to Linux, i spend one day on haskell code and 3 days on C one, despite the fact that haskell code dealed with OS interaction and C used purely for computations Care to provide more details? This story intrigues me (even though I've never really used C that much, and would prefer to keep it that way). since 2004 i'm developing FreeArc archiver, something like winzip. in 2007 i've ported it to Linux. the only Haskell part that required was my own I/O library: i developed it in 2005 since ghc doesn't supported large files and unicode filenames at that time. my library used Win-specific calls and i, naturally, required to add some Unix way to compile it - i just used standard Haskell I/O calls generally speaking, as far as your program utilizes only existing Haskell libraries, it just work. problems starts only when existing Haskell libraries can't serve your needs and you start binding to some C or OS-specific code for the C part, i have found that some APIs i've used in mingw were in fact MSVC-compatibility ones, and was absent in Linux gcc i just looked at my darcs repository. Unix-specific patches were: added /dev/urandom as entropy source for Unix Unixifying: dir.size:=0 Added Unix support for GetPhysicalMemory, GetProcessorsCount Unix: config files in /etc; fixed compilation scripts Unix: look for SFX in /usr/lib Unix: UTF8 for filelist/screen/filenames/cmdline encoding Unix: getThreadCPUTime CUI: hidden password input now works on Unix too so, the main catch for C part were OS-specific calls like GetPhysicalMemory - i spent lot of time reading mans. for Haskell part, main changes were about default directories -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Is my code too complicated?
Hello Ertugrul, Saturday, July 3, 2010, 4:25:22 PM, you wrote: This has proven very useful for me. My usual way is writing monad transformers and sticking them together, often together with concurrent programming. ... /what/ my code is doing, because it's written in natural language as much as possible can we see such code? i always thought that monad transformers are hard to use since you need to lift operations from inner monads on every use -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Roman, Sunday, June 27, 2010, 3:52:54 AM, you wrote: I fail to see how it will brake programs. Current programs do not use Unicode because it is implemented incorrectly. i use it. current Linux implementation treats String as sequence of bytes, and with manual recoding it allows to use filesystems with any encoding -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Roman, Sunday, June 27, 2010, 11:07:47 AM, you wrote: Currently, FilePath is an alias for String. Changing FilePath to a real type Just do not change FilePath, what may be simpler? if FilePath will become abstract type, it will break all programs that use it since they use it as String -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Roman, Sunday, June 27, 2010, 11:11:59 AM, you wrote: No! The target encoding is the current locale. It is a no-brainer to not necessarily. current locale, encoding of current terminal and encoding of every filesystem mounted are all different things -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Roman, Sunday, June 27, 2010, 11:24:16 AM, you wrote: O'kay, but IMHO few people want to have a headache with recoding. You knew that the implementation was incorrect, why you relied on it? what is alternative? :) on windows i've used low-level open()-styly APIs, on Linux i got the same results with official API -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Roman, Sunday, June 27, 2010, 11:28:49 AM, you wrote: Just do not change FilePath, what may be simpler? if FilePath will become abstract type, it will break all programs that use it since they use it as String Hello, do you read me? I said: do not change FilePath. what you mean by abstract type then? :) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Roman, Sunday, June 27, 2010, 11:37:24 AM, you wrote: No! The target encoding is the current locale. It is a no-brainer to not necessarily. current locale, encoding of current terminal and encoding of every filesystem mounted are all different things And we should stick to the current locale. Problem solved. 6.3 CString The module CString provides routines marshalling Haskell into C strings and vice versa. The marshalling converts each Haskell character, representing a Unicode code point, to one or more bytes in a manner that, by default, is determined by the *current locale*. The Haskell 98 Foreign Function Interface. 1. it doesn't work on practice. ghc provides simple 8-bit conversion and i think a lot of code relies on this behavior 2. when you mount external/network volume, it doesn't necessarily has the same encoding as your current locale -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Type-Level Programming
Hello Gábor, Saturday, June 26, 2010, 4:29:28 PM, you wrote: It's interesting how C++ is imperative at the term level and functional at the type level or logic? it supports indeterminate choice -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Felipe, Saturday, June 26, 2010, 4:44:20 PM, you wrote: Even if we said we don't care, we at least should change FilePath to be [Word8], and not [String]. Currently filepaths are silently truncated if any codepoint is beyond 255. and there is no OS except Unix ;) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Core packages and locale support
Hello Felipe, Saturday, June 26, 2010, 4:54:16 PM, you wrote: Even if we said we don't care, we at least should change FilePath to be [Word8], and not [String]. Currently filepaths other OSs worked fine, should I use this API (i.e. type FilePath = String) to its fullest extent, my program will suddently become unportable to all Unix OSs. but what you propose cannot be used in Windows at all! while current FilePath still works on Unix, with manual filenames en/decoding -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: GHC.IO.Device and ready method?
Hello Dimitry, Friday, June 25, 2010, 7:06:31 PM, you wrote: As a more general question, are GHC Handles (and underlying implementations of GHC.IO.Device and GHC.IO.BufferedIO) expected to be thread-safe? i think so. i consider threads as control structure and your question looks for me the as can we use Handle in function/cycle other that one created it in particular, it was always safe to make I/O from many threads for the same Handle -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: [Haskell-cafe] Network of GUI Controls - using MonadFix?
Hello Felipe, Thursday, June 24, 2010, 5:00:55 AM, you wrote: Is that something that MonadFix is meant to be used for? In current Gtk libraries, no. You'll do something like However, if some library required you to supply the action while constructing the button, then I guess the answer would be yes. he may have his own high-level abstractions that combine create and connect, in this case the answer is yes: rdo btn1 - createAndConnectBtn btn2 btn2 - createAndConnectBtn btn3 btn3 - createAndConnectBtn btn1 -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Huffman Codes in Haskell
Hello ajb, Wednesday, June 23, 2010, 6:58:30 AM, you wrote: build ((w1,t1):(w2,t2):wts) = build $ insertBy (comparing fst) (w1+w2, Node t1 t2) wts this algo is O(n^2). to be O(n) you should handle separate lists of leafs and nodes, adding new nodes to the tail of second list -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Fun Facts: A lazy bill
Hello Leonel, Friday, June 18, 2010, 6:46:31 AM, you wrote: to be used. Look at the new 10.000 colones bill: and this one - http://www.bccr.fi.cr/WebPages/PaginaInicio/NuevaFamilia/5.html is for C++ programmers :) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Mapping a list of functions
Hello Martin, Thursday, June 17, 2010, 11:02:31 PM, you wrote: But what if I want to apply a list of functions to a single argument. I can one more answer is swing map: http://www.haskell.org/haskellwiki/Pointfree#Swing -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Terminology
Hello Emmanuel, Tuesday, June 15, 2010, 2:10:09 AM, you wrote: [f(a),f(b),f(c)] = g([a,b,c]) it looks a bit like vectorisation transformation in compilers -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Using the ContT monads for early exits of IO ?
Hello Christopher, Friday, June 11, 2010, 4:06:05 PM, you wrote: do if x then return () else do bar; continueComputation i format it this way: if x then return () else do bar continueComputation -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[4]: [Haskell-cafe] Using the ContT monads for early exits of IO ?
Hello Christopher, Friday, June 11, 2010, 4:35:00 PM, you wrote: if xthen foo else if y then bar else if z then mu else zot case () of _ | x - foo | y - bar | otherwise - zor it's usually considered as haskell way of doing this -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] is there a way to prove the equivalence of these two implementations of (Prelude) break function?
Hello David, Tuesday, June 8, 2010, 10:33:51 AM, you wrote: ( my guess is USE_REPORT_PRELUDE compiles functions as defined in the haskell report, but the other version is faster and used by default. ) you are right -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Gtk2hs-users] ANNOUNCE: GHC 6.12.3 Release Candidate 1
Hello Axel, Thursday, May 27, 2010, 8:42:08 PM, you wrote: - you use -threaded to compile your program - you only use postGUISync and postGUIAsync from threads different to the Gtk2Hs thread Is this true? If yes, I'll give you an elaboration on how threads are supposed to work in Gtk+ (I think I finally understood this!) and what I've changed in 0.11.0. i'm among (probably many) developers who interested to hear it. i believe that gtk2hs uses thread where it was initialized as main (this thread should be bound so it's either main thread or one created with runInBoundThread/forkOS) and the everything should either run in this thread directly, or in signal hadlers (that are executed in this thread) or via postGUISync/postGUIAsync. moreover postGUISync can't be used inside main GUI thread due to locking as you may remember, once i proposed to add wrapper that is equal to id in main GUI thread but equal to postGUISync in other threads. or even better, wrap all gtk2hs operations in this wrapper -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell] Gtk2Hs version 0.11.0 released
Hello Axel, Tuesday, May 25, 2010, 4:02:21 PM, you wrote: the Gtk2Hs team is very happy to announce the release of version 0.11.0, the first release that comes in Cabal packages! can be built with GHC 6.10 and 6.12 and Cabal 1.6 and 1.8. However, does it mean that i can just issue cabal install gtk with any 6.10.* or 6.12.* version and it will be compiled automatically? overall, can you please give us details what Cabal support gives to us developers who uses gtk2hs? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re[2]: [Haskell] Gtk2Hs version 0.11.0 released
Hello Axel, Thursday, May 27, 2010, 9:50:57 PM, you wrote: does it mean that i can just issue cabal install gtk with any 6.10.* or 6.12.* version and it will be compiled automatically? overall, can Maybe I'm missing the point of your question, though. for example, i can't use previous gtk2hs version with ghc 6.10.4 on windows because there is no prebuilt library and i'm not brave enough to compile it myself. is it true that gtk2hs 0.11 should automatically compile with any ghc 6.10/6.12 on windows and we no more need prebuilt installers? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re[4]: [Haskell] Gtk2Hs version 0.11.0 released
Hello Axel, Thursday, May 27, 2010, 10:13:45 PM, you wrote: http://code.haskell.org/gtk2hs/INSTALL thank you. and what if i deploy my gtk2hs application via hackage? is it enough for user to run cabal install myapp to install my app and all runtime gtk/gtk2hs libraries she need to run it? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
Re: [Haskell-cafe] double2Float is faster than (fromRational . toRational)
Hello Daniel, Friday, May 21, 2010, 11:55:35 PM, you wrote: xf = (fromRational $ toRational xd) :: Float xf = double2Float xd am still surprised how often such kinds of unobvious problems occur while programming in Haskell does it mean that all other languages you are used doesn't have such problem or that you are an inexperienced programmer? :) -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Unicode vs. System.Directory
Hello Andy, Thursday, May 27, 2010, 5:45:27 PM, you wrote: does it work both on linux and windows? i'm very interested to run executables of both kinds and look what features are really supported (i write file/archive manager and it seems that you have solved many problems that drive me crazy, such as displaying icons/filetypes, launching documents...) Hi Arie, If you don't mind binding code. You can try to use GIO APIs from my repository: http://patch-tag.com/r/AndyStewart/gio-branch/home GIO APIs handle unicode filename every well, and cross-platform. Cheers, -- Andy Arie Peterson ar...@xs4all.nl writes: After upgrading to haskell-platform-2010.1.0.0, with the improved unicode support for IO in ghc-6.12, I hoped to be able to deal with filenames containing non-ascii characters. This still seems problematic, though: $ ls m?n?? $ ghci GHCi, version 6.12.1: http://www.haskell.org/ghc/ :? for help Prelude :m +System.Directory Prelude System.Directory getDirectoryContents . = mapM_ putStrLn .. mAna?I± . I hope this passes through the various email systems unharmed; on my terminal, the output of 'ls' contains shiny unicode characters, while 'ghci' garbles up the filename. (My locale is en_GB.utf8.) Similar problems arise with functions such as 'copyFile', which refuses to handle filenames with non-ascii characters (unless wrapping it with encoding functions). Is this a known problem? I searched ghc's trac, but there are no relevant bugs for the component 'libraries/directory'. I have parts of a unicode-aware layer on top of System.Directory laying around somewhere. I was rather hoping to ditch it, but I can polish it and put it on hackage, if people are interested. Kind regards, Arie ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Re: Unicode vs. System.Directory
Hello Andy, Friday, May 28, 2010, 1:05:59 AM, you wrote: Looks my file-manager: http://farm5.static.flickr.com/4027/4584389024_782b1e09ee_o.png can you please share windows and linux executables and source code? I have finish all necessary GIO APIs at http://patch-tag.com/r/AndyStewart/gio-branch/home I will try to merge those APIs to next release version of gtk2hs when i have spare time. it seems that i can just merge these sources into my program for a while. but what is the license? believe it or not, but i have commercial project on the march -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[3]: [Haskell-cafe] Re: Unicode vs. System.Directory
Hello Bulat, Friday, May 28, 2010, 9:24:02 AM, you wrote: I have finish all necessary GIO APIs at http://patch-tag.com/r/AndyStewart/gio-branch/home but what is the license? heh, i've found COPYING file. but what you mean? if it's just about one should share all improvements to the library he was made, it's fine for me. but strictly speaking, LGPL also means you should allow user to replace himself GIO library with newer versions, it may be both hard for me and useless for users -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] executeFile failing on macosx
Hello David, Sunday, May 16, 2010, 7:18:29 PM, you wrote: executeFile is failing for me on Mac OS X 10.5.8, with ghc 6.12.1 when compiling with -threaded. Compiling without -threaded, or running on linux is fine. forkProcess $ executeFile /bin/echo False [Ok] Nothing afair, forkProcess and -threaded shouldn't work together on any Unix. can you try forkIO or forkOS instead? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] [reactive] A pong and integrate
Hello Limestraël, Saturday, May 15, 2010, 7:02:38 PM, you wrote: But when I set my beat to tick every 60 times per second, the position is well updated, but I clearly see that the display dramatically slows down after a few seconds of execution. Too heavy rate for integrate? it may be due to lot of uncollected garbage that is result of lazy evaluation. profile program to check its GC times -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] MultiParamTypeClasses, FunctionalDependencies and FlexibleInstances using GHCi
Hello Julian, Friday, May 14, 2010, 4:18:42 PM, you wrote: Now, if I type 3 + 4 it does not work, and i really don't understand why. If i ask GHCi for 3's type ($ :t 3) it will answer 3 :: (Prelude.Num t) = t. But, if 3 and 4 are Prelude.Nums and there is an instanfe Num x x x for x of Prelude.Num - than why can't GHC deduce from the definitions that 3 and 4, both Prelude.Nums, can be used with (+) since there is an instance for Prelude.Num and my class Num - and the result will of course be something of Prelude.Num? because 3 and 4 may have different types. Num is a class, Int is a concrete type. 3 without additional type signature is polymorphic value. usually type inference deduce types of numeric constants (that all are polymorphic) from context but in your case it's impossible your functional dependency allows to fix result type once parameter types are known, but not other way you appeal to *instance* definition but haskell/ghc type inference can't use instance heads to deduce types since classes are open and anyone can add later code that breaks your assumption (imagine that ghc generates code for your module and later this module is imported by someone else and additional instances are provided) btw, quite popular problem, it arrives here each month or so :) there are some ghc pragmas that somewhat break this rule, you may try allow-indecidable-insances or so. but it's dangerous way -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] What makes Haskell difficult as .NET?
Hello Don, Friday, May 14, 2010, 9:43:38 PM, you wrote: Most .NET libraries are imperative, use mutable state -- so binding to they are also OOP. ocaml supports OOP while haskell doesn't -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: -O vs. -O2
Hello Duncan, Sunday, May 9, 2010, 1:50:31 AM, you wrote: It should be -O1 for default/balanced optimisations and -O2 for things involving a bigger tradeoff in terms of code size or compile time. so cloning gcc policy may be a good choice. -O2 is the best optimization that guaranteed to make program faster and -O3 is for speculative optimization (those that may be breaked by unusual code or made program slower). not sure about -O1, may be difference is that -O1 or just -O is development-time optimization, i.e. quickdirty and -O2 generates production code -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re[2]: [Haskell-cafe] Re: Haskell and scripting
Hello Ivan, Wednesday, May 5, 2010, 4:43:48 PM, you wrote: How do you embed Lua in Haskell? http://hackage.haskell.org/package/hslua tutorial: http://haskell.org/haskellwiki/HsLua -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Writing C libraries in Haskell
Hello Richard, Saturday, May 1, 2010, 1:34:19 PM, you wrote: If libraries foo and bar are compiled using the same version of GHC, is is possible to link the two libraries into the same executable? Does at the last end, you can put each entire library plus ghc runtime into dll -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Haskell 2010 libraries
Hello Simon, Friday, April 30, 2010, 1:42:33 PM, you wrote: During the Haskell 2010 process the committee agreed that the libraries in the report should be updated, i think: if committee assignment turned out to be ambiguous, it should be returned to committee. we can discuss it here but then committee should make a clear decision -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-prime mailing list Haskell-prime@haskell.org http://www.haskell.org/mailman/listinfo/haskell-prime
Re: [Haskell-cafe] are forkIO threads event-driven?
Hello Aran, Friday, April 30, 2010, 2:26:20 AM, you wrote: In GHC, if a thread spawned by forkIO blocks on some network or disk IO, is the threading system smart enough not to wake the thread afaik, yes. it's controlled by special i/o thread that multiplexes all i/o done via stdlibs. but ghc i/o manager can't use epoll/kqueue so it's appropriate only for small (or medium?) servers read Writing High-Performance Server Applications in Haskell, Case Study: A Haskell Web Server http://www.haskell.org/~simonmar/papers/web-server.ps.gz -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Default value for numCapabilities?
Hello Dimitry, Tuesday, April 27, 2010, 8:09:49 PM, you wrote: a few months ago i asked SimonM about using all cores by default, but he said that it dramatically reduces performance in some cases Hi, As a followup to the discussion [1] about the portable way to find the number of CPUs/cores: how is the default value of numCapabilities [2] set when +RTS -N is not on the command line? Does GHC runtime figure out the number of cores itself, or it is by default 1 unless specified on the command line? Thanks. --- [1] http://haskell.org/pipermail/haskell-cafe/2010-April/076911.html [2] http://hackage.haskell.org/packages/archive/base/latest/doc/html/GHC-Conc.html#v:numCapabilities -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [Haskell-cafe] Compressing GHC tarballs with LZMA
Hello Leon, Saturday, April 24, 2010, 12:23:58 AM, you wrote: file nearly a third smaller. Given that many modern variants of the tar command support .tar.lzma files directly isn't latest version of lzma-based compression use .xz extension? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] GHC, odd concurrency space leak
Hello Bertram, Sunday, April 18, 2010, 3:36:31 AM, you wrote: This expands as always a = a always a = a a always a = a a a always a ... where each application is represented by a newly allocated object (or several, I have not looked at it in detail) on the heap. why you think so? i always thought that in ghc just sequentially executes statements, the RealWorld magic exists only at compile-time -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] GHC, odd concurrency space leak
Hello Jason, Saturday, April 17, 2010, 2:00:04 AM, you wrote: Well, I think Bulat correctly characterized the non-termination aspect. I didn't think the cooperative aspect of threading applied with the threaded RTS, so I'm not 100% sure I believe his characterization, but otherwise it seems like a reasonable explanation. it's a well known side of ghc green threads implementation. read notes in sources of Control.Concurrent module: The concurrency extension for Haskell is described in the paper /Concurrent Haskell/ http://www.haskell.org/ghc/docs/papers/concurrent-haskell.ps.gz. Concurrency is lightweight, which means that both thread creation and context switching overheads are extremely low. Scheduling of Haskell threads is done internally in the Haskell runtime system, and doesn't make use of any operating system-supplied thread packages. GHC implements pre-emptive multitasking: the execution of threads are interleaved in a random fashion. More specifically, a thread may be pre-empted whenever it allocates some memory, which unfortunately means that tight loops which do no allocation tend to lock out other threads (this only seems to happen with pathological benchmark-style code, however). -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] GHC, odd concurrency space leak
Hello Bertram, Sunday, April 18, 2010, 12:11:05 AM, you wrote: always a = -- let act = a act in act do _ - a always a hinting at the real problem: 'always' actually creates a long chain of actions instead of tying the knot. can you explain it deeper? it's what i see: always definition is equivalent to always a = do a always a what's the same as always a = a always a that looks exactly like your commented out definition, except that it doesn't create value act. but i don't see list of actions here -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe