Re: [Haskell-cafe] Introducing Instances in GHC point releases
Duncan Coutts duncan.cou...@worc.ox.ac.uk writes: The PVP says: 1. If any entity was removed, or the types of any entities or the definitions of datatypes or classes were changed, or instances were added or removed, then the new A.B must be greater than the previous A.B. ..and this should be machine-checkable, no? Adding support for this to Hackage, so that conforming/non-conforming libraries could be highlighted might make a good Hac or (part of a) GSoC project. -k -- If I haven't seen further, it is by standing in the footprints of giants ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Introducing Instances in GHC point releases
On Sun, 2009-05-24 at 16:36 +0200, Ketil Malde wrote: Duncan Coutts duncan.cou...@worc.ox.ac.uk writes: The PVP says: 1. If any entity was removed, or the types of any entities or the definitions of datatypes or classes were changed, or instances were added or removed, then the new A.B must be greater than the previous A.B. ..and this should be machine-checkable, no? Adding support for this to Hackage, so that conforming/non-conforming libraries could be highlighted might make a good Hac or (part of a) GSoC project. Yes exactly. We proposed it for this summer's GSoC but it didn't quite make the final cut. http://hackage.haskell.org/trac/summer-of-code/ticket/1565 Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Design in Haskell?
Hi, When I was learning to program in imperative languages like Java, there were plenty of resources to learn from about how to design large programs. Ideas like the GoF Design Patterns gave useful models that one could then scale up. Are there such resources for Haskell? As I'm learning the language, I'm finding it quite nice to write short programs (e.g. projecteuler, Haskell Road, etc.) But when I try to write something a bit larger, I find I'm tripping over myself and having a hard time organizing the code coherently. Are there any suggestions of wikis, books or particularly well-architected and readable projects I could look at to about learn larger-scale design in Haskell? Cheers, - Dan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Design in Haskell?
On Mon, May 25, 2009 at 4:22 PM, Dan danielkc...@gmail.com wrote: Are there any suggestions of wikis, books or particularly well-architected and readable projects I could look at to about learn larger-scale design in Haskell? XMonad is pretty good, see http://xmonad.org/ For its design and implementation, you may want to see http://www.cse.unsw.edu.au/~dons/talks/xmonad-hw07.pdf lee ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The Computer Language Benchmarks Game: pidigits
: By the way, I did submit my solution. It improved the score a bit but it is still very memory hungry. a bit? Currentlly it is the fastest in 32 bit . the memory/speed problems happens in 64 bit benchmarks. I suppose that the speed is related with the memory leak that will be fixed, Dons said. Event there doubled the performance of the previous entry. Just to learn; how this last version is faster than the previous entry? This new version does not use strictness annotations. Is this an example where laziness pays (and indeed causes the memory leak in the 64 bit architectures? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] FGL Question
[snip] Hi Hans, I believe the problem is to do with the inductive nature of the FGL library. A graph in FGL is a series of contexts, each corresponding to a node. Each context contains lists of links to/from the latest node to nodes in previous contexts. Each link is only recorded once, and whether it appears in the context for the source or destination node depends on the order that the graph is constructed. Ah, that was my mistake! I thought a context was an 'in' adjacency list, a node, a label and and 'out' adjacency list, and this for each node. So each link would be recorded twice! Based on this assumption I tried to, and thought I did, construct a new unconnected graph. [snip] Based on the idea that gsel didn't work as I expected, I already found a workaround, but your example solutions look better. I'll look at my code again. Many thanks for your helpful reply! Best Regards, Hans van Thiel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Haskell Hackathon in Philadelphia
There will soon (in the next couple of days) be a wiki page where people can write down the projects they might like to work on. This was just sort of a pre-announcement to gauge interest and so on; sometime tomorrow or Wednesday we plan to send out an official announcement with lots more info. -Brent On Sun, May 24, 2009 at 01:35:40PM -0400, Andrew Wagner wrote: Is there a list of projects that will be worked on during this, or how will that work? On Thu, May 21, 2009 at 5:39 PM, Brent Yorgey byor...@seas.upenn.eduwrote: Hi all! We are in the early stages of planning a Haskell hackathon/get together, Hac φ, to be held this summer at the University of Pennsylvania, in Philadelphia. Right now we're looking at two possible dates: June 19-21or July 24-26 If you might be interested in attending, please add your name on the wiki page: http://www.haskell.org/haskellwiki/Hac_%CF%86 You can also note whether either of those dates absolutely doesn't work for you. (If you don't have an account on the wiki, you can email Ashley Yakeley for an account [1], or feel free to just respond to this email.) Expect more details (such as a nailed-down date) soon, once we have gauged the level of interest. Hope to see you in Philadelphia! Brent (byorgey) Daniel Wagner (dmwit) [1] http://haskell.org/haskellwiki/HaskellWiki:New_accounts ___ 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] Haskell type system and the lambda cube
On Sun, May 24, 2009 at 10:39:50AM +0200, Petr Pudlak wrote: On Sun, May 24, 2009 at 12:18:40PM +0400, Eugene Kirpichov wrote: Haskell has terms depending on types (polymorphic terms) and types depending on types (type families?), but no dependent types. But how about undecidability? I'd say that lambda2 or lambda-omega have undecidable type checking, I don't think that's true. Unless I am mistaken, type checking is decidable for all the vertices of the lambda cube. (BWT, will some future version of Haskell consider including some kind of dependent types?) I doubt it. But there is a lot of current research into bringing as much of the power of dependent types into the language (e.g. type families) without actually bringing in all the headaches of full-spectrum dependent types. -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] How to implement this? A case for scoped record labels?
Hi, I would like to get some advice on how to best implement a protocol. The protocol in question is Bayeux: http://svn.cometd.org/trunk/bayeux/bayeux.html. The details don't matter here - it defines a couple of requests and responses in JSON format, basically JSON objects with different properties, some of which are shared by all (e.g. channel) and some which are specific for certain kinds of requests/responses (e.g. subscription). To give an example, a connect request would look like this: [ { channel: /meta/connect, clientId: Un1q31d3nt1f13r, connectionType: long-polling } ] Now I leave the actual JSON parsing to the excellent Text.JSON library. My problem is how to get the types right. At first I started with a big discriminated union, e.g. data BayeuxMessage = HandshakeRequest { channel :: String , ... } | HandshakeResponse { channel :: String, successful :: Bool, ... } | ... This way I could create BayeuxMessage values by copying the Text.JSON parsed values over. However what I don't like is that many selector functions, e.g. successful, are only partial and using them with a BayeuxMessage value constructed with HandshakeRequest for example will result in a runtime error. So I think it would be better to have individual types for the protocol requests/responses, e.g. data HandshakeRequest = HandshakeRequest { channel :: String , ... } data HandshakeResponse = HandshakeResponse { channel :: String, successful :: Bool, ... } ... data BayeuxMessage = HSReq HandshakeRequest | HSRes HandshakeResponse ... This however does not work because record selectors have module scope, so the compiler will complain that channel et. al. are defined multiple times. As a workaround I could put each type into its own module, but at least GHC requires a file per module (which is *very* inconvenient IMO). If we would have scoped labels (e.g. like proposed here: http://legacy.cs.uu.nl/daan/pubs.html#scopedlabels) it seems like it would have been straightforward. So certainly I am missing something and there is a better way to design this. Hence this e-mail. I welcome any advice how this would best be done in Haskell with GHC. Many thanks, nt ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell type system and the lambda cube
Type checking is decidable for all of the lambda cube, but not type inference. Haskell 98 is a subset of Fw, Haskell with extensions is an superset of Fw. -- Lennart On Mon, May 25, 2009 at 12:59 PM, Brent Yorgey byor...@seas.upenn.edu wrote: On Sun, May 24, 2009 at 10:39:50AM +0200, Petr Pudlak wrote: On Sun, May 24, 2009 at 12:18:40PM +0400, Eugene Kirpichov wrote: Haskell has terms depending on types (polymorphic terms) and types depending on types (type families?), but no dependent types. But how about undecidability? I'd say that lambda2 or lambda-omega have undecidable type checking, I don't think that's true. Unless I am mistaken, type checking is decidable for all the vertices of the lambda cube. (BWT, will some future version of Haskell consider including some kind of dependent types?) I doubt it. But there is a lot of current research into bringing as much of the power of dependent types into the language (e.g. type families) without actually bringing in all the headaches of full-spectrum dependent types. -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A problem with par and modules boundaries...
$diff main.simpl imported.simpl ... 223c232 a_s1rs [ALWAYS Just L] :: GHC.Integer.Internals.Integer --- a_s1sV [ALWAYS Just S] :: GHC.Integer.Internals.Integer ... Good find! Does this S vs. L difference have anything to do with strictness and laziness? Yes. So, I think we should open a ghc but report with all the details, particularly the example's source, the ghc version and that highlight of that strictness difference. Duncan I have logged the ticket at http://hackage.haskell.org/trac/ghc/ticket/3259 -- Mario Blazevic mblaze...@stilo.com Stilo Corporation This message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure, copying, or distribution is strictly prohibited. If you are not the intended recipient(s) please contact the sender by reply email and destroy all copies of the original message and any attachments. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Parsing command lines
Hello all, is there a function that can safely split a command line into a FilePath to the executable and its parameters? I couldn't manage to find one. If not, what are the pitfalls in creating a cross-platform solution to this problem? Can I assume that the first space not within double quotes and not preceded by an unescaped backslash marks the end of the executable path, or is that too naive (or completely wrong)? Gergely -- http://www.fastmail.fm - A fast, anti-spam email service. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Parsing command lines
On Monday 25 of May 2009 18:57:28 Patai Gergely wrote: Hello all, is there a function that can safely split a command line into a FilePath to the executable and its parameters? I couldn't manage to find one. If not, what are the pitfalls in creating a cross-platform solution to this problem? Can I assume that the first space not within double quotes and not preceded by an unescaped backslash marks the end of the executable path, or is that too naive (or completely wrong)? Gergely There getArgs and getProgName in System module. If you want parse this parameters there is System.Console.GetOpt. All the splitting, escaping and quotes interpretaion is done by shell. All what get program when starts is list of strings. Program name is actually arbitrary string. (At least on unices, it may work a bit differently on windows). -- Khudyakov Alexey ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Parsing command lines
There getArgs and getProgName in System module. If you want parse this parameters there is System.Console.GetOpt. Those will only tell me how my program was called. I want to work with command lines as data within my program, which is a completely different thing. All the splitting, escaping and quotes interpretaion is done by shell. All what get program when starts is list of strings. Program name is actually arbitrary string. (At least on unices, it may work a bit differently on windows). That's fine, but I'll see the commands yet to be passed to the shell as strings, and I'd like to know where to split them. Gergely -- http://www.fastmail.fm - The professional email service ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Anglohaskell?
Is anyone up for Anglohaskell this year? Perhaps more importantly, is anyone willing to step forward to run it? I can lend a hand, having organised and to some extent meta-organised in previous years, but I'm not sure I have spare time to do the same kind of job as I did in 2007. For those who're new or don't remember, http://www.haskell.org/haskellwiki/AngloHaskell contains links to info from previous years - the idea's a get-together with lots of talks from hobbyist to academic, and plenty of chat. -- Philippa Cowderoy fli...@flippac.org ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Parsing command lines
On Mon, 2009-05-25 at 17:45 +0200, Patai Gergely wrote: There getArgs and getProgName in System module. If you want parse this parameters there is System.Console.GetOpt. Those will only tell me how my program was called. I want to work with command lines as data within my program, which is a completely different thing. All the splitting, escaping and quotes interpretaion is done by shell. All what get program when starts is list of strings. Program name is actually arbitrary string. (At least on unices, it may work a bit differently on windows). That's fine, but I'll see the commands yet to be passed to the shell as strings, and I'd like to know where to split them. Trying to accurately emulate how the shell expands a command line string into program argument strings is not easy. I don't know of any existing Haskell library to do this but POSIX specifies a C function wordexp() which does shell command line expansion. This might be more than you want however as it also expands *.hs wildcards, arithmetic, quote removal, ~user paths, $env vars and (optionally) $(command) substitution. Duncan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] [ANN] multirec-binary
Hello all, MultiRec[1,2] is a great library for generic programming for families of possibly mutual recursive data types. Creating new generic functions might take some effort but the use of these functions is very straightforward. The multirec-binary[3] packages allows generic derivation of Data.Binary instances using the MultiRec library. Just try something like this: import Data.Binary import Generics.MultiRec.Base import Generics.MultiRec.Binary instance Binary MyType where put = gput MyFamily get = gget MyFamily Have fun, -- Sebastiaan Visser [1] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/multirec-0.3 [2] http://www.cs.uu.nl/research/techreps/repo/CS-2008/2008-019.pdf [3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/multirec-binary ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] The Computer Language Benchmarks Game: pidigits
That is amazing! It's the fastest 32-bit entry, good job. On Sat, May 23, 2009 at 5:33 PM, Arnaud Payement arnaud.payem...@gmail.com wrote: By the way, I did submit my solution. It improved the score a bit but it is still very memory hungry. - Original Message - From: Don Stewart d...@galois.com To: Matthias Görgens matthias.goerg...@googlemail.com Cc: Arnaud Payement arnaud.payem...@gmail.com; haskell-cafe@haskell.org Sent: Saturday, May 23, 2009 10:16 PM Subject: Re: [Haskell-cafe] The Computer Language Benchmarks Game: pidigits matthias.goergens: Hi, By the way: Would it be considered good style to include QuickTest properties into the pidigit submission? Not in the submission, no. ___ 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] The Computer Language Benchmarks Game: pidigits
It is quite hard for me to tell why this entry is faster than the one one as I used the C entry as a starting point which I then refactored multiple times to ensure that the solution is closer to what one who right in Haskell. The only big difference I can see between the two is the different usage of list comprehension. The preceding entry was building a list which is then refined using the str method to end up being the list of digits. On the other hand my version use list continuation to recursively build a list of (digit, state) and then you simply have to print (map fst (tail digits)). I did not use the strictness annotations because they did not improve the performance when I tried to add them and I thought it is better to show Haskell as one would naturally write it. - Original Message - From: Alberto G. Corona To: Arnaud Payement ; haskell-cafe@haskell.org Sent: Monday, May 25, 2009 10:54 AM Subject: Re: [Haskell-cafe] The Computer Language Benchmarks Game: pidigits : By the way, I did submit my solution. It improved the score a bit but it is still very memory hungry. a bit? Currentlly it is the fastest in 32 bit . the memory/speed problems happens in 64 bit benchmarks. I suppose that the speed is related with the memory leak that will be fixed, Dons said. Event there doubled the performance of the previous entry. Just to learn; how this last version is faster than the previous entry? This new version does not use strictness annotations. Is this an example where laziness pays (and indeed causes the memory leak in the 64 bit architectures? ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell programmers in São Carlo s - SP - Brazil?
heh, a Lisp-br community of about 100 people generates about some 1 message a month. I won't even try to guess 5 Haskellers from Sao Paulo. :P 2009/5/23 Daniel Yokomizo daniel.yokom...@gmail.com: Hey, we have enough people for a São Paulo Haskell User Group. Anyone else interested? Best regards, Daniel Yokomizo 2009/5/21 Fernando Henrique Sanches fernandohsanc...@gmail.com: São Caetano, SP, Brazil - right next to São Paulo. UFABC Student. Fernando Henrique Sanches 2009/5/19 Maurício briqueabra...@yahoo.com Anybody else around here? 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 ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Any interest in forming a Haskell Meetup group in Edinburgh, Scotland
Anyone interested in just getting together, from complete beginner, to those with experience, to share ideas and help each other other out. The Filmhouse on Lothian Road, is quite handy for Edinburgh folk, and for anyone was coming through from Glasgow, and alighting(using train speak) at Haymarket. Its got plenty space, serves reasonable food, as well as having lots of good food places nearby. I'll suggest meeting on a Saturday to try and avoid conflict with the many other things people do in the evenings. Its also off-peak return from Glasgow all day. I'm a Haskell beginner, so I'm no good for answering more difficult questions, need someone else for that. -- Andrew ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell furniture?
Here is some furniture that ought to appeal to the Haskell afficionado: http://karl-andersson.se/view_product.asp?rangeId=39catId=2picture=2 Steve Schafer Fenestra Technologies Corp. http://www.fenestra.com/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: New repository and trac for haskell-src-exts
Hi all, In preparation for my GSoC project, I've set up some new infrastructure for the haskell-src-exts package. Instead of residing with the HSP packages, it's now old enough to be allowed to live on its own. The new repository is darcs get http://code.haskell.org/haskell-src-exts I've also finally set up a bug tracker for all things big and small, found at http://trac.haskell.org/haskell-src-exts I've added all issues from my old TODO list, but I'm sure there's more stuff that I've missed. Please help me by reporting anything you come across, or by requesting new and cool features. Cheers, /Niklas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: the problem of design by negation
Conal Elliott co...@conal.net wrote: I gather that some people are terribly uncomfortable without certainty. If you take away their certainty, they demand an immediate replacement! This is a very important observation, vast areas of human psychology can be explained in terms of feeling certain or not[1]: It's the most powerful and most basic influence of behaviour there is. As my observation goes, people are uniformly drilled to perform, which, due to its methods, induces a social taboo on failure, which, in turn, explains why uncertainty can, so often, act unconsciously. People can't fix what they can't see, so SNAFU: Passing on the short straw of not-knowing is the only way to safe face / feel safe. You have to make sure not to trigger fear of mockery, segregation and failing class (i.e. getting fired) while handing out F's, that is... which is why the Socratic method is so darn effective when it comes to dealing with people. [1] Freud, Jung, Leary, amongst others, take your pick. -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: the problem of design by negation
Michael Mossey m...@alumni.caltech.edu wrote: Based on a previous reply, I think some people think this sounds like vapid cheerleading, but I think you would agree with me that life (and software) always offers more possibilities when we engage our imagination with hope and energy, not giving up too soon, being willing to sit with problems for a time without a definite conclusion. With the burden that this behaviour and state of mind is a result of a foundational state of mind: Merely practising the symptoms is even less effective than being a grouch. So, yes, I _do_ think that it sounds like vapid cheerleading ;) -- (c) this sig last receiving data processing entity. Inspect headers for copyright history. All rights reserved. Copying, hiring, renting, performance and/or quoting of this signature prohibited. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell furniture?
On Tue, May 26, 2009 at 12:40 AM, Steve Schafer st...@fenestra.com wrote: Here is some furniture that ought to appeal to the Haskell afficionado: http://karl-andersson.se/view_product.asp?rangeId=39catId=2picture=2 Steve Schafer Fenestra Technologies Corp. http://www.fenestra.com/ I suspect this (http://www.berkeleymills.com/Search/Default.aspx?s=lambda) is more appropriate - form AND name suitable for Haskellers :-) 'Inspired by the most beautiful letter in the Greek alphabet' Stuart Dootson ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] the problem of design by negation
G'day all. Quoting Conal Elliott co...@conal.net: The main objection I have to the negative process (can't be done) is that is so often bogus. Proof by lack of imagination. I guess it works for Richard, though not for Michael's architect, because Richard is able to catch his bogus reasoning *and he is willing*** to do so, which requires humility and ego-strength. Conal is definitely on to something here. I've noticed that the best designers have this weird personality quirk that allows them to put all of their effort into pushing an idea, and then instantly back down and revise the moment that it's been shown that the idea won't work. Cheers, Andrew Bromage ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Haskell type system and the lambda cube
vo...@tcs.inf.tu-dresden.de wrote: 2009/5/24 Petr Pudlak d...@pudlak.name: If all Haskell had would be HM, it would be System F. That cannot be quite right, can it? System F has more powerful polymorphism than HM. As I recall HM is along the edge to \lambda^2. Haskell 98 is typically described in terms of System F_\omega. I've heard people say GADTs are a subset of (or equivalent to?) System F_c, though I'm not familiar with F_c myself. Like most interesting languages, Haskell as a whole doesn't belong on one of the vertices. I've yet to see a nice diagram that presents non-vertex languages like HM and what arcs can cause one to (often unexpectedly) degenerate into another. -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] How to implement this? A case for scoped record labels?
ntu...@googlemail.com wrote: This however does not work because record selectors have module scope, so the compiler will complain that channel et. al. are defined multiple times. As a workaround I could put each type into its own module, but at least GHC requires a file per module (which is *very* inconvenient IMO). If we would have scoped labels (e.g. like proposed here: http://legacy.cs.uu.nl/daan/pubs.html#scopedlabels) it seems like it would have been straightforward. So certainly I am missing something and there is a better way to design this. Hence this e-mail. I welcome any advice how this would best be done in Haskell with GHC. One alternative is to use Haskell's support for ad-hoc overloading. Define a typeclass for each selector (or group of selectors that must always occur together) which is polymorphic in the record type. Combine this with the separate constructor types to get something like: data HandshakeRequest = HandshakeRequest String ... data HandshakeResponse = HandshakeResponse String Bool ... ... data BayeuxMessage = HSReq HandshakeRequest | HSRes HandshakeResponse ... class BayeuxChannel r where channel :: r - String instance BayeuxChannel HandshakeRequest where channel (HandshakeRequest ch ...) = ch instance BayeuxChannel HandshakeResponse where channel (HandshakeResponse ch _ ...) = ch ... class BayeuxSuccessful r where successful :: r - Bool ... It's not pretty, but it gets the job done. Many people decry this as improper use of typeclasses though (and rightly so). A better approach would probably be to use GADTs or the new data families which give a sort of dual of typeclasses (typeclasses give a small set of functions for a large set of types; GADTs give a large set of functions for a small set of types[0]). Someone more familiar with those approaches should give those versions. If you want to be able to set the fields as well as read them then the classes should be more like lenses than projectors. For instance, this[1] discussion on Reddit. The two obvious options are a pair of setter and getter functions: (Whole-Part, Whole-Part-Whole); or a factored version of the same: Whole-(Part, Part-Whole). You should also take a look at the data-accessor packages[2][3] which aim to give a general solution to the lens problem. Also take a look at hptotoc[4], the Haskell implementation of Google's Protocol Buffers which has many similar problems to your Bayeaux protocol. In general, protocols designed for OO are difficult to translate into non-OO languages. [0] http://blog.codersbase.com/tag/gadt/ [1] http://www.reddit.com/r/haskell/comments/86oc3/yet_another_proposal_for_haskell_the_ever_growing/c08f4bp [2] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-accessor [3] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/data-accessor-template [4] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hprotoc -- Live well, ~wren ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] the problem of design by negation
On 26 May 2009, at 12:54 pm, a...@spamcop.net wrote: Conal is definitely on to something here. I've noticed that the best designers have this weird personality quirk that allows them to put all of their effort into pushing an idea, and then instantly back down and revise the moment that it's been shown that the idea won't work. I have one of Brian Marick's (www.exampler.com) stickers on my door. It reads to be less wrong than yesterday Two quotes I often give my students: Brethren, I beseech you in the bowels of Christ, consider it _possible_ that you _may_ be wrong. Oliver Cromwell Fear most of all to _remain_ in error. Me, deliberately misquoting Kierkegaard, quoting Socrates. I changed 'be' to 'remain'. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Bidirectional programming in Haskell
Hello, Are there any libraries for bidirectional [1] programming in Haskell? Any related work? All I've found is a paper There and back again: arrows for invertible programming, which I couldn't find the full text of. Cheers, Artyom Shalkhakov. [1] something along the lines of Boomerang www.seas.upenn.edu/~harmony/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: Parsing command lines
which does shell command line expansion. This might be more than you want however as it also expands *.hs wildcards, arithmetic, quote removal, ~user paths, $env vars and (optionally) $(command) substitution. I don't think I'll have to deal with very complicated cases, just more or less static commands, maybe with ~ in the path. I guess I'll just go with a naive solution first, and expand it when needed. Gergely -- http://www.fastmail.fm - Access all of your messages and folders wherever you are ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe