[Haskell-cafe] Re: Logo Preferences
On Sun, 08 Mar 2009 16:19:43 -0700, Ashley Yakeley ash...@semantic.org wrote: [...] I'm currently liking 30 (specifically, 30.7) 58 61 (specifically, the second image) 62 It would be nice to be able to specify a specific member image of a group of images; for example, the second image in group 61. Currently, none of the member images in group 61 is individually numbered; will we be able to choose a specific image from this kind of group? Also, it might be nice to have some more variations for group 61, specifically; for example, it may be nice to be able to select the text for the second image, combined with the snowflake symbol for the lower-right corner logo of the leftmost rectangle of images: Although the font for the two is identical, the spacing is subtly wider in the former. -- Benjamin L. Russell -- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 Furuike ya, kawazu tobikomu mizu no oto. -- Matsuo Basho^ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to make a dock window for xmonad using gtk2hs?
On 2009 Mar 8, at 23:45, Magicloud Magiclouds wrote: Here is my window, seems right... but cannot get a gap Once again: where's the _NET_WM_STRUT? I've looked through your properties, but none of them is _NET_WM_STRUT. Non-tiling window managers may dock the window in a default fashion because of _NET_WM_WINDOW_TYPE, but xmonad needs to know how much space to reserve for it. WM_HINTS(WM_HINTS): Client accepts input or input focus: True Initial state is Normal State. window id # of group leader: 0x181 _NET_WM_SYNC_REQUEST_COUNTER(CARDINAL) = 25165829 _NET_WM_WINDOW_TYPE(ATOM) = _NET_WM_WINDOW_TYPE_DOCK _NET_WM_USER_TIME_WINDOW(WINDOW): window id # 0x184 WM_CLIENT_LEADER(WINDOW): window id # 0x181 _NET_WM_PID(CARDINAL) = 16671 WM_LOCALE_NAME(STRING) = zh_CN.UTF-8 WM_CLIENT_MACHINE(STRING) = shidaw.desktop.amazon.com WM_NORMAL_HINTS(WM_SIZE_HINTS): program specified minimum size: 162 by 54 window gravity: NorthWest WM_PROTOCOLS(ATOM): protocols WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING, _NET_WM_SYNC_REQUEST WM_CLASS(STRING) = sideBar.rb, SideBar.rb WM_ICON_NAME(STRING) = sideBar.rb _NET_WM_ICON_NAME(UTF8_STRING) = 0x73, 0x69, 0x64, 0x65, 0x42, 0x61, 0x72, 0x2e, 0x72, 0x62 WM_NAME(STRING) = sideBar.rb _NET_WM_NAME(UTF8_STRING) = 0x73, 0x69, 0x64, 0x65, 0x42, 0x61, 0x72, 0x2e, 0x72, 0x62 -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo Preferences
On Mon, Mar 9, 2009 at 12:19 AM, Ashley Yakeley ash...@semantic.org wrote: Eelco Lempsink wrote: The list with options can be found here (for now): http://community.haskell.org/~eelco/poll.html Notice that some (very) similar logos are grouped as one option (thanks to Ian Lynagh) All submissions compete, so that still makes more than a 100 options! Lots of nice submissions! Here are some thing that are worth keeping in mind when voting. How does the logo work: * on different backgrounds (in particular: white), * at small sizes (on file system icons, 16x16 pixels browser favicon, etc), and * in different cultures (i.e. does it contain e.g. a pun that many people won't understand). Cheers, Johan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Parsing floating point numbers
On Sun, 8 Mar 2009, Felipe Lessa wrote: On Sun, Mar 8, 2009 at 9:34 PM, Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: (For my current needs the formats accepted by read are sufficient, but I want reasonable error handling (Maybe or Either) instead of an exception on bad inputs.) Why not readM :: (Monad m, Read a) = String - m a readM str = case [x | (x,) - readsPrec 0 str] of [x] - return x _ - fail readM: failed Also, I remember seeing this function exported by some module, but I don't remember where. http://www.haskell.org/pipermail/libraries/2008-February/009202.html http://www.haskell.org/pipermail/haskell-cafe/2008-June/044590.html Although maybeRead was proposed, I cannot find it: http://hackage.haskell.org/packages/archive/base/4.0.0.0/doc/html/Text-Read.html (Btw. I find it really great, that now the 'base' package documentation can be found on Hackage!) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Purely Functional Data Structures
On Sat, 7 Mar 2009, Gü?nther Schmidt wrote: is the above mentioned book still *the* authority on the subject? I bought the book, read about 10 pages and then put it back on the shelf. Um. In my app I have to deal with 4 csv files, each between 5 - 10 mb, and some static data. I had put all that data into an Sqlite3 database and used SQL on it. But, as the requirements keep changing the SQL becomes a bit messy. I guess we've all had that experience. So I'm wondering if I will find clues in this book how to do my querying and handling of moderately large data in a more haskellish way and be able to drop the SQL. If this CSV processing is of pipe style, you may want to try a lazy CSV parser and formatter: http://hackage.haskell.org/cgi-bin/hackage-scripts/package/spreadsheet-0.1___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bytestring vs. uvector
On Sat, 7 Mar 2009, Bryan O'Sullivan wrote: On Sat, Mar 7, 2009 at 10:23 PM, Alexander Dunlap alexander.dun...@gmail.com wrote: Hi all, For a while now, we have had Data.ByteString[.Lazy][.Char8] for our fast strings. Now we also have Data.Text, which does the same for Unicode. These seem to be the standard for dealing with lists of bytes and characters. Now we also have the storablevector, uvector, and vector packages. These seem to be also useful for unpacked data, *including* Char and Word8 values. What is the difference between bytestring and these new fast array libraries? Are the latter just generalizations of the former? storablevector is not mature (I'm not even sure if it's actually used) and is a derivative of an old version of the bytestring library, and so has similar characteristics for interacting with foreign code. It contains some old fusion code that is sketchy in nature and somewhat likely to be broken. I'm not sure I would recommend using this library. As maintainer of storablevector I can tell that I use it for realtime audio signal processing. Indeed, I expected more of the fusion mechanism than it can do. It is hard to get correct fusion on lazy storablevectors at all, because of non-matching chunk sizes. Thus I didn't follow that path anymore. For audio signal processing I use a list type, like that of the Streams approach. When you convert those streams into storable vectors you get efficient inner loops without any fusion. It would certainly be worth to fuse with those Stream lists, but I haven't tried that so far. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo Preferences
On Sun, Mar 8, 2009 at 11:19 PM, Ashley Yakeley ash...@semantic.org wrote: Eelco Lempsink wrote: The list with options can be found here (for now): http://community.haskell.org/~eelco/poll.html Notice that some (very) similar logos are grouped as one option (thanks to Ian Lynagh) All submissions compete, so that still makes more than a 100 options! The voting system we'll use is the Condorcet Internet Voting System ( http://www.cs.cornell.edu/andru/civs.html). So ranking all 100+ items on the Condorcet ballot is a bit of a daunting task. However, if we get a rough idea of the favourites, we can each cut down a bit on the work. For instance, suppose 82 and 93 are very popular. You might not like either of them, but it's worth ranking them on your ballot (after the ones you do like) if you have a preference between them. But there's less need to rank the ones no-one likes. I'm pretty sure this is precisely how the system works. You bring the ones you care about to the top and rank them, and everything else shares a rank at the bottom (or you could pick a few of those that you really dislike and put them even lower than the default rank). But the point is that you shouldn't need to rank every single logo, just the ones you care about and then you leave the rest at the default rank. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bytestring vs. uvector
On Mon, 9 Mar 2009, Claus Reinke wrote: Given the close relationship between uvector and vector, it would be very helpful if both package descriptions on hackage could point to a common haskell wiki page, starting out with the text and link above, plus a link to the stream fusion paper (I hadn't been aware that vector incorporates the recycling work, and had often wondered about the precise relationship between those two packages). Apart from saving others from similar confusion, that would also provide a place to record experience with those two alternatives. I have at least started a page which mentions the existing alternatives: http://www.haskell.org/haskellwiki/Storable_Vector ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] Logo Preferences
Hello Sebastian, Monday, March 9, 2009, 1:08:50 PM, you wrote: i think we should make 2-stage voting, like in F1 after 1st stage we will know which logos are most popular and therefore are real candidates, so we can select among them On Sun, Mar 8, 2009 at 11:19 PM, Ashley Yakeley ash...@semantic.org wrote: Eelco Lempsink wrote: The list with options can be found here (for now): http://community.haskell.org/~eelco/poll.html Notice that some (very) similar logos are grouped as one option (thanks to Ian Lynagh) All submissions compete, so that still makes more than a 100 options! The voting system we'll use is the Condorcet Internet Voting System (http://www.cs.cornell.edu/andru/civs.html). So ranking all 100+ items on the Condorcet ballot is a bit of a daunting task. However, if we get a rough idea of the favourites, we can each cut down a bit on the work. For instance, suppose 82 and 93 are very popular. You might not like either of them, but it's worth ranking them on your ballot (after the ones you do like) if you have a preference between them. But there's less need to rank the ones no-one likes. I'm pretty sure this is precisely how the system works. You bring the ones you care about to the top and rank them, and everything else shares a rank at the bottom (or you could pick a few of those that you really dislike and put them even lower than the default rank). But the point is that you shouldn't need to rank every single logo, just the ones you care about and then you leave the rest at the default rank. -- 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] Logo Preferences
On Mon, 9 Mar 2009, Bulat Ziganshin wrote: Hello Sebastian, Monday, March 9, 2009, 1:08:50 PM, you wrote: i think we should make 2-stage voting, like in F1 after 1st stage we will know which logos are most popular and therefore are real candidates, so we can select among them Sounds reasonable, although I thought that those advanced voting systems are also intended for avoiding multiple elections. Then again, if both elections lead to the same ranking at the top, and especially yield the same top candidate, then this proves the soundness of the method. On the other hand, a dictatorship would also satisfy this property. Yes, I know, there was a Nobel Prize about that ... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Parsing floating point numbers
Bjorn Buckwalter bjorn.buckwal...@gmail.com wrote: What is your preferred method of parsing floating point numbers (from String to Float/Double)? Parsec it seems only does positive floats out of the box and PolyParse requires the float to be on scientific form (exponential). Thanks for the bug report. Polyparse is now fixed. New version (polyparse-1.3) available on Hackage. And my apologies. This was purely an oversight - the real-world use-case at the time I wrote the code for Text.Parse.parseFloat was entirely dependent on scientific notation, and I neglected the more usual case. For those looking for a template to implement textual float-parsing that is faster (or has better error messages) than the H'98 Read class, feel free to translate this code into your own parser combinator library of choice: http://www.cs.york.ac.uk/fp/polyparse/haddock/src/Text/Parse.html#parseFloat (Note that the actual instances of the Parse class for Float and Double use parseSigned parseFloat to deal with non-positive numbers.) Regards, Malcolm ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Logo Preferences
On Mon, Mar 9, 2009 at 10:30 AM, Bulat Ziganshin bulat.zigans...@gmail.comwrote: Hello Sebastian, Monday, March 9, 2009, 1:08:50 PM, you wrote: i think we should make 2-stage voting, like in F1 after 1st stage we will know which logos are most popular and therefore are real candidates, so we can select among them One of the reasons condorcet voting is good is that this isn't needed. If everyone is consistent in which logos they prefer the results from second voting stage will be identical to just picking the condorcet voting from the first stage. The interface to the condorcet voting site is actually pretty good (try out one of the samples), so it's pretty easy to just move to top the ones you prefer and move the ones you dislike to the bottom. Then you can ignore the vast majority of don't care logos in the middle, and just fine tune your ranking at the top and bottom. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Logo Preferences
On Mon, Mar 9, 2009 at 10:52 AM, Sebastian Sylvan sebastian.syl...@gmail.com wrote: On Mon, Mar 9, 2009 at 10:30 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Sebastian, Monday, March 9, 2009, 1:08:50 PM, you wrote: i think we should make 2-stage voting, like in F1 after 1st stage we will know which logos are most popular and therefore are real candidates, so we can select among them One of the reasons condorcet voting is good is that this isn't needed. If everyone is consistent in which logos they prefer the results from second voting stage will be identical to just picking the condorcet voting from the first stage. picking the condorcet winner -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Logo Preferences
On Mon, Mar 9, 2009 at 6:13 AM, Benjamin L. Russell dekudekup...@yahoo.comwrote: On Sun, 08 Mar 2009 16:19:43 -0700, Ashley Yakeley ash...@semantic.org wrote: [...] I'm currently liking 30 (specifically, 30.7) 58 61 (specifically, the second image) 62 It would be nice to be able to specify a specific member image of a group of images; for example, the second image in group 61. Currently, none of the member images in group 61 is individually numbered; will we be able to choose a specific image from this kind of group? Another reason condorcet voting is nice is that there is no need to group similar items together. Condorcet voting eliminates the spoiler candidate effect, so having N almost identical entries won't adversely affect that group (by spreading out the votes for that group among more sub-entries than for groups with only one entry in it). So actually I don't understand whey the logos are grouped at all, they could all just be listed individually, and then people can put them all at the same rank (make tie in the interface) if they don't care which one of the group they want, or they can differentiate between them if they like. You could possibly name them 60 a, 60 b etc. to indicate that they are similar, but there's no reason not to allow people to differentiate between them if tehy so choose. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Logo Preferences
Another reason condorcet voting is nice is that there is no need to group similar items together. Condorcet voting eliminates the spoiler candidate effect, so having N almost identical entries won't adversely affect that group (by spreading out the votes for that group among more sub-entries than for groups with only one entry in it). So actually I don't understand whey the logos are grouped at all, they could all just be listed individually, and then people can put them all at the same rank (make tie in the interface) if they don't care which one of the group they want, or they can differentiate between them if they like. You could possibly name them 60 a, 60 b etc. to indicate that they are similar, but there's no reason not to allow people to differentiate between them if tehy so choose. I agree with this. There are some groupings that seem arbitrary. For example, a number of entries are grouped together, because they use the same graphic with different colors. I think color is an important part of a logo. (Many companies have a recognizable color scheme that covers more than just their logo. See sun.com, microsoft.com, etc.) It will be a major factor in my vote. I don't want to vote for a design that may have more than one possible outcome. As for what Johan said, it's definitely helpful to see logos on black and white and in different sizes. Sean ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Logo Preferences
On Mon, Mar 09, 2009 at 11:13:40AM +, Sebastian Sylvan wrote: Another reason condorcet voting is nice is that there is no need to group similar items together. I think the plan is that once a logo class is chosen, we'll have another vote for the actual colour scheme etc to be used, if applicable. Yes, we could have done this in a single vote, but then people would need to spend time creating 30 variants of each logo, and we'd be ranking 3000, rather than 100, options. Thanks Ian ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I want to write a compiler
On Sat, Mar 07, 2009 at 07:45:06PM -0600, Austin Seipp wrote: (On that note, I am currently of the opinion that most of LHC's major deficiencies, aside from a few parser bugs or some needed optimizations, comes from the fact that compiling to C is currently our only option; because of it, we have no exception handling or proper garbage collection at all. As well, the runtime system is a little needlessly 'clever' (if small and understandable) so it can deal with that.) It would be interesting if you could revive the ghc back end I wrote for jhc in lhc. the code is still in the repository but was disabled a while ago, and I was just fretting over whether I should just delete it from the codebase as an interesting experiment. I mainly used it as a debugging aid once upon a time, but it was difficult to keep up to date with the C back end. I know it is sort of a silly back end, but it might be interesting. Having dealt with GRIN as I work on LHC (when time now permits...) I can say that it's a reasonable strategy and in practice it turns out pretty well, but if you're not into optimizing the code, then STG might be a better fit. I think a big deciding factor here would be the answer to one question do you want to deal with unboxed values in your compiler internally? As in, you plan on a lazy language, so, do you ever want to open up those thunks and deal with unboxed values in your compiler guts or do you want to treat them as abstract boxes to be evaluated by the runtime? if you do want to think about unboxed values, for optimization or other purposes, bite the bullet and go for something like GRIN as the back end and support unboxed values all the way through to the front end from the get go. If you really only want to support lazy thunks, go with one of the quasi virtual machine style implementations like STG. John -- John Meacham - ⑆repetae.net⑆john⑈ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I want to write a compiler
Excerpts from John Meacham's message of Mon Mar 09 07:28:25 -0500 2009: On Sat, Mar 07, 2009 at 07:45:06PM -0600, Austin Seipp wrote: (On that note, I am currently of the opinion that most of LHC's major deficiencies, aside from a few parser bugs or some needed optimizations, comes from the fact that compiling to C is currently our only option; because of it, we have no exception handling or proper garbage collection at all. As well, the runtime system is a little needlessly 'clever' (if small and understandable) so it can deal with that.) It would be interesting if you could revive the ghc back end I wrote for jhc in lhc. the code is still in the repository but was disabled a while ago, and I was just fretting over whether I should just delete it from the codebase as an interesting experiment. I mainly used it as a debugging aid once upon a time, but it was difficult to keep up to date with the C back end. I know it is sort of a silly back end, but it might be interesting. Indeed, I stumbled upon it whilst looking at how unsafeCoerce worked (to find out it is super-duper-special and implemented as part of E.) I think it's actually pretty clever, and who knows, maybe it could be useful as at least a debugging aid. :) I think a big deciding factor here would be the answer to one question do you want to deal with unboxed values in your compiler internally? As in, you plan on a lazy language, so, do you ever want to open up those thunks and deal with unboxed values in your compiler guts or do you want to treat them as abstract boxes to be evaluated by the runtime? if you do want to think about unboxed values, for optimization or other purposes, bite the bullet and go for something like GRIN as the back end and support unboxed values all the way through to the front end from the get go. If you really only want to support lazy thunks, go with one of the quasi virtual machine style implementations like STG. John This is a very good point I hadn't even thought about! Indeed, since GRIN represents thunks in a defunctionalized way - encoded as nodes - dealing with boxed/unboxed values becomes more of the compiler's job, since the nature of unboxed values etc. becomes more transparent. Since you bring this up, I figure this decision also had some influence on E in lhc/jhc, considering its type system is rich enough to distinguish values in whnf/boxed/unboxed etc.? Austin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Parsing floating point numbers
Although maybeRead was proposed, I cannot find it: here's a replacement... http://hackage.haskell.org/packages/archive/safe/0.2/doc/html/Safe.html#v%3AreadMay Greetings, Daniel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Partial pattern matching
In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
The question is, is there some very important reason you can't do this? firstCoord (P x _) = x 2009/3/9 Peter Verswyvelen bugf...@gmail.com In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
P x is indistinguishable neither in compile-time nor in run-time from the value \y - P x y. And pattern matching and equality on functions is, of course, undecidable. 2009/3/9 Peter Verswyvelen bugf...@gmail.com: In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Eugene Kirpichov Web IR developer, market.yandex.ru ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
Peter Verswyvelen wrote: In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? What would be the type of firstCoord? Typically, you'd use data Pair a b = P { firstCoord :: a , secondCoord :: b } or firstCoord (P x _) = x secondCoord (P _ y) = y Regards, -- Jochem Berndsen | joc...@functor.nl GPG: 0xE6FABFAB ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
I mean, there is no way to write a firstCoord function so that it would work, for example, on '\y - P 42 y' and yield 42. Except for this one: firstCoord proj = case (proj undefined) of P x y - x However, this requires proj to be non-strict in its remaining argument. But this will actually work if you pass P x to it for some x, because it *is* non-strict in the remaining argument. 2009/3/9 Eugene Kirpichov ekirpic...@gmail.com: P x is indistinguishable neither in compile-time nor in run-time from the value \y - P x y. And pattern matching and equality on functions is, of course, undecidable. 2009/3/9 Peter Verswyvelen bugf...@gmail.com: In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Eugene Kirpichov Web IR developer, market.yandex.ru -- Eugene Kirpichov Web IR developer, market.yandex.ru ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
Am Montag, 9. März 2009 17:30 schrieb Peter Verswyvelen: In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? For one, the type. If x :: a, then P x :: b - Pair a b, so we'd have firstCoord :: (b - Pair a b) - a But you can pattern-match only on constructors of the appropriate type. P is not a constructor of (b - Pair a b) (function types don't have constructors), so you can't match on a partially applied constructor. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
Yes of course, P x is a function, and you can't pattern match against functions, I knew that. How silly of me, I could have guessed that myself. On Mon, Mar 9, 2009 at 5:43 PM, Daniel Fischer daniel.is.fisc...@web.dewrote: Am Montag, 9. März 2009 17:30 schrieb Peter Verswyvelen: In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? For one, the type. If x :: a, then P x :: b - Pair a b, so we'd have firstCoord :: (b - Pair a b) - a But you can pattern-match only on constructors of the appropriate type. P is not a constructor of (b - Pair a b) (function types don't have constructors), so you can't match on a partially applied constructor. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Logo Preferences
2009/3/9 Sebastian Sylvan sebastian.syl...@gmail.com On Mon, Mar 9, 2009 at 10:30 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Sebastian, Monday, March 9, 2009, 1:08:50 PM, you wrote: i think we should make 2-stage voting, like in F1 after 1st stage we will know which logos are most popular and therefore are real candidates, so we can select among them One of the reasons condorcet voting is good is that this isn't needed. If everyone is consistent in which logos they prefer the results from second voting stage will be identical to just picking the condorcet voting from the first stage. The interface to the condorcet voting site is actually pretty good (try out one of the samples), so it's pretty easy to just move to top the ones you prefer and move the ones you dislike to the bottom. Then you can ignore the vast majority of don't care logos in the middle, and just fine tune your ranking at the top and bottom. With so many candidates, I think a two-stage process would be helpful. For example, what if a variant of a logo I liked ended up being popular, but I missed that one and didn't rank it (not unreasonable, there are a hundred logos). After the top candidates have been selected, I will surely notice it up there. Of course, introducing multi-stage voting breaks some of the properties we'd like a voting system to have. But, alas, you (provably) can't have it all :-) Luke ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
On Mon, Mar 9, 2009 at 10:37 AM, Eugene Kirpichov ekirpic...@gmail.comwrote: I mean, there is no way to write a firstCoord function so that it would work, for example, on '\y - P 42 y' and yield 42. Except for this one: firstCoord proj = case (proj undefined) of P x y - x However, this requires proj to be non-strict in its remaining argument. But this will actually work if you pass P x to it for some x, because it *is* non-strict in the remaining argument. That's brilliant. Any function which behaves like P x but is strict in the second argument is in fact a different function. So this trick is a semidecidable pattern for this function. Bring in the unamb, so we can do interesting things with semidecidable predicates :-) (I still don't like the proof obligation of unamb, and would like to see it picked up to a higher level of abstraction where the usage is always correct) Luke ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Logo Preferences
On Mon, 2009-03-09 at 10:08 +, Sebastian Sylvan wrote: But the point is that you shouldn't need to rank every single logo, just the ones you care about and then you leave the rest at the default rank. You'll also want to rank the popular ones even if you don't like them. -- Ashley Yakeley ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Partial pattern matching
You can use the record syntax to get around some of this: data P { first :: Int, second :: Int } firstCoord (P {first = f}) = f 2009/3/9 Peter Verswyvelen bugf...@gmail.com In Haskell, a data constructor can be used partially applied: data Pair a b = P a b f = P 1 however, I cannot do partial pattern matching, e.g firstCoord (P x) = x does not work. I guess a very important reason must exist why this is the case? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- /jve ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Distributing Linux binaries
Hi folks, I've got an application to release. I'm releasing the source, but I also wanted to release binary versions for people that don't have GHC. I developed on Windows, so making a Windows executable was simple. I also have access to an Ubuntu Linux box, on which I can easily build and test my app. But, I'm a bit confused about how to release binaries for Linux. It's not so simple as on Windows. Or, maybe it is but I don't know it. What do people recommend as a way of distributing Linux binaries? I tried to make a Debian package and couldn't figure it out, but maybe that's overkill. GHC itself has some kind of tarball for the binary distributions, one for Debian and one for Red Hat. How would I make such a package and what would go into it? There's only one executable, so it shouldn't be too complicated. I figure the main issue on Linux is that when you compile it, it's linked to specific shared libraries. Don't have a Mac myself but I'm happy to have Mac folks submit binaries. I'll worry about that later. - Lyle ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Distributing Linux binaries
lists: Hi folks, I've got an application to release. I'm releasing the source, but I also wanted to release binary versions for people that don't have GHC. I developed on Windows, so making a Windows executable was simple. I also have access to an Ubuntu Linux box, on which I can easily build and test my app. But, I'm a bit confused about how to release binaries for Linux. It's not so simple as on Windows. Or, maybe it is but I don't know it. What do people recommend as a way of distributing Linux binaries? I tried to make a Debian package and couldn't figure it out, but maybe that's overkill. GHC itself has some kind of tarball for the binary distributions, one for Debian and one for Red Hat. How would I make such a package and what would go into it? There's only one executable, so it shouldn't be too complicated. You could make a .cabal package for it, and use that to construct a binary tar.gz bundle that's installable. Duncan, is there a cabal binary-dist? -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Minimum Int?
Is there a function that yields the minimum value of Int on an implementation? -- Colin Adams Preston Lancashire ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Minimum Int?
Prelude minBound :: Int -2147483648 /jve On Mon, Mar 9, 2009 at 4:44 PM, Colin Paul Adams co...@colina.demon.co.ukwrote: Is there a function that yields the minimum value of Int on an implementation? -- Colin Adams Preston Lancashire ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Minimum Int?
colin: Is there a function that yields the minimum value of Int on an implementation? Prelude minBound :: Int -9223372036854775808 Prelude maxBound :: Int 9223372036854775807 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: Future 1.1.0 concurrency library
Hello, As a side effect of the discussion of the new C++ future/promise features at http://lambda-the-ultimate.org/node/3221 I have implemented a Haskell package called future at http://hackage.haskell.org/cgi-bin/hackage-scripts/package/future This ought to do what C++ standard futures/promises do, plus a bit more. The main operation is forkPromise :: IO a - IO (Promise a) This sets the IO a operation running in a fresh thread. The eventual result can be accessed in many ways (non-blocking, blocking, blocking with timeout). let one :: Int; one = 1 p - forkPromise (return (one+one)) x - get y - wait x is an Int with value 2. y is an (Either SomeException Int) with value (Right 2). The useful thing about futures, as opposed to various IVar packages, is handling the case where the forked operation ends with an exception. The exception becomes the return value of the promise. The get operation rethrows it, the wait operation returns it as (Left ...). There is also an abort command to kill a promise. The dead promise may then have an exceptions as its value. The plus a bit more than C++ is the nonblocking addTodo feature. This takes a continuation function from the Either SomeException a to an IO operation. These continuation functions get queued and they are run immediately after the the forked operation completes. Once completed any new addTodo continuations run immediately. These continuations allow you to race a list of action and take the first one done, or to collect the answers as they complete into a Chan. Both of those options are demonstrated in Future.hs as racePromises and forkPromises. It should be safe to use unsafePerformIO . get or unsafePeformIO . wait to get lazy access to the result, which is itself immutable once set. Cheers, Chris ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Future 1.1.0 concurrency library
This is way cool! /jve On Mon, Mar 9, 2009 at 4:54 PM, ChrisK hask...@list.mightyreason.comwrote: Hello, As a side effect of the discussion of the new C++ future/promise features at http://lambda-the-ultimate.org/node/3221 I have implemented a Haskell package called future at http://hackage.haskell.org/cgi-bin/hackage-scripts/package/future This ought to do what C++ standard futures/promises do, plus a bit more. The main operation is forkPromise :: IO a - IO (Promise a) This sets the IO a operation running in a fresh thread. The eventual result can be accessed in many ways (non-blocking, blocking, blocking with timeout). let one :: Int; one = 1 p - forkPromise (return (one+one)) x - get y - wait x is an Int with value 2. y is an (Either SomeException Int) with value (Right 2). The useful thing about futures, as opposed to various IVar packages, is handling the case where the forked operation ends with an exception. The exception becomes the return value of the promise. The get operation rethrows it, the wait operation returns it as (Left ...). There is also an abort command to kill a promise. The dead promise may then have an exceptions as its value. The plus a bit more than C++ is the nonblocking addTodo feature. This takes a continuation function from the Either SomeException a to an IO operation. These continuation functions get queued and they are run immediately after the the forked operation completes. Once completed any new addTodo continuations run immediately. These continuations allow you to race a list of action and take the first one done, or to collect the answers as they complete into a Chan. Both of those options are demonstrated in Future.hs as racePromises and forkPromises. It should be safe to use unsafePerformIO . get or unsafePeformIO . wait to get lazy access to the result, which is itself immutable once set. Cheers, Chris ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Future 1.1.0 concurrency library
I'd also like to point out that Chris did this with 165 lines of code--including comments and whitespace! If you drop the whitespace and comments, it's only 91 lines! /jve On Mon, Mar 9, 2009 at 4:54 PM, ChrisK hask...@list.mightyreason.comwrote: Hello, As a side effect of the discussion of the new C++ future/promise features at http://lambda-the-ultimate.org/node/3221 I have implemented a Haskell package called future at http://hackage.haskell.org/cgi-bin/hackage-scripts/package/future This ought to do what C++ standard futures/promises do, plus a bit more. The main operation is forkPromise :: IO a - IO (Promise a) This sets the IO a operation running in a fresh thread. The eventual result can be accessed in many ways (non-blocking, blocking, blocking with timeout). let one :: Int; one = 1 p - forkPromise (return (one+one)) x - get y - wait x is an Int with value 2. y is an (Either SomeException Int) with value (Right 2). The useful thing about futures, as opposed to various IVar packages, is handling the case where the forked operation ends with an exception. The exception becomes the return value of the promise. The get operation rethrows it, the wait operation returns it as (Left ...). There is also an abort command to kill a promise. The dead promise may then have an exceptions as its value. The plus a bit more than C++ is the nonblocking addTodo feature. This takes a continuation function from the Either SomeException a to an IO operation. These continuation functions get queued and they are run immediately after the the forked operation completes. Once completed any new addTodo continuations run immediately. These continuations allow you to race a list of action and take the first one done, or to collect the answers as they complete into a Chan. Both of those options are demonstrated in Future.hs as racePromises and forkPromises. It should be safe to use unsafePerformIO . get or unsafePeformIO . wait to get lazy access to the result, which is itself immutable once set. Cheers, Chris ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Future 1.1.0 concurrency library
Who needs to build futures into the language -- all you need is MVars, eh? -- Don vanenkj: I'd also like to point out that Chris did this with 165 lines of code--including comments and whitespace! If you drop the whitespace and comments, it's only 91 lines! ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Distributing Linux binaries
On Monday 09 March 2009 01:26:37 pm Don Stewart wrote: lists: Hi folks, I've got an application to release. I'm releasing the source, but I also wanted to release binary versions for people that don't have GHC. I developed on Windows, so making a Windows executable was simple. I also have access to an Ubuntu Linux box, on which I can easily build and test my app. But, I'm a bit confused about how to release binaries for Linux. It's not so simple as on Windows. Or, maybe it is but I don't know it. What do people recommend as a way of distributing Linux binaries? I tried to make a Debian package and couldn't figure it out, but maybe that's overkill. GHC itself has some kind of tarball for the binary distributions, one for Debian and one for Red Hat. How would I make such a package and what would go into it? There's only one executable, so it shouldn't be too complicated. You could make a .cabal package for it, and use that to construct a binary tar.gz bundle that's installable. Duncan, is there a cabal binary-dist? This seems like the best way to release it to me. Individual distros can package cabalised source tarballs as they choose; any typical user can cabal install the package. Regards, -- Conrad Meyer kon...@tylerc.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[2]: [Haskell-cafe] Logo Preferences
On Mon, Mar 9, 2009 at 5:26 PM, Luke Palmer lrpal...@gmail.com wrote: 2009/3/9 Sebastian Sylvan sebastian.syl...@gmail.com On Mon, Mar 9, 2009 at 10:30 AM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Sebastian, Monday, March 9, 2009, 1:08:50 PM, you wrote: i think we should make 2-stage voting, like in F1 after 1st stage we will know which logos are most popular and therefore are real candidates, so we can select among them One of the reasons condorcet voting is good is that this isn't needed. If everyone is consistent in which logos they prefer the results from second voting stage will be identical to just picking the condorcet voting from the first stage. The interface to the condorcet voting site is actually pretty good (try out one of the samples), so it's pretty easy to just move to top the ones you prefer and move the ones you dislike to the bottom. Then you can ignore the vast majority of don't care logos in the middle, and just fine tune your ranking at the top and bottom. With so many candidates, I think a two-stage process would be helpful. For example, what if a variant of a logo I liked ended up being popular, but I missed that one and didn't rank it (not unreasonable, there are a hundred logos). After the top candidates have been selected, I will surely notice it up there. Of course, introducing multi-stage voting breaks some of the properties we'd like a voting system to have. But, alas, you (provably) can't have it all :-) It just seems like duplicated work to me. They're still few enough that I can scan through them and multi-select the ones I like and then click move to top in a pretty short amount of time (and then refine the ranking if I care). Having to vote twice just seems like a lot of extra effort for questionable added benefit. Maybe one vote requires people to be more careful about their rank (though you'd hope that any minor mistakes, such as the one you describe, would be random and therefore roughly cancel out over a few hundred votes), but at least it won't require them to vote twice. I say leave the plan the way it is. It's Good Enough (TM). The hassles of more delays while we go through an arduous processes isn't worth any theoretical minor gains. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[4]: [Haskell-cafe] Logo Preferences
Hello Sebastian, Tuesday, March 10, 2009, 1:08:38 AM, you wrote: It just seems like duplicated work to me. They're still few enough that I can scan through them and multi-select the ones I like and then click move to top in a pretty short amount of time (and then refine the ranking if I care). and if none of them will be among 10 most popular - it is no difference for you which one will be finally selected? -- Best regards, Bulatmailto:bulat.zigans...@gmail.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[4]: [Haskell-cafe] Logo Preferences
On Mon, Mar 9, 2009 at 10:21 PM, Bulat Ziganshin bulat.zigans...@gmail.comwrote: Hello Sebastian, Tuesday, March 10, 2009, 1:08:38 AM, you wrote: It just seems like duplicated work to me. They're still few enough that I can scan through them and multi-select the ones I like and then click move to top in a pretty short amount of time (and then refine the ranking if I care). and if none of them will be among 10 most popular - it is no difference for you which one will be finally selected? Clearly not, because if I did have a preference among them I would've ranked them - if I didn't then I must not care either way. I suspect 99% will have a few favourites, and then they will have a few that they object to, and for the rest they just don't care which ones win. Expressing that with the proposed system is easy. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Re[4]: [Haskell-cafe] Logo Preferences
On Mon, Mar 9, 2009 at 10:38 PM, Sebastian Sylvan sebastian.syl...@gmail.com wrote: On Mon, Mar 9, 2009 at 10:21 PM, Bulat Ziganshin bulat.zigans...@gmail.com wrote: Hello Sebastian, Tuesday, March 10, 2009, 1:08:38 AM, you wrote: It just seems like duplicated work to me. They're still few enough that I can scan through them and multi-select the ones I like and then click move to top in a pretty short amount of time (and then refine the ranking if I care). and if none of them will be among 10 most popular - it is no difference for you which one will be finally selected? Clearly not, because if I did have a preference among them I would've ranked them - if I didn't then I must not care either way. I suspect 99% will have a few favourites, and then they will have a few that they object to, and for the rest they just don't care which ones win. Expressing that with the proposed system is easy. Also, let's be realistic. We can all look at the list and figure out which logos are likely to be popular - so just make sure you rank those. Adding even more time and hassle for the people who are already donating their time to arrange this for free isn't going to improve things significantly, I think. -- Sebastian Sylvan +44(0)7857-300802 UIN: 44640862 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Sugestion for a Haskell mascot
Hi, Here in Brazil we have a forest animal we name 'preguiça' -- literally, lazyness. What better mascot we could have for Haskell? It lives (and sleeps) in trees, and if you see the main picture in wikipedia articles you can easily imagine the tree branch beeing replaced by a lambda: http://en.wikipedia.org/wiki/Sloth http://pt.wikipedia.org/wiki/Bicho-pregui%C3%A7a Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Sugestion for a Haskell mascot
Hehe, I love it. Sloth is a synonym for Lazyness in English too, and they're so freaking cute... :) Maurício wrote: Hi, Here in Brazil we have a forest animal we name 'preguiça' -- literally, lazyness. What better mascot we could have for Haskell? It lives (and sleeps) in trees, and if you see the main picture in wikipedia articles you can easily imagine the tree branch beeing replaced by a lambda: http://en.wikipedia.org/wiki/Sloth http://pt.wikipedia.org/wiki/Bicho-pregui%C3%A7a Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe begin:vcard fn:Joseph Fredette n:Fredette;Joseph adr:Apartment #3;;6 Dean Street;Worcester;Massachusetts;01609;United States of America email;internet:jfred...@gmail.com tel;home:1-508-966-9889 tel;cell:1-508-254-9901 x-mozilla-html:FALSE url:lowlymath.net, humbuggery.net version:2.1 end:vcard ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Sugestion for a Haskell mascot
It's got my vote! 2009/3/10 Joe Fredette jfred...@gmail.com: Hehe, I love it. Sloth is a synonym for Lazyness in English too, and they're so freaking cute... :) Maurício wrote: Hi, Here in Brazil we have a forest animal we name 'preguiça' -- literally, lazyness. What better mascot we could have for Haskell? It lives (and sleeps) in trees, and if you see the main picture in wikipedia articles you can easily imagine the tree branch beeing replaced by a lambda: http://en.wikipedia.org/wiki/Sloth http://pt.wikipedia.org/wiki/Bicho-pregui%C3%A7a Best, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Distributing Linux binaries
On Mon, 2009-03-09 at 13:26 -0700, Don Stewart wrote: lists: Hi folks, I've got an application to release. I'm releasing the source, but I also wanted to release binary versions for people that don't have GHC. I developed on Windows, so making a Windows executable was simple. I also have access to an Ubuntu Linux box, on which I can easily build and test my app. But, I'm a bit confused about how to release binaries for Linux. It's not so simple as on Windows. Or, maybe it is but I don't know it. What do people recommend as a way of distributing Linux binaries? I tried to make a Debian package and couldn't figure it out, but maybe that's overkill. GHC itself has some kind of tarball for the binary distributions, one for Debian and one for Red Hat. How would I make such a package and what would go into it? There's only one executable, so it shouldn't be too complicated. You could make a .cabal package for it, and use that to construct a binary tar.gz bundle that's installable. Duncan, is there a cabal binary-dist? No. If we want it then someone needs to look at this ticket: http://hackage.haskell.org/trac/hackage/ticket/47 What you can do however is use cabal to make an install image (cabal copy --destdir=) and then write your own install script or make a deb or rpm or whatever. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Building/Prerequisites-Linux-glibc-devel libedit-devel ?
Greetings, am considering learning how to do a build for my slackware-based distro. The doc sited below say's it requires: glibc-devel libedit-devel ncurses-devel gmp-devel .etc. Must I used the dev versions, or will it work with the lastest, stable release versions of same? thanks much for the assistance http://hackage.haskell.org/trac/ghc/wiki/Building/Prerequisites http://hackage.haskell.org/trac/ghc/wiki/Building/Prerequisites -- View this message in context: http://www.nabble.com/Building-Prerequisites-%3ELinux-%3Eglibc-devel--libedit-devel---tp22376307p22376307.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] where does ghc specify ar options
On Sun, 2009-03-08 at 22:44 -0500, Alexy Khrabrov wrote: When bootstrapping cabal-install 0.6.2 on Mac OSX Leopard (Intel), I get a problem when linking: Linking dist/build/cabal/cabal ... ld: in /private/var/folders/mw/mwJSf7ErEa4w8nWyKyyqDTY/-Tmp-/zlib-0.5.0.0/dist/build/libHSzlib-0.5.0.0.a, archive has no table of contents This had happened with other ar'chives on my Mac before where it hadn't for some others. In all cases the fix was to make sure ranlib is run on the archive in question, or s is passed to ar during the creation. I have the latest XCode 312m gcc build 5490, and ghc 6.10.1 from MacPorts. In order to ensure ar cr becomes ar crs, I need to find out where in the ghc build process is it known how to create .a files? Where can an ar cr be changed to ar crs on a system-wide ghc build basis? We'll need some help from you to investigate this. Cabal does run ranlib on libraries after it installs them. See updateLibArchive in Distribution/Simple/GHC.hs in the Cabal source code. You'll see in the code it looks for ranlib and ar. If neither are available it issues a warning and installs anyway. Perhaps on OSX it should be an error rather than a warning. So we'll want to check that it's really being run when the zlib package is being built. You can run any cabal command with -v or -v3 to see what commands it runs. BTW, how did you get the package installed in that location? Did it involve copying into a temp dir and copying again? I believe that on OSX, copying a .a file breaks the ar index. This is because for reasons best known to themselves Apple decided that the index is only valid if its timestamp is the same as the last modification time of the file. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Sugestion for a Haskell mascot
Quoth Joe Fredette jfred...@gmail.com: | Hehe, I love it. Sloth is a synonym for Lazyness in English too, and | they're so freaking cute... :) ... and so freaking slow! :) Donn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I want to write a compiler
On Mon, Mar 09, 2009 at 09:25:58AM -0500, Austin Seipp wrote: Indeed, I stumbled upon it whilst looking at how unsafeCoerce worked (to find out it is super-duper-special and implemented as part of E.) I think it's actually pretty clever, and who knows, maybe it could be useful as at least a debugging aid. :) It is actually not all that special, it is just a primitive like any other than transates to a nop, or no code. Since the optimizer can't know what is inside a primitive in general, it leaves it alone and the only affect is the type coercion implicit in its signature. When translating to Grin, the unsafeCoerces are simply dropped. Coercions used to be more complicated because once upon a time I required them to be used to translate to/from newtype declared synonyms, I found they inhibited optimizations too much so switched to the current mechanism whereby newtype expansion happens transparently in the type checker when needed. As a side effect I worked hard to try to recognize and optimize around coercions, but now that they occur fairly rarely, it isn't much of an issue any more. This is a very good point I hadn't even thought about! Indeed, since GRIN represents thunks in a defunctionalized way - encoded as nodes - dealing with boxed/unboxed values becomes more of the compiler's job, since the nature of unboxed values etc. becomes more transparent. The main reason I think it is important is because I feel not including unboxed values from the get-go was one of the biggest false starts I had when writing jhc. When I initially started writing it I considered unboxed values as a feature to be added later. When I started implementing them, I found that there were a lot of decisions I would have made differently and a lot of places they would have greatly simplified my initial design had I had them from the start. Namely, A whole host of 'compiler magic' could have gone away if I implemented all primitive types in pure haskell like I implement floats and chars now, data Float = Float_ Float32_ data Char = Char Bits32_ (where Float32_ and Bits32_ are the unboxed raw types) Since instead I had the compiler implement Int and friends directly, it suddenly had the responisibity to conjure up all sorts of operations on them, such as the Num instances, creating the big mess of compiler magic in PrimitiveOperators.hs. The more I can express in the haskell source directly the better, it raises odd questions when the compiler has to do things like implement Num instances directly, like the instances are built in, but we might not have 'imported' the types needed to declare them into the current scope, so we end up having to deal with instancse for types that don't exist yet. In any case, yeah. if you plan on unboxed types at some point, include them from the start because they can simplify a lot to offset their cost of implementation, by trying to add them on later I ended up having to pay the cost of implementing them, but also had to deal with the cruft left over from not utilizing them from the beginning. Since you bring this up, I figure this decision also had some influence on E in lhc/jhc, considering its type system is rich enough to distinguish values in whnf/boxed/unboxed etc.? Yeah, there were a couple things that motivated this. A big one is that evals are bad in jhc, signifigantly moreso than traditional ghc. The points-to analysis is the main way to fight it, but I also decided I wanted to give it the best shot possible by getting rid of as many evals as I could in higher level optimizations, which necessitated a fairly rich type system since it actually made sense for jhc to keep strict track of what was in WHNF vs not even if they were both boxed. in general ghc didn't care unless a value was either CPRable or unboxable, but jhc can benefit from such knowledge no matter what the type, even if it is a partially applied function. Though, it is interesting that GHC may be moving to a jhc-style semi-tagging mechanism according to this paper[1] so more optimizations may help both equally in the future. The other main motivating factor was that I was always enamoured with the idea of jhc supporting more than one source language, in particular, I wanted to explore it having an SML front end, so wanted a core type system that was equally good at expressing lazy haskell as strict ML, and more importantly would be able to seamlessly intermingle the two without difficulty. So, when designing it, I kept that in mind, is this equally useful as a ML compilers core? or a wacky ML/Haskell hybrid?. Although the ML front end is more of a thought experiment at this point, I think it helped me come up with a coherent type system that had intruiging possibilies for haskell optimizations, as well as some language implications, such as the ability to declare new 'strict' algebraic types that may lead to new ideas for language extensions. John [1]
Re: [Haskell-cafe] Building/Prerequisites-Linux-glibc-devel libedit-devel ?
On Mon, Mar 9, 2009 at 7:14 PM, Windoze how2p...@gmail.com wrote: Greetings, am considering learning how to do a build for my slackware-based distro. The doc sited below say's it requires: glibc-devel libedit-devel ncurses-devel gmp-devel .etc. Must I used the dev versions, or will it work with the lastest, stable release versions of same? By dev version the instructions mean be sure to install the C header files. In Debian-like distros, such packages have the -dev suffix. Antoine ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Sugestion for a Haskell mascot
Maurício wrote: Here in Brazil we have a forest animal we name 'preguiça' -- literally, lazyness. What better mascot we could have for Haskell? It lives (and sleeps) in trees, and if you see the main picture in wikipedia articles you can easily imagine the tree branch beeing replaced by a lambda: http://en.wikipedia.org/wiki/Sloth http://pt.wikipedia.org/wiki/Bicho-pregui%C3%A7a The article says: Sloths therefore have very large, specialized, slow-acting stomachs with multiple compartments in which symbiotic bacteria break down the tough leaves. Clearly a reference to the evil mangler. Anton ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Mystified by Cabal
On Sun, Mar 08, 2009 at 01:13:33PM +0100, Svein Ove Aas wrote: On Sun, Mar 8, 2009 at 12:32 PM, Duncan Coutts duncan.cou...@worc.ox.ac.uk wrote: Note also that the list of licenses mkcabal offers is wrong. You can get the list from the Cabal lib itself so there is no need to maintain the list manually. It would also be nice to expand that list somewhat, to at least cover the most used licences - GPL2, GPL3, AGPL, etc. Why would cabal need a list at all inside of it? It seems very odd to have to upgrade cabal just because I am using a different license. it seems that we should just bite the bullet and switch data License to newtype License = License String and simplify a lot of code to boot as well as create a normalized data layout. John -- John Meacham - ⑆repetae.net⑆john⑈ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: ANN: Future 1.1.0 concurrency library
ChrisK wrote: Hello, As a side effect of the discussion of the new C++ future/promise features at http://lambda-the-ultimate.org/node/3221 I have implemented a Haskell package called future at http://hackage.haskell.org/cgi-bin/hackage-scripts/package/future This ought to do what C++ standard futures/promises do, plus a bit more. The main operation is forkPromise :: IO a - IO (Promise a) This sets the IO a operation running in a fresh thread. The eventual result can be accessed in many ways (non-blocking, blocking, blocking with timeout). let one :: Int; one = 1 p - forkPromise (return (one+one)) x - get y - wait x is an Int with value 2. y is an (Either SomeException Int) with value (Right 2). The useful thing about futures, as opposed to various IVar packages, is handling the case where the forked operation ends with an exception. The exception becomes the return value of the promise. The get operation rethrows it, the wait operation returns it as (Left ...). There is also an abort command to kill a promise. The dead promise may then have an exceptions as its value. The plus a bit more than C++ is the nonblocking addTodo feature. This takes a continuation function from the Either SomeException a to an IO operation. These continuation functions get queued and they are run immediately after the the forked operation completes. Once completed any new addTodo continuations run immediately. These continuations allow you to race a list of action and take the first one done, or to collect the answers as they complete into a Chan. Both of those options are demonstrated in Future.hs as racePromises and forkPromises. It should be safe to use unsafePerformIO . get or unsafePeformIO . wait to get lazy access to the result, which is itself immutable once set. Cheers, Chris I used something similar to this for a monadic opengl RPC mechanism. The need was for transparently creating OGL objects from any context. Returning thunks that block on the result when finally evaluated works out real nice in practice. Its easy to manage, and performs better than dealing with several OS threads and GL contexts. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] where does ghc specify ar options
BTW, how did you get the package installed in that location? Did it involve copying into a temp dir and copying again? I believe that on OSX, copying a .a file breaks the ar index. This is because for reasons best known to themselves Apple decided that the index is only valid if its timestamp is the same as the last modification time of the file. OK -- what I did was rather drastic -- I got ar as a part of cctools off Apple's Open Source and verified that it didn't run ranlib on my Leopard 10.5. However it turns out it's supposed to do so -- folks from MacPorts even got a flag -S to make it *not* tun ranlib... Yet they're on PPC, and I'm on Intel (MBP). So what I ended up doing is patching Apple's ar as described in that MacPorts thread: Why ar doesn't call ranlib on Mac? And after that, cabal-install did bootstrap.sh like a charm. I know some folks say that they don't need to run ranlib on their Macs, and some do, and I could have wrapped it in sh-wrappers and investigate it forever, but this issue has re-ar-ed its head often enough that I'm happy with just fetching the li'l slimy ar out of its source soup and fixing it in the bud. Cheers, Alexy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bytestring vs. uvector
On Mon, Mar 9, 2009 at 3:12 AM, Henning Thielemann lemm...@henning-thielemann.de wrote: On Mon, 9 Mar 2009, Claus Reinke wrote: Given the close relationship between uvector and vector, it would be very helpful if both package descriptions on hackage could point to a common haskell wiki page, starting out with the text and link above, plus a link to the stream fusion paper (I hadn't been aware that vector incorporates the recycling work, and had often wondered about the precise relationship between those two packages). Apart from saving others from similar confusion, that would also provide a place to record experience with those two alternatives. I have at least started a page which mentions the existing alternatives: http://www.haskell.org/haskellwiki/Storable_Vector ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe Thanks for all of the responses! So let me see if my summary is accurate here: - ByteString is for just that: strings of bytes, generally read off of a disk. The Char8 version just interprets the Word8s as Chars but doesn't do anything special with that. - Data.Text/text library is a higher-level library that deals with text, abstracting over Unicode details and treating each element as a potentially-multibye character. - utf8-string is a wrapper over ByteString that interprets the bytes in the bytestring as potentially-multibye unicode characters. - uvector, storablevector and vector are all designed for dealing with arrays. They *can* be used for characters/word8s but are not specialized for that purpose, do not deal with Unicode at all, and are probably worse at it. They are better for dealing with things that you would generally use arrays for. If that seems accurate, I'll put it on the wiki. Alex ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bytestring vs. uvector
Alexander Dunlap alexander.dun...@gmail.com writes: - uvector, storablevector and vector are all designed for dealing with arrays. They *can* be used for characters/word8s but are not specialized for that purpose, do not deal with Unicode at all, and are probably worse at it. They are better for dealing with things that you would generally use arrays for. I think uvector only works with certain types that can be unboxed, while storablevector works with all types that instantiate Foreign.Storable.Storable. I don't know about vector. From the description of vector, I have the impression that it is quite unstable. How is it compared to uvector and storablevector? I need one of those to work with my code to possibly improve the efficiency. But I can't use uvector, because I can't use unboxed types. Should I use storablevector? Or vector? Thanks, Xiao-Yong -- c/*__o/* \ * (__ */\ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Building/Prerequisites-Linux-glibc-devel libedit-devel ?
On 2009 Mar 9, at 20:14, Windoze wrote: glibc-devel libedit-devel ncurses-devel gmp-devel .etc. Must I used the dev versions, or will it work with the lastest, stable release versions of same? Linux distributions use foo-devel or foo-dev for the files necessary for development, i.e. header files and link-time shared libraries (libfoo.so, vs. libfoo.so.N which is the runtime shared object; you can have multiple runtime versions installed for backward compatibility). (This doesn't apply to NetBSD or FreeBSD, which always installs both runtime and developer components; foo-devel there does indeed mean the latest developer code.) -- brandon s. allbery [solaris,freebsd,perl,pugs,haskell] allb...@kf8nh.com system administrator [openafs,heimdal,too many hats] allb...@ece.cmu.edu electrical and computer engineering, carnegie mellon universityKF8NH PGP.sig Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Logo Preferences
On Mon, 9 Mar 2009 11:50:51 +, Ian Lynagh ig...@earth.li wrote: On Mon, Mar 09, 2009 at 11:13:40AM +, Sebastian Sylvan wrote: Another reason condorcet voting is nice is that there is no need to group similar items together. I think the plan is that once a logo class is chosen, we'll have another vote for the actual colour scheme etc to be used, if applicable. Yes, we could have done this in a single vote, but then people would need to spend time creating 30 variants of each logo, and we'd be ranking 3000, rather than 100, options. The only difficulty with creating classes of logos in this way is that there seem to be some users who prefer only a specific member of a class, and who do not like other members of the same class. For example, there seem to be some users who like the second logo in group 61, but who would prefer something else to the most of the other logos in that group, so they would want to minimize the possibility of anything but the second logo from being chosen within that group. Perhaps classes should be created for viewing, but not for voting for, the logos, so that at the election, each variant can be uniquely identified. -- Benjamin L. Russell -- Benjamin L. Russell / DekuDekuplex at Yahoo dot com http://dekudekuplex.wordpress.com/ Translator/Interpreter / Mobile: +011 81 80-3603-6725 Furuike ya, kawazu tobikomu mizu no oto. -- Matsuo Basho^ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe