[Haskell-cafe] getting exported original names using the GHC API
Say that I have a module like: module Test(L.find) where import Data.List as L Using the GHC API, I extract the module exports (using GHC.modInfoExports) and I get a list of names. Now, I want to get the name of the export with the namespace stated in the source (L.find) but I seem to be able to get it only as Data.List.find. I have tried different variations of functions on Name or OccName but nothing seems to work. Obviously, I could just parse the module and get the info that way, but I wondered if it could be done via the API. Thanks, titto -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: Haskell in the Cloud (http://quid2.org)
Hello Sean, thanks for taking the time to road test quid2.org. And believe me, I totally feel your pain :-) I have just started using it in earnest myself (following the great eat you own dog food principle) and I know how frustrating the whole experience is. However, I am working on it daily and things will improve. Now to come to the points raised in your post: 1) Don't try to use the browser's back button No support for history yet, but is on the todo list. 2) understand the errors They should know look a bit better but there is still a lot of work to do. 3) * Save (with Cmd-S on Mac or Ctrl-S on other systems) before clicking View. * Wait for the done part at the end of the Saving new source message. Sometimes, it doesn't save. Saving is now automatic and you can switch between Edit and View mode without losing your data. You should also see less saving errors. 4) * Don't assume that your saved module is the one being compiled/interpreted. You may want to do a browser refresh to be sure. In one attempt, I produced the following: abcd = abc (where = maps the term on the left to the value on the right) after adding the 'd' to the string and saving the file. There are still inconsistencies when a module is modified, it is next on my todo list. 5) For some reason, the explicit String type is needed for this (minimal) example: concat [a,b,c,d] :: String This is because the OverloadString extension is always active. In the Subject.Quid2.Language module there is now a guide to the differences between standard Haskell and Quid2's own flavour. Keep the feedback coming ! Best, titto On 22 July 2011 16:22, Sean Leather leat...@cs.uu.nl wrote: On Fri, Jul 22, 2011 at 12:00, Pasqualino Titto Assini wrote: Enter Quid2 [1]: the half baked, barely tested, totally unsafe and spectacularly unoptimised Haskell in the Cloud system. Challenging... https://plus.google.com/104222093009939197511/posts/MpgUUayq78o Sean -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: Haskell in the Cloud (http://quid2.org)
Hi David, no there is no direct relationship to distributed haskell. Quid2's focus is not so much on extending Haskell itself and its runtime to work in a distributed fashion but rather to provide a global naming system for functional values. Very similar to the Web, whose main innovation is to provides a global naming system for all kind of resources that previously had only local names (/dir/myfile versus http://ww.myserver.com/myfile). A description of Quid2 architecture will soon be available and it will be clearer how is meant to work. It will be far from complete, a working functional web will only emerge if many different ideas converge in a coherent whole. Best, titto On 22 July 2011 15:57, David Barbour dmbarb...@gmail.com wrote: Any relationship to distributed haskell? http://www.macs.hw.ac.uk/~dsg/gdh/ On Fri, Jul 22, 2011 at 3:00 AM, Pasqualino Titto Assini tittoass...@gmail.com wrote: Fellow Haskeller, Has your strongly typed, quick checked, formally verified, Oleg blessed, higher order monadic code become a little bit too predictable? Are you feeling a bit bored, emotionally drained and disillusioned with perfection? Longing for the days when Men were Men (and Women were Women for that matter) and squashed bugs out of Assembler code with just their bare hands and a line editor? Enter Quid2 [1]: the half baked, barely tested, totally unsafe and spectacularly unoptimised Haskell in the Cloud system. A delightful blend of Haskell crispiness and JavaScript fluffiness, Quid2 guarantees hours and hours of guilt free hacking enjoyment. Let a soft lamb(a)da rhythm [2] take you over as you gingerly step onto the Haskell Cloud, it's time to party as if it were 1991 all over again! Yours truly, titto [1] http://quid2.org [2] http://www.youtube.com/watch?v=i8mz9uOvFQA -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Dr. Pasqualino Titto Assini http://quid2.org/ -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANNOUNCE: Haskell in the Cloud (http://quid2.org)
Fellow Haskeller, Has your strongly typed, quick checked, formally verified, Oleg blessed, higher order monadic code become a little bit too predictable? Are you feeling a bit bored, emotionally drained and disillusioned with perfection? Longing for the days when Men were Men (and Women were Women for that matter) and squashed bugs out of Assembler code with just their bare hands and a line editor? Enter Quid2 http://quid2.org [1]: the half baked, barely tested, totally unsafe and spectacularly unoptimised Haskell in the Cloud system. A delightful blend of Haskell crispiness and JavaScript fluffiness, Quid2 guarantees hours and hours of guilt free hacking enjoyment. Let a soft lamb(a)da rhythm http://www.youtube.com/watch?v=i8mz9uOvFQA [2] take you over as you gingerly step onto the Haskell Cloud, it's time to party as if it were 1991 all over again! Yours truly, titto [1] http://quid2.org [2] http://www.youtube.com/watch?v=i8mz9uOvFQA -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Anyone recommend a VPS?
Thanks for the info, it sounds reassuring. One question: is machine performance stable? Do you ever see your virtual machines slowing significantly? My experience in running virtual machines locally is that it is easy to use too much memory and end up with the machine badly swapping for a while. Have you ever seen this happening on EC2? Thanks, titto On 19 March 2011 12:52, Neil Davies semanticphilosop...@gmail.com wrote: Hi We run a the whole of our distributed file system (AFS) on a single AWS micro instance with linux containers inside. We then use other instances for various things as/when needed (using kerberos to distributed the management and control to the appropriate people). For example we have a EC2 machine that we power up and down as needed (still have to pay for the filestore when not being used - but that is very small) for GHC - used it this morning to upgrade our shared (via AFS) development environment to 7.0.2. All our other systems read of that (we are completely distributed operation). They've been great - had a physical processor go bad once - and also they had a h/w problem on one the machines once, that is in last 2 years or so about 6 operational system years. Neil On 19 Mar 2011, at 11:36, Pasqualino Titto Assini wrote: If you need to run your server continuously you might be better off with a cheap dedicated server. To run my quid2.org site, a rather complex setup with a web server and a number of background haskell processes, I use a server from the French provider OVH/Kimsufi (http://www.kimsufi.co.uk/ and http://www.ovh.co.uk/products/dedicated_offers.xml ,main site is ovh.com). You can get a decent box for 15 euro a month and a hell of a machine for 50/60 euros. They also have some Cloud/VPS options, that I have not used. Does anyone have first-hand experience with Amazon EC2? They also look very tempting. Best, titto On 19 March 2011 10:12, Lyndon Maydwell maydw...@gmail.com wrote: Does anyone have any Binaries that are built to run on EC2? That would be super! On Tue, Feb 2, 2010 at 1:11 AM, Jason Dusek jason.du...@gmail.com wrote: 2010/01/31 Marc Weber marco-owe...@gmx.de: If all you want is standard debian or such it does'nt matter. However I tried installing NixOS Linux and I've had lot's of trouble until switching to linode. NixOS was up and running within 30min then.. How did you get NixOS on your Linode system? They don't seem to offer it, last I checked. I'm looking in to doing this with PRGMR, which has pretty good pricing though it's not nearly as featureful as Linode. -- Jason Dusek ___ 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 -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Anyone recommend a VPS?
If you need to run your server continuously you might be better off with a cheap dedicated server. To run my quid2.org site, a rather complex setup with a web server and a number of background haskell processes, I use a server from the French provider OVH/Kimsufi (http://www.kimsufi.co.uk/ and http://www.ovh.co.uk/products/dedicated_offers.xml ,main site is ovh.com). You can get a decent box for 15 euro a month and a hell of a machine for 50/60 euros. They also have some Cloud/VPS options, that I have not used. Does anyone have first-hand experience with Amazon EC2? They also look very tempting. Best, titto On 19 March 2011 10:12, Lyndon Maydwell maydw...@gmail.com wrote: Does anyone have any Binaries that are built to run on EC2? That would be super! On Tue, Feb 2, 2010 at 1:11 AM, Jason Dusek jason.du...@gmail.com wrote: 2010/01/31 Marc Weber marco-owe...@gmx.de: If all you want is standard debian or such it does'nt matter. However I tried installing NixOS Linux and I've had lot's of trouble until switching to linode. NixOS was up and running within 30min then.. How did you get NixOS on your Linode system? They don't seem to offer it, last I checked. I'm looking in to doing this with PRGMR, which has pretty good pricing though it's not nearly as featureful as Linode. -- Jason Dusek ___ 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 -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] getting fulling qualified names of types from hint/ghc api
Hi, I am using hint's Language.Haskell.Interpreter.typeOf function to dynamically get the type of a haskell expression but, unfortunately for my purposes, I see that it returns unqualified names (I see in Hint.Conversions that it uses the GHC function GHC.getPrintUnqual). Is there any function in the GHC api or any other simple way of getting the fully qualified types? Surprisingly, I could not find any. Thanks, titto -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Where are all the Taiwanese Haskellers?
Hello, I am going to Taiwan with my family for about five weeks (I am Italian, my wife is Taiwanese and we have two kids) and I wondered if there was any Taiwanese Haskeller that would be interested in meeting for a chat about Haskell, Life and Everything else, maybe in front of a nice cup of 高山茶. We arrive in Taiwan on the 4th of December, spend a few days nearby Taipei and then down to Pu-Li and Kaoshong, where we will spend about 4 weeks and then probably back to Taipei for a few more days around the 10 of January. I am afraid that my Chinese is almost non-existent (yes I know, that's so stupid of me) so the conversation will have to be in English (Italian or French would be fine as well :-)). All the very best, titto -- Dr. Pasqualino Titto Assini http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] http://www.haskell.org/ is down !
Hi, is haskell.org being updated or, as I fear, Haskell's HQ has been overrun by a mob of PHPers ? If so, I am ready to fight ! titto P.S. Just need to find my Excalibur, oh god, the wife just sent it to the Dry Cleaner. -- Pasqualino Titto Assini, Ph.D. http://quid2.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] passing a polymorphic function as a parameter vs using it directly in a function definition
Thanks you all, now it makes sense. titto On 15 July 2010 17:52, Brent Yorgey byor...@seas.upenn.edu wrote: On Thu, Jul 15, 2010 at 01:20:11PM +0100, Pasqualino Titto Assini wrote: Many thanks for the explanation. But I thought that GHC always derives the most generic type, why does it fix my 'a' to 'Int' ? Note that this type evalAST2 :: forall a. (Expr a - IO()) - AST - IO () means that the type a has to be chosen first, i.e. by the *caller* of evalAST2. So evalAST2 is not free to use its argument k at whatever type it wants, it will be given a function of type (Expr T - IO()) for some type T that it didn't get to choose. Forcing the caller to provide a polymorphic function, so that evalAST2 can choose at what type(s) to use it, is exactly what is expressed by the rank-2 type evalAST2 :: (forall a. Expr a - IO()) - AST - IO () -Brent ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] passing a polymorphic function as a parameter vs using it directly in a function definition
Hi, can anyone please explain why in the following code evalAST compiles while evalAST2 doesn't?: Is that because the polymorphic function k is specialised in two different ways in evalAST while in evalAST2 it is constrained to be the same function? {-# LANGUAGE GADTs #-} test = evalAST (TxtA abc) -- This is OK evalAST :: AST - IO () evalAST (IntA i) = k $ Lit i evalAST (TxtA i) = k $ Lit i k :: (Show a) = Expr a - IO () k e = print $ eval e -- This is the same thing, only the k function is passed as a parameter. -- But it won't compile. -- I would expect its type to be: -- evalAST2 :: (Expr a - IO()) - AST - IO () -- But is actually: -- evalAST2 :: (Expr Int - IO ()) - AST - IO () evalAST2 k (IntA i) = k $ Lit i -- evalAST2 k (TxtA i) = k $ Lit i -- The untyped expression data AST = IntA Int | TxtA String -- A typed expression. data Expr a where Lit :: a - Expr a eval :: Expr a - a eval (Lit i) = i Thanks titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] passing a polymorphic function as a parameter vs using it directly in a function definition
Many thanks for the explanation. But I thought that GHC always derives the most generic type, why does it fix my 'a' to 'Int' ? I have another question, now that I know how to pass a generic continuation to evalAST I thought that I could use it to evaluate a more complex language: {-# LANGUAGE GADTs, RankNTypes #-} test = evalAST pr (AppA (SymA reverse) (TxtA abc)) t1 = eval $ App (Lit reverse) (Lit jij) pr :: (Show a) = Expr a - IO () pr = print . eval evalAST :: (forall a. Show a = Expr a - IO()) - AST - IO () evalAST k (IntA i) = k $ Lit i evalAST k (TxtA i) = k $ Lit i evalAST k (AppA f a) = evalASTFun (\ef - (evalAST (\ea - k $ App ef ea) a)) f evalASTFun :: (forall a b. Expr (a- b) - IO ()) - AST - IO () evalASTFun k (SymA reverse) = k $ Lit reverse evalASTFun k (SymA +) = k $ Lit (+) -- An untyped expression data AST = IntA Int | TxtA String | SymA String | AppA AST AST -- A typed expression. data Expr a where Lit :: a - Expr a App :: Expr (a-b) - Expr a - Expr b instance Show (a-b) where show f = function eval :: Expr a - a eval (Lit i) = i eval (App f a) = (eval f) (eval a) But, this won't type check: evalAST k (AppA f a) = evalASTFun (\ef - (evalAST (\ea - k $ App ef ea) a)) f My understanding is that GHC correctly complains that the Expr a returned by ea is not necessarily the same Expr 'a' that ef needs. Is there any way out? Thanks, titto On 15 July 2010 11:20, Bas van Dijk v.dijk@gmail.com wrote: GHC tries to infer the following type for evalAST2: evalAST2 :: forall a. (Expr a - IO()) - AST - IO () However when the type of 'a' has been found in the first alternatives: evalAST2 k (IntA i) = k $ Lit i it is fixed to Int. Then the 'a' doesn't match the type (String) found in the other alternative: evalAST2 k (TxtA i) = k $ Lit i The reason why evalAST type checks is that the type of 'k' is k :: forall a. (Show a) = Expr a - IO () So it works not just for one 'a' but for all of them. The way to correctly generalize evalAST is by telling GHC that 'k' indeed works for all 'a': {-# LANGUAGE RankNTypes #-} evalAST2 :: (forall a. Expr a - IO()) - AST - IO () Regards, Bas On Thu, Jul 15, 2010 at 11:50 AM, Pasqualino Titto Assini tittoass...@gmail.com wrote: Hi, can anyone please explain why in the following code evalAST compiles while evalAST2 doesn't?: Is that because the polymorphic function k is specialised in two different ways in evalAST while in evalAST2 it is constrained to be the same function? {-# LANGUAGE GADTs #-} test = evalAST (TxtA abc) -- This is OK evalAST :: AST - IO () evalAST (IntA i) = k $ Lit i evalAST (TxtA i) = k $ Lit i k :: (Show a) = Expr a - IO () k e = print $ eval e -- This is the same thing, only the k function is passed as a parameter. -- But it won't compile. -- I would expect its type to be: -- evalAST2 :: (Expr a - IO()) - AST - IO () -- But is actually: -- evalAST2 :: (Expr Int - IO ()) - AST - IO () evalAST2 k (IntA i) = k $ Lit i -- evalAST2 k (TxtA i) = k $ Lit i -- The untyped expression data AST = IntA Int | TxtA String -- A typed expression. data Expr a where Lit :: a - Expr a eval :: Expr a - a eval (Lit i) = i Thanks titto ___ 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] bug in ghci ?
Hi, I just noticed that in ghci: data Test = Test String instance Show Test show $ Test Hello Will result in infinite recursion. Is this a known bug? Thanks, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bug in ghci ?
Thanks for the explanation. What I meant is not that is a bug that it recurses but rather the fact that the compiler will accept this incomplete definition without complaining. This problem has bitten me twice while trying to use automatic derivation of a data type in another file. In my innocence I wrote: instance Show Test rather than deriving instance Show Test I didn't notice the error as GHC seemed to be happy and then when I tried to use it: BANG! Very confusing. I suppose that Haskell has spoiled me, if it compiles I assume that it will work :-) Best, titto On 8 July 2010 14:29, Daniel Fischer daniel.is.fisc...@web.de wrote: On Thursday 08 July 2010 15:20:13, Pasqualino Titto Assini wrote: Hi, I just noticed that in ghci: data Test = Test String instance Show Test show $ Test Hello Will result in infinite recursion. Is this a known bug? It's not a bug. There are default methods in Show for show in terms of showsPrec and for showsPrec in terms of show. You need to define at least one of the two to get a working Show instance, otherwise trying to evaluate (show stuff) will lead to infinite recursion, it's the same with e.g. Eq. Might be a worthwhile feature request to let the compiler emit a warning on every instance declaration where no method is defined. Thanks, titto -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bug in ghci ?
Well the problem is that no warnings are generated. If you have a class with some methods that do not have a default implementation and you do not provide them when defining your instance, GHC will at least politely complain. Ideally, GHC would detect that a Show instance requires one of its two functions to be declared as they are mutually recursive and complain. Is that too much to ask? Maybe it is, and I can see why ghc developers would not bother, but can we agree that if not a bug, this is at least an inconvenience ? It took me a while to determine that it was not my own code but rather the incomplete show instance that was sinking my app :-) Best, titto On 8 July 2010 14:47, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: Pasqualino \Titto\ Assini tittoass...@gmail.com writes: Thanks for the explanation. What I meant is not that is a bug that it recurses but rather the fact that the compiler will accept this incomplete definition without complaining. This problem has bitten me twice while trying to use automatic derivation of a data type in another file. In my innocence I wrote: instance Show Test rather than deriving instance Show Test I didn't notice the error as GHC seemed to be happy and then when I tried to use it: BANG! Very confusing. I suppose that Haskell has spoiled me, if it compiles I assume that it will work :-) As I said, there would be no error as all the methods have a definition (whether or not they make sense in this case is a different story); it will still successfully load a file if any methods don't have definitions but will provide a warning in those situations. -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] bug in ghci ?
On 8 July 2010 15:11, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: So you're volunteering to write such functionality? :p No ! I will patiently wait for the Simons' Dream Team to fix that and in the meantime I will live with the realisation that, having been kicked out of Eden, there is nothing in this world that is absolutely perfect, not even Haskell. Thanks again to everybody for their prompt answers, I had almost forgotten how reactive and comprehensive this mailing list can be :-) titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: do we need types?
This seems quite relevant: http://lambda-the-ultimate.org/node/3837 titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Anyone recommend a VPS?
In Europe, http://www.ovh.com has quite good prices. titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Web application interface
Hi Michael, no, the message was not meant to be off-list, that was just me pressing the wrong button :-) Regarding happstack, I do not believe that there is a contrast with your effort, the core of happstack is in its persistency mechanism not in its http interface so I think it would be great to engage the happstack community in this effort. We have so many half-baked and dispersed attempts in the web area that any attempt at consolidation can only be welcome. Personally I have been using happstack for a few years though now I am running it behind a nginx server because of its known deficiencies (no HTTPS etc). titto P.S. I will be away for a few days and unable to answer my email 2010/1/13 Michael Snoyman mich...@snoyman.com: Not sure if you replied off-list on purpose or not, but I'll continue this off list for the moment. I think we have a bit of a problem in the Haskell web community: you've got the Happstack camp and then the rest of us. The rest of us need to rally around *something*, and it seems that Hack didn't get people's attention for some reason. I'm happy to write WAI, but I'd like more to make it a community effort. You have any thoughts on this? My first stab at the idea is to create a github repo, write the code, and then try to get people to comment on it. However, I also want to give it at least a day so I can get people's feedback on this e-mail. What have you been using for Haskell web development until now? It seems like each non-Happstack person has a totally different approach, and I'd like to try and consolidate this together somehow. Michael On Wed, Jan 13, 2010 at 11:12 PM, Pasqualino Titto Assini tittoass...@gmail.com wrote: A unified web app interface would be a God-sent, please please go ahead. Regarding point 1, I find hack interface nice and clean and would like to see something similar. Regarding point 2 I vote for correctness/performance vs convenience. titto 2010/1/13 Michael Snoyman mich...@snoyman.com: Hi, I recently read (again) the wiki page on a web application interface[1] for Haskell. It seems like this basically works out to Hack[2], but using an enumerator instead of lazy bytestring in the response type. Is anyone working on implementing this? If not, I would like to create the package, though I wouldn't mind some community input on some design decisions: * Hack has been fairly well-tested in the past year and I think it provides the features that people want. Therefore, I would want to model the Environment variable for WAI from Hack. I *could* just import Hack in WAI and use the exact same Environment data type. Thoughts? * If using a different data type for Environment, should I replace the String parts with ByteStrings? On the one hand, ByteStrings are the correct data type since the HTTP protocol does not specify a character encoding; on the other hand, Strings are easier to deal with. * It's simple to write a function to convert between a lazy bytestring and an enumerator, meaning it would be very easy to write conversion functions between Hack and WAI applications. This would make it simpler for people to use either backend. If someone else is already working on WAI, please let me know, I don't want to have duplicate implementations. The idea here is to consolidate, not split the community. I have a few Hack handlers (simpleserver, cgi, fastcgi) that I would happily convert to WAI handlers as well. Michael [1] http://www.haskell.org/haskellwiki/WebApplicationInterface [2] http://hackage.haskell.org/cgi-bin/hackage-scripts/package/hack ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: what is *hack*?
Hi Michael, what is your experience with hack? Do you have any problem moving your apps from one server/env to another? Regards, titto 2010/1/13 Günther Schmidt gue.schm...@web.de: Hi Michael, on first impression this seems like a good idea then. Günther Am 13.01.10 15:48, schrieb Michael Snoyman: Günther, Hack is a layer between a web application and a web server. It allows you to write a web application once and have it communicate with the server in different ways simply by swapping the handler. For example, I have applications that I test on my local system using hack-handler-simpleserver and then deploy onto an Apache server using either hack-handler-cgi or hack-handler-fastcgi. Michael ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] KiCS (Curry to Haskell interpreter) problem
Hi, I am playing around with KiCS and I have a strange problem, when I evaluate a goal the variable bindings are not displayed, I see only the value of the expression. The same expression evaluated in pakcs (another curry interpreter) displays the bindings correctly. Is this a known bug? I would have contacted the author but his email in not in the haskell cabal file. Incidentally, is anyone else using KiCS ? Any comments/remarks ? Best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Fwd: [Haskell-cafe] Is () a 0-length tuple?
The syntax is similar, but what else is? In JavaScript there is a null value, that is the only value of the null type. Isn't () the same thing? The only value of the unary type? Best, titto 2009/11/6 John Dorsey hask...@colquitt.org: In what sense () is a 0-length tuple? In what sense isn't it? Data.Tuple is much to narrow to be of any use here. () is in at least most, if not all, of the type classes that tuples are in. The syntax is strikingly similar. If you ask me, it walks/quacks/smells like a duck, so it's a duck. Regards, John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] representing Haskell objects in a uniform way
Hi, I am writing a little IPC system to make Haskell values and functions remotely invokable. To do so, I need (or so I believe) to make my objects accessible via a generic interface as in: class AFun f where afun :: Data a = f - ([Dynamic] - a) So my generic object is something that takes an array of parameters, that being Dynamic can be anything, and returns a Data, that I can easily serialise and send back on the wire. I start by defining an instance for functions: instance (Typeable a,AFun b) = AFun (a-b) where afun f (p:ps) = let Just v = fromDynamic p in afun (f v) ps afun _ _ = error Too few arguments So far so good, but when I try to define an instance for values: instance Data v = AFun v where afun f [] = f afun _ _ = error Too many arguments I get: Couldn't match expected type `a' against inferred type `v' `a' is a rigid type variable bound by the type signature for `afun' at /home/titto/.quid2/state/ubuntu.local.8080/wikidata/haskell/package/haskelld/src/HaskellD/Test.hs:7:17 `v' is a rigid type variable bound by the instance declaration Why is that? a and v are both declared to be a Data, why should they not match? The full code follows: {-# LANGUAGE FlexibleInstances ,UndecidableInstances ,OverlappingInstances #-} import Data.Data import Data.Dynamic class AFun f where afun :: Data a = f - ([Dynamic] - a) instance (Typeable a,AFun b) = AFun (a-b) where afun f (p:ps) = let Just v = fromDynamic p in afun (f v) ps afun _ _ = error Too few arguments instance Data v = AFun v where afun f [] = f afun _ _ = error Too many arguments Thanks in advance, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: dbus-core 0.5 and dbus-client 0.1
I think that we should institute an award for best documented haskell package and yours would be my first choice. Congratulations, titto 2009/10/30 John Millikin jmilli...@gmail.com: These are pure-Haskell client libraries for using the D-Bus protocol. D-Bus is heavily used for inter-application IPC on Free and open-source desktop platforms, such as Linux, OpenSolaris, and FreeBSD. These libraries allow applications written in Haskell to inter-operate with other components of recent GNOME, KDE, and XFCE desktops. This is the first real release of these libraries; dbus-core has been published on Hackage for some time, but mostly just to make sure I got the Cabal bits right. I feel they are now stable / featureful enough for public use. Both are available on Hackage: http://hackage.haskell.org/package/dbus-core http://hackage.haskell.org/package/dbus-client - dbus-core is an implementation of the D-Bus protocol, specifically the parts relevant to clients. Eventually, it will probably grow some functions useful for implementing a message bus as well. It includes type mapping / conversion, an implementation of the wire format (marshaling / unmarshaling), data types for the currently defined message types (METHOD_CALL, METHOD_RETURN, ERROR, and SIGNAL) and a basic parser / generator for introspection documents. It is roughly equivalent in purpose to libdbus. By itself, a protocol implementation is somewhat cumbersome to use, so dbus-client is a high-level wrapper. It provides some abstractions like remote object proxies, exported object trees, synchronous method calls, signal reception, and name reservation. Messages are received and processed in separate IO threads, allowing asynchronous method call and signal handling. The purpose between splitting the library into two packages is stability; dbus-core, ideally, will change only rarely -- performance improvements, new message / data types, etc. It provides a base level of functionality which more specialised libraries may use. dbus-client is an example of what such a library could look like, though for now it's not very Haskell-y (IO everywhere, exceptions, explicit locking). By separating the protocol from the client libs, alternative client libs can safely depend on the protocol implementation. - To see a sample of the library working, there's a clone of the dbus-monitor utility in dbus-core/Examples. Documentation is currently a bit lacking, so for now, the best documentation is the PDF of the source code itself, and the (rather barren) Haddock output: https://dl.getdropbox.com/u/1947532/dbus-core_0.5.pdf https://dl.getdropbox.com/u/1947532/dbus-core_0.5/index.html https://dl.getdropbox.com/u/1947532/dbus-client_0.1.pdf https://dl.getdropbox.com/u/1947532/dbus-client_0.1/index.html Once more people have used it without any major API issues, I'll write up a manual and populate the Haddock entries. Please respond with any feedback, difficulties, or suggestions. I'm particularly interested in ways to improve the public API, since I would rather make any breaking changes *before* anything big depends on these libraries. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] pretty printing with comments
Hi, Is there any simple way of pretty printing haskell source code while preserving the comments? I am looking at the haskell-src-ext library. It can parse files with comments and it can pretty print but, for what I can see it cannot do both :-) (prettyPrint won't work on the structure returned by parseFileWithComments). Thanks, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] pretty printing with comments
Thanks Niklas, in fact this produced a source with comments: import Language.Haskell.Exts.Annotated main = do (ParseOk (mod,comments)) - parseFileWithComments defaultParseMode Test.hs let pretty = exactPrint mod comments writeFile Test_PRETTY.hs pretty However: - The source code produced was incorrect: class Dir d where was rewritten as: class Dir dwhere{ And: instance Dir Directory where localDir (Local f) = return f type URL= String was rewritten as: instance Dir Directory where localDir (Local f) = return f typeURL= String Are these known bugs? - Also, the printing is a bit too exact :-), I would like to keep my comments AND get the code nicely reformatted. Is there a way? What people use to keep their haskell source files in tip-top shape? Thanks titto 2009/10/20 Niklas Broberg niklas.brob...@gmail.com: Hi Pasqualino, I am looking at the haskell-src-ext library. It can parse files with comments and it can pretty print but, for what I can see it cannot do both :-) (prettyPrint won't work on the structure returned by parseFileWithComments). What you want is exactPrint, defined in Language.Haskell.Exts.Annotated.ExactPrint. :-) Cheers, /Niklas ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] pretty printing with comments
Hi, there is also another difference: type URL= String was a top level definition but it has been moved under the previous instance declaration. I attach a source fragment and another file with the pretty printed output containing these three errors. Regarding the problem of pretty printing while keeping the comments I imagine that you would like the comments to be associated with the previous syntactical element (module, top level declaration or expression) and be rendered in the same relative position in the pretty printed output. I agree that it doesn't sound like an easy task. However, similar systems exists for most languages (I loved my Java reformatter in Eclipse) and it would be very handy in Haskell as well. Best, titto 2009/10/20 Niklas Broberg niklas.brob...@gmail.com: instance Dir Directory where localDir (Local f) = return f typeURL= String Sorry, I don't see the difference between these two. Did you write the correct one twice by mistake? In case Pasqualino doesn't see your mail real soon... Maybe the difference is the missing space between type and URL. Ah, of course, I see it now, thanks! Cheers, /Niklas -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ class Dir d where localDir :: d - IO FilePath data Package = Cabal Directory | SourceTree Directory deriving (Read,Show,Typeable,Data) -- A (possibly remote) directory that can be mapped to a local one. data Directory = Local FilePath | Darcs {url::URL,darcsVersion::DarcsVersion,subDirectory::FilePath} deriving (Read,Show,Typeable,Data) data DarcsVersion = Patch String | Tag String deriving (Read,Show,Typeable,Data) instance Dir Directory where localDir (Local f) = return f localDir (Darcs {url=url,darcsVersion=Patch patch,subDirectory=subDir}) = do tmp - createTempDir 0 haskelld darcsOut - runDarcsCommand tmp get [--lazy,--to-match,hash ++ patch,url,fs] print darcsOut let (ExitSuccess,,out) = darcsOut print out return $ tmp / fs / subDir type URL = String class Dir dwhere{ localDir :: d - IO FilePath data Package = Cabal Directory | SourceTree Directory deriving (Read,Show,Typeable,Data) -- A (possibly remote) directory that can be mapped to a local one. data Directory = Local FilePath | Darcs {url::URL,darcsVersion::DarcsVersion,subDirectory::FilePath} deriving (Read,Show,Typeable,Data) data DarcsVersion = Patch String | Tag String deriving (Read,Show,Typeable,Data) instance Dir Directory where localDir (Local f) = return f localDir (Darcs {url=url,darcsVersion=Patch patch,subDirectory=subDir}) = do tmp - createTempDir 0 haskelld darcsOut - runDarcsCommand tmp get [--lazy,--to-match,hash ++ patch,url,fs] print darcsOut let (ExitSuccess,,out) = darcsOut print out return $ tmp / fs / subDir typeURL= String ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] So I wrote this performance measurement library thingy
Hi Bryan looks great. The examples directory mentioned in the README, however, does not seem to be included in the package updated to hackage (though is available in darcs). This might be a bit confusing for new users. Regards, titto 2009/9/29 Bryan O'Sullivan b...@serpentine.com: Which I will not blather on too long about here, but point you at a blog posting instead: http://www.serpentine.com/blog/2009/09/29/criterion-a-new-benchmarking-library-for-haskell/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] unicode text libraries, and the winner is ...
By unanimous opinion the text library is the man. Thanks to all who answered. titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Instances for Data.Text
2009/9/29 Paulo Tanimoto tanim...@arizona.edu: Hi Bryan and others, On Mon, Sep 28, 2009 at 5:29 PM, Bryan O'Sullivan b...@serpentine.com wrote: bytestring predates the other two libraries by several years. The underlying stream type for uvector and text are almost the same, so they could in principle be merged. There's a fair amount of duplication there, but uvector is in some ways more complicated and in others much less thorough than text. Merging them would be a lot of work! If I may free-ride on this thread: how should one go about deriving a Data.Binary instance for text? It looks like doing it efficiently would require using some parts of the internal module that are not exposed, am I correct? I've been using encodeUtf8, but that doesn't feel right. I don't know what to do, hopefully I'm missing something simple. This is a good point, I also need to make Data.Text an instance of a few basic classes and I am not sure that I did it correctly. So far I have: import Data.Text instance Binary Text where put = put . encodeUtf8 get = liftM decodeUtf8 get -- DOUBT: Is this correct also for Data.Text.Lazy ? instance NFData Text instance Serial Text where -- DOUBT: is this efficient? series d = [T.pack (series d :: String)] -- DOUBT: how to define this coseries rs = error coseries More in general: what is the right policy for instances definition? Should the library author provide them, at least for the most common and appropriate classes (at the cost of adding some additional dependencies) ? Should they go in a separate package? Should the Haskell Platform team provide some guidance on this point to library authors? titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] QuickCheck Questions
Fantastic. If I understand correctly it inductively derives equations that hold for a set of examples. I am looking forward to see it in Haskell, who is working on the port? titto 2009/9/28 Emil Axelsson e...@chalmers.se: Not sure this is what you want, but I thought I'd mention Formal Specifications for Free: http://www.erlang.org/euc/08/1005Hughes2.pdf (I wasn't able to find a better link. That talk is for Erlang, but people are working on this for Haskell QuickCheck.) / Emil Yusaku Hashimoto skrev: After a few more investigations, I can say QuickCheck does: - make easy to finding couter-cases and refactoring codes - make easy to test some functions if they have good mathematical properties - generate random test cases But QuickCheck does *not*: - help us to find good properties So what I want to know is how to find good properties. Please let me know how do you find QuickCheck properties. There are so many tutorials or papers for using QuickCheck, but when I try to apply them to my programming, I often miss properties in my codes. Cheers -nwn ___ 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 -- Pasqualino Titto Assini, Ph.D. http://quicquid.org/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Last Call for the Italian Haskellers Summer Meeting
On Thursday 07 August 2008 19:35:17 Dan Weston wrote: Shouldn't that be posta elettronica (or posteletta along the lines of the Frence courriel)? Somehow I doubt that Dante would have approved of the word email. Actually I don't think that he would have disapproved. Dante wrote the Divina Commedia in the Florentine dialect, a 'vulgar' language that was far from codified and quite open to external influences. Mussolini, on the contrary, with his nationalistic/racist mindset would have been mightly pissed off by my usage of 'email' and would have certainly insisted for 'posta elettronica' (a perfect valid term by the way, just a bit longer than necessary). But then who cares if Mussolini spins in his grave? Best, titto Titto Assini wrote: As usual we will now switch to Dante's bella lingua. Ottimissimi, mancano pochi giorni al primo incontro estivo/balneare degli haskeller italiani. Per informazioni e registrarsi date uno sguardo a: http://www.haskell.org/haskellwiki/ItaloHaskell/Summer_2008 Oppure contattate il sottoscritto via email o per telefono al 0584 791669. A presto ragazzi, titto -- Pasqualino Titto Assini PhD 25 Heath Road - Wivenhoe CO79PT - Colchester - U.K. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Italian Haskellers Summer Meeting?
As a prerequisite for atttending is proficiency in la bella lingua del si (also known as Italian) I think I will just write the rest of this message in it. Ottimi, ma non particolarmente abbondanti, haskeller italiani, abbiamo avuto una piccola discussione su #haskell.it circa la possibilita' di organizzare un incontro estivo. Non credo che ne sia stato mai organizzato uno e quindi vorrei intanto che mi faceste sapere: - se vi interessa - dove siete/sarete d'agosto - che formato debba avere l'incontro Riguardo quest'ultimo punto, direi che ci sono almeno tre possibilita' : a) Ritiro spirituale. Luogo: rifugio di montagna, monastero benedettino. Gli adepti giungono al luogo designato dopo un lungo percorso a piedi attraverso regioni desertiche. Hanno barbe lunghe ed occhi severi ma in cui brilla la luce di una pura fede monoidale. Riunitisi davanti ad un semplice pasto gli adepti spezzano il pane e bevono il vino e si scambiano parabole illuminanti circa la vera natura del Monoide, della Monade e del Funtore Applicativo. Un neofita, che non sa spiegare la differenza fra left e right fold, viene giudicato impuro e ritualmente lapidato. b) Scampagnata fuori porta Luogo: ridente localita' marina od agreste. Gli haskeller arrivano alla spicciolata su una spiaggia animata. Hanno costumi colorati e capelli rasta. Qualcuno ha portato i bambini, tutti hanno portato la paletta ed il secchiello. Si fanno castelli di sabbia, qualcuno passa una canna, si divide una pizza e si chiacchiera' in liberta di haskell, zen e viaggi in motocicletta. L'atmosfera si rabbuia pero' improvvisamente quando viene scoperto un infiltrato provocatore che non sa spiegare la differenza fra left e right fold. Sommariamente giudicato da un tribunale del popolo, l'infelice viene affogato ed abbandonato sulla spiaggia, nell'indifferenza dei bagnanti che continuano a giocare a solitario sui telefonini. c) Seminario accademico Luogo: tetra aula universitaria. Serie presentazioni accademiche si susseguono senza posa. Per ragioni di principio nessuno dei relatori usa power point e riempiono le lavagne nere con suggestivi ma incomprensibili sgorbi. Si suda copiosamente nel caldo estivo e l'olezzo di accademici poco lavati riempie la stanza. Un dottorando dell'universita' di Pisa emoziona l'auditorio, dimostrando in maniera inconfutabile la mirabile corrispondenza fra monoidi destrorsi e logica lineare. Un addottorato del politecnico di Torino, geloso, cerca di staccargli un occhio con un gessetto. Un neofita, che non sa spiegare la differenza fra left e right fold, russa in un angolo. Personalmente, vista la stagione, suggerirei di: - Se c'e' disponibilita' a passare un paio di giorni insieme optare per l'opzione a. Paolino ha proposto a questo proposito di riunirci in un rifugio delle Apuane. - Se invece vogliamo fare una cosa in giornata allora andrei per l'opzione b e suggerirei di vederci sulla spiaggia di Monterosso (5 Terre). Come data, suggerirei l'11 agosto (o 11-12 in caso di opzione a). Per registrarsi, proporre date/luoghi etc, proporrei di utilizzare la pagina wiki dedicata: http://www.haskell.org/haskellwiki/ItaloHaskell/Summer_2008 A presto, titto P.S. Io saro' offline per una settimana a partire da domenica. Pasqualino Titto Assini PhD 25 Heath Road - Wivenhoe CO79PT - Colchester - U.K. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Typed DSL compiler, or converting from an existential to a concrete type
Hi Oleg, Many thanks for this, it is really brilliant stuff. It is a pity that it cannot be used in an interpreter but it is a great trick to know for static compilation of DSLs. All the best, titto On Saturday 06 October 2007 08:55:36 [EMAIL PROTECTED] wrote: The earlier message showed how to implement a typechecker from untyped AST to wrapped typed terms. The complete code can be found at http://okmij.org/ftp//Haskell/staged/TypecheckedDSL.hs The typechecker has the type typecheck :: Gamma - Exp - Either String TypedTerm where data TypedTerm = forall t. TypedTerm (Typ t) (Term t) Upon success, the typechecker returns the typed term wrapped in an existential envelope. Although we can evaluate that term, the result is not truly satisfactory because the existential type is not `real'. For example, given the parsed AST te3 = EApp (EApp (EPrim +) (EApp (EPrim inc) (EDouble 10.0))) (EApp (EPrim inc) (EDouble 20.0)) we might attempt to write testr = either (error) (ev) (typecheck env0 te3) where ev (TypedTerm t e) = sin (eval e) We know that it should work. We know that e has the type Term Double, and so (eval e) has the type Double, and so applying sin is correct. But the typechecker does not see it this way. To the typechecker Inferred type is less polymorphic than expected Quantified type variable `t' escapes that is, to the typechecker, the type of (eval e) is some abstract type t, and that is it. As it turns out, we can use TH to convert from an existential to a concrete type. This is equivalent to implementing an embedded *compiler* for our DSL. The trick is the magic function lift'self :: Term a - ExpQ that takes a term and converts it to the code of itself. Running the resulting code recovers the original term: $(lift'self term) === term There is actually little magic to lift'self. It takes only four lines of code to define this function. We can now see the output of the compiler, the generated code *TypedTermLiftTest show_code $ tevall te3 TypecheckedDSLTH.App (TypecheckedDSLTH.App (TypecheckedDSLTH.Fun (Language.Haskell.TH.Syntax.mkNameG_v base GHC.Num +) (GHC.Num.+)) (TypecheckedDSLTH.App (TypecheckedDSLTH.Fun (Language.Haskell.TH.Syntax.mkNameG_v main TypecheckedDSLTH inc) TypecheckedDSLTH.inc) (TypecheckedDSLTH.Num (10%1 (TypecheckedDSLTH.App (TypecheckedDSLTH.Fun (Language.Haskell.TH.Syntax.mkNameG_v main TypecheckedDSLTH inc) TypecheckedDSLTH.inc) (TypecheckedDSLTH.Num (20%1))) [we should be glad this is not the machine code] Mainly, we can now do the following (in a different module: TH requires splices to be used in a different module) tte3 = $(tevall te3) :t tte3 tte3 :: Term Double This is the real Double type, rather some abstract type ev_tte3 = eval tte3 -- 32.0 testr = sin (eval tte3) testr = sin (eval tte3) -- 0.5514266812416906 The complete code for the DSL compiler is available at http://okmij.org/ftp//Haskell/staged/TypecheckedDSLTH.hs http://okmij.org/ftp//Haskell/staged/TypedTermLiftTest.hs ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Typechecker to GADT: the full implementation of a typed DSL
Oleg, thank you so much for taking the time to provide the example code and the explanation, it really helps. My mental typechecker seems to diverge on the data EQ a b where Refl :: EQ a a bit so I am now reading the typing dynamic typing paper, hoping for further enlightment. If you don't mind, I would have a question regarding the usage of Template Haskell to convert the AST to a typed term. I have found this paper by Louis-Julien Guillemette and Stefan Monnier : http://www.iro.umontreal.ca/~monnier/tct.pdf The code that I could extract from the paper (there doesn't seem to be a code distribution) follows. I don't see however how this could possibly be used to implement an interpreter, certainly the AST must be known at compile time, or am I missing something? Thanks again, titto {-# OPTIONS -fglasgow-exts -fth #-} module HOASEval where import Language.Haskell.TH type VarId = String data AST = Fvar VarId | Flam VarId AST | Fapp AST AST lift :: AST - ExpQ lift (Fvar x) = varE (mkName x) lift (Flam x b) = [| Lam $(lam1E (varP (mkName x)) (lift b)) |] lift (Fapp a b) = [| App $(lift a) $(lift b) |] data Term t where Num :: Int - Term Int Prim :: PrimOp - Term Int - Term Int - Term Int If0 :: Term Int - Term t - Term t - Term t Lam :: (Term s - Term t) - Term (s - t) App :: Term (s - t) - Term s - Term t data PrimOp = Add | Sub | Mult e0 = Flam x (Fvar x) eval ast = $(lift ast) test = eval e0 On Thursday 04 October 2007 07:02:32 [EMAIL PROTECTED] wrote: Pasqualino 'Titto' Assini wrote: I am trying to write an interpreter for a little functional language but I am finding very problematic to dynamically create a typed representations of the language terms. The problem is to write a function that converts between Exp and Term t as in: test :: Term Double test = typecheck $ EApp (EPrim inc) (EDouble 10.0) The specification leaves out a few important details. The typechecker can't be a total function: what happens when typechecking this code? EApp (EDouble 10.0) (EPrim inc) The error has to be reported somehow, and it is important to know how. There are basically two choices. One is to keep the above interface test :: Term Double test = typecheck $ EApp (EPrim inc) (EDouble 10.0) which means using Template Haskell and means letting TH reporting type errors (with no hope of catching them). The second choice is `typing dynamic typing'. Which means we can't write a typechecker with the signature Exp - Term t. Rather, we have to write typecheck :: Exp - (forall t. Typ t - Term t - w) - Maybe w or, equivalently, using an existential data MostlyStatic = forall t. MostlyStatic (Typ t, Term t) typecheck :: Exp - Maybe MostlyStatic Although both MostlyStatic and Exp are `untyped', the latter is `deeply' untyped, whereas the former is only untyped at the surface. In the case of MostlyStatic, the term is built out of typed components, and the type is erased only at the end. These choices aren't contradictory: using TH, we can convert MostlyStatic to the proper Haskell term. Because the term has already been typechecked, we are guaranteed the absence of errors during such a conversion. For today, perhaps the implementation of the second choice will be sufficient. This is the complete representation of a typed DSL given in the untyped AST form. We typecheck a term. We either report a type error, or evaluate the typed term and then report result, if can be shown. We also show the inferred type of the result. Examples. Let's assume the following terms (not all of them well-typed) te1 = EApp (EPrim inc) (EDouble 10.0) te2 = EApp (EDouble 10.0) (EPrim inc) te3 = EApp (EApp (EPrim +) (EApp (EPrim inc) (EDouble 10.0))) (EApp (EPrim inc) (EDouble 20.0)) te4 = EApp (EPrim rev) te3 te5 = EApp (EPrim rev) (EApp (EPrim show) te3) *Eval teval te1 type Double, value 11.0 *Eval teval te2 Type error: Trying to apply not-a-function: Double *Eval teval te3 type Double, value 32.0 *Eval teval te4 Type error: incompatible type of the application: (String-String) and Double *Eval teval te5 type String, value 0.23 The complete code follows {-# OPTIONS -fglasgow-exts #-} -- Typechecker to GADT -- Implementing a typed DSL with the typed evaluator and the -- the typechecker from untyped terms to typed ones module Eval where -- Untyped terms (what I get from my parser): data Exp = EDouble Double | EString String | EPrim String | EApp Exp Exp deriving (Show) -- Typed terms: data Term a where Num :: Double - Term Double Str :: String - Term String App :: Term (a-b) - Term a - Term b Fun :: (a-b) - Term (a-b) -- Typed evaluator eval :: Term a - a eval (Num x) = x eval (Str x) = x eval (Fun x ) = x eval (App e1 e2) = (eval e1) (eval e2
Re: [Haskell-cafe] The Exp - Term a problem (again), how to dynamically create (polymorphic) typed terms in Haskell ??
Hello Tomasz, thank you very much for your advice. Just a quick question, why using your own Dyn rather than Data.Dynamic? Regards, titto On Thursday 04 October 2007 08:57:11 Tomasz Zielonka wrote: On 10/4/07, Pasqualino 'Titto' Assini [EMAIL PROTECTED] wrote: It does not seem to be possible to define typecheck on EApp in a generic way and is also not possible to distinguish between the different cases: You want to pattern-match on types and the easiest way to do it is to introduce a witness GADT for types, something like: data Type a where TString :: Type String TFun :: Type a - Type b - Type (a - b) ... It will be useful to write function: termType :: Term a - Type a You'll probably have to decorate Term constructors with Type's in a few places. As for the typecheck function - it has to be able to return any Term type, dynamically. Existentially quantificated data constructors will be handy here. Here's what I use: data Dyn c = forall a. Dyn (c a) withDyn :: Dyn c - (forall a. c a - b) - b withDyn (Dyn e) f = f e Your typecheck function can have type: typecheck :: Exp - Dyn Term or rather typecheck :: Exp - Maybe (Dyn Term) You define it recursively, getting Dyn Term for subexpressions, checking their types, building bigger Dyn Terms, and so on. You'll probably need some other support functions for working with Dyn and Type - at least I did. I think something similar is presented in Hinze's paper, recommended by Dominic. Best regards Tomasz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Parsing R5RS Scheme with Parsec
Hi Alex, I hope not to spoil your fun but have you had a look at this: Write Yourself a Scheme in 48 Hours http://halogen.note.amherst.edu/~jdtang/scheme_in_48/tutorial/overview.html Regards, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] The Exp - Term a problem (again), how to dynamically create (polymorphic) typed terms in Haskell ??
Hi, I am trying to write an interpreter for a little functional language but I am finding very problematic to dynamically create a typed representations of the language terms. I have googled around and found a few solutions but none seem to solve the problem. This is the example code: {-# OPTIONS -fglasgow-exts #-} module Eval where These are my untyped terms (what I get from my parser): data Exp = EDouble Double | EString String | EPrim String | EApp Exp Exp deriving (Show) And these are the typed terms: data Term a where Num :: Double - Term Double Str :: String - Term String App :: Term (a-b) - Term a - Term b Fun :: (a-b) - Term (a-b) The problem is to write a function that converts between Exp and Term t as in: test :: Term Double test = typecheck $ EApp (EPrim inc) (EDouble 10.0) So this is the conversion function: class TypeCheck t where typecheck :: Exp - Term t A few primitives: instance TypeCheck (String-String) where typecheck (EPrim rev) = Fun reverse typecheck (EPrim show) = Fun show instance TypeCheck (Double-Double) where typecheck (EPrim inc) = Fun ((+1) :: Double - Double) instance TypeCheck (Double-String) where typecheck (EPrim show) = Fun show instance TypeCheck Double where typecheck (EDouble x) = Num x instance TypeCheck String where typecheck (EString x) = Str x The problem arises in the conversion of the function application (EApp). It does not seem to be possible to define typecheck on EApp in a generic way and is also not possible to distinguish between the different cases: typecheck (EApp f a) = App (typecheck f :: Term (String-String)) (typecheck a:: Term String) The following pattern overlaps the previous one: typecheck (EApp f a) = App (typecheck f :: Term (Double-String)) (typecheck a:: Term Double) To avoid this problem I could split my untyped terms in different data types as in: data EDouble = EDouble Double data App a b c = App a b c ... and define TypeCheck separetely on every data type. However, in that case what would be the type of my parser?? parser :: String - ?? Any suggestion woud be very welcome indeed, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] what is f=f (not) doing ?
Hi, if I define: f = f and then try to evaluate 'f' in GHCi, as one would expect, the interpreter never returns an answer. The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time at all. How is this possible? Thanks titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] what is f=f (not) doing ?
On Saturday 22 September 2007 10:58:49 Neil Mitchell wrote: Hi f = f and then try to evaluate 'f' in GHCi, as one would expect, the interpreter never returns an answer. The funny thing is that, while it is stuck in an infinite loop, GHCi doesn't seem to use any CPU time at all. It's called a black hole. The runtime can detect that f directly depends on f, so just gives up early. Essentially it marks f as black hole once it starts evaluating it, and then when it comes back to f, it knows its already doing evaluation on f, so just fails. It would be useful if there was a page on the wiki about black holes, but I can't find one... Many thanks for the explanation. But, if it can detect that is in a black hole, why doesn't it stop the computation altogether and return an error to the user? Best, titto Thanks Neil ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Developing XPCOM components (Firefox extensions) in Haskell
Hello, I wondered if anyone could advice on how to develop XPCOM components in Haskell. I am aware that HDirect supports COM and that there are some similarities with XPCOM but I do not have the time to extend/fix HDirect to support XPCOM. Would using FFI directly be simpler? What problems should I expect? Would you anticipate platform specific issues ? The components should work under both Linux and Windows and ideally Mac as well. Thanks in advance, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Is Haskell well-founded? was: Clearly, Haskell is ill-founded
Doesn't Haskell already implement the 3-valued logic (True, False, NULL), that Karl Fant proposes (see papers at http://www.theseusresearch.com/invocation%20model.htm) as an alternative to centralised clock-based coordination, by postulating that every data type includes the bottom value? I like his concept that: concurrency is simple and primitive and sequentiality is a complex and risky derivative of concurrency. Can someone remind me why, in a language like Haskell that is referentially transparent and therefore inherently 'concurrent', we need explicit concurrency (threads, etc.) ? titto On Monday 09 July 2007 06:48:03 Donald Bruce Stewart wrote: drtomc: I don't know if you saw the following linked off /. http://www.itwire.com.au/content/view/13339/53/ An amazon link for the book is here: http://www.amazon.com/Computer-Science-Reconsidered-Invocation-Expression /dp/0471798142 The basic claim appears to be that discrete mathematics is a bad foundation for computer science. I suspect the subscribers to this list would beg to disagree. Enjoy, :-) And he's patented it... http://www.patentstorm.us/patents/5355496-description.html SUMMARY OF THE INVENTION A method and system for process expression and resolution is described. A first language structure comprising a possibility expression having at least one definition which is inherently and generally concurrent is provided. Further, a second language structure comprising an actuality expression including a fully formed input data name to be resolved is provided. Furthermore, a third language structure comprising an active expression initially having at least one invocation, the invocation comprising an association with a particular definition and the fully formed input data name of the actuality expression is provided. Subsequently, the process of resolving invocations begins in the active expression with fully formed input data names in relation to their associated definition to produce at least one or both of the following: (1) an invocation with a fully formed input data name and (2) a result data name. Interesting... -- Don ___ 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] Combinators for Bi-Directional Tree Transformations: A Linguistic Approach to the View Update Problem in Haskell
Hi, I wondered if anyone had written an Haskell implementation of the combinators described in: Combinators for Bi-Directional Tree Transformations: A Linguistic Approach to the View Update Problem (see the Papers section of http://www.seas.upenn.edu/~harmony/). Harmony's source is in O'Caml so I guess that a translation in Haskell should not be to hard. More in general, is there any work in Haskell on updateable views of generic data structures? Thanks, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Combinators for Bi-Directional Tree Transformations: A Linguistic Approach to the View Update Problem in Haskell
Hello Benjamin, many thanks for you answer. On Friday 06 July 2007 20:43:03 Benjamin Pierce wrote: Hi Titto, I'm not aware of any Haskell implementations of these bi-directional combinators, but the core definitions are not very big -- someone looking at the ML code should have no trouble recreating them in Haskell. The main issue to take care of, beyond the mathematical description in the paper, is doing enough memoization of intermediate structures. I am working on a Web application with an Ajax front-end and I am shopping around for a suitable query language. Updatable views sounds like a good choice, that might be used both for access control and external query/updates. If I understand correctly the mechanism (I just found out about harmony today), queries could be implemented as the get of a composition of an access_control _read lens plus the end user query and updates would be the putback of the composition of an access_control_write lens with the end user query. I wonder however how hard would it be to get it to work efficiently on what might be quite extensive data structure and how hard it would be to map arbitrary Haskell data structure to the tree structures on which the combinators are defined (or alternatively, if it would be possible at all to define similar combinators direcly on haskell data types). (Implementing a full-blown programming language based on these combinators is a more serious project, but even there the amount of code is not that large -- it's the design that takes time, and that you can just steal. :-) Just a curiosity: why bothering to define a new language? What is the advantage with respect to simply providing the combinators as an O'Caml library? Regards, - Benjamin Regards, titto P.S. Please cc me directly on any responses -- I don't read the HaskellCafe list regularly... ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: practicality of typeful programming
On Wednesday 27 June 2007 23:28:44 [EMAIL PROTECTED] wrote: In his system, the type of the matrix includes includes the matrix size and dimensions, so invalid operations like improper matrix multiplication can be rejected statically. And yet, his library permits matrices read from files. Read from files but still at compile time, correct? titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: practicality of typeful programming
Hi Daniil, I had a look at the paper and associated code that Oleg refers to there is no special parsing taking place: From Vector/read-examples.hs: v3 = do let m1 = $(dAM [[1,2],[3,4]]) s - readFile Vector/example-data.txt listMatRow (read s) (\(m2::AVector Double a) - print $ m2 * trans m1 ) It does not make any difference if the list that is used to populate the matrix is specified in the code or read from a file. In both cases, if the list lenght is incorrect, an error is generated at run-time (I think, I cannot run the actual code). The TH trickery, that Oleg refers to, is there to solve a different problem: quote Note that in each example we print the matrix _inside_ the function argument to the list* functions. We cannot, for instance, just return it, because this causes a universally quantified type to escape: listVec_ [1,2,3] (\v - v) interactive:1:0: Inferred type is less polymorphic than expected Quantified type variable `n' escapes In the second argument of `listVec', namely `(\ v - v)' In the definition of `it': it = listVec [1, 2, 3] (\ v - v) This is why it is not possible to have a function which takes a list and returns a vector of unknown type. The 'fromList' member of the Vector class is only used when we want to turn a list into a vector whose type is known in advance. (see v4 below) /quote So, in order to play around with matrices of unknown type in GHCi what they do (if I read the code correctly) is to convert the matrix to TH, specifying the exact type, and compiling/splicing it back: liftVec :: (GetType e, Lift e, GetType a, Dom a, Vector v e, GetType (v a)) = v a - ExpQ liftVec (v::v a) = do es - lift (elems v) let at = getType (__::a) let et = getType (eltType v) let vt = getType (__::(v a)) return $ (SigE (AppE (VarE $ mkName fromList) (SigE es (AppT ListT et))) vt ) Crazy haskellers. Is it just me that some time thinks with nostalgia to Apple II Basic? Best, titto On Thursday 28 June 2007 15:38:17 Daniil Elovkov wrote: 2007/6/28, Pasqualino 'Titto' Assini [EMAIL PROTECTED]: On Wednesday 27 June 2007 23:28:44 [EMAIL PROTECTED] wrote: In his system, the type of the matrix includes includes the matrix size and dimensions, so invalid operations like improper matrix multiplication can be rejected statically. And yet, his library permits matrices read from files. Read from files but still at compile time, correct? (titto, sorry for dupliate) No, what is meant, I believe, is reading from a file at run-time and parsing this way (u :: UnTyped) - readFromFile case parse u of Nothing - -- failed to parse, because those data wouldn't satisfy constraints Just (t::Typed) - -- if we're here, we have the typed t, and there are garantees that it is well formed -- in terms of our invariants parse :: UnTyped - Maybe Typed so deciding whether we have correct data is made at run-time, by calling parse and examining its return value. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A Query Language for Haskell Terms
On Wednesday 27 June 2007 09:32:16 Alex Jacobson wrote: Titto, Have you looked at HAppS.DBMS.IxSet? Right now it provides a generic way to query indexed sets. If you want to take a shot at making the queries serializable, I don't think it would be that difficult (but I have not tried so YMMV). Hi Alex, thanks for remininding me about that. It is a very nice back-end and as you say, it should not be too hard to design a SQL-like query language on top of it. I am still wondering, however, what meta-model is more appropriate to represent the info hold in a Web app. Unfortunately there seem to be at least 3 different ones (without considering mixed approaches like F-Logic): 1) Graph This is really the native Haskell way of representing information: the model is defined using classes or data types and types are connected by direct uni-directional links. So for example the Sale/Item model (from the HAppS DBMS Examples) might be written like: data Item = Item {stock::Int,description::String,price::Cents} deriving (Ord,Eq,Read,Show) data Sale = Sale {date::CalendarTime ,soldItem::Item -- NOTE: uni-directional link to Item ,qty::Int ,salePrice::Cents} deriving (Ord,Eq,Read,Show) or in more abstract form using classes: class Item i where description :: i - String price :: i - Cents class Sale s where soldItem :: Item i = s - i This is also very much the Web-way: information is a graph of resource linked via uni-directional links. Information is queried by path traversal (REST-style): Assuming that the root / represents the collection of all sales then: HTTP GET /elemAt[2345]/soldItem/description.json might return the JSON representation of the description of the item sold as part of sale 2345. 2) Relational Information is represented as tables, that can be joined up via keys, as implemented in HAppS DBMS or in any relational database. The model becomes: data Item = Item {itemId::Id -- NOTE: primary key ,stock::Int,description::String,price::Cents} deriving (Ord,Eq,Read,Show) data Sale = Sale {date::CalendarTime, soldItemId::Id -- NOTE: foreign key ,qty::Int,salePrice::Cents} deriving (Ord,Eq,Read,Show) Plus the appropriate indexes definitions. Information can be queried via a SQL-like language. 3) Logic This is the Semantic Web way: information is broken down into assertions, that in their simplest form are just triples: subject predicate object, the model then becomes something like: Item hasDescription String Item hasPrice Cents Sale hasItem Item It can be populated piecemeal with assertions like: item0 hasDescription indesit cooker 34BA item0 hasPrice 3.5 Sale0 hasSoldItem item0 It can be queried using a logic-oriented query language (e.g SPARQL): sale2345 hasItem ?item ?item hasDescription ?description Moving from Graph to Relational to Logic the meta-model becomes simpler and more flexible. The flip-side is that the model (and the queries) become more verbose. It is not clear where is the sweet spot. What people think? Best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] loading an Haskell symbol at run-time
Hi, to load an Haskell symbol at run-time is still necessary to use the load functions from the hs-plugins library (System.Plugins.Load) or is there some function in the GHC API that does the same job? Thanks, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] A Query Language for Haskell Terms
Hi, I am writing a Web application using HAppS. As all HAppS apps, it represents its internal state as a Haskell term (HAppS automagically provides persistence and transactions). It is a neat and efficient solution, you can write your data model entirely in Haskell and, at least for read-only transactions (queries) it will be operate as fast as possible as all data is in memory (if your transactions modify the application state, the transactions has to be recorded on disk to make it persistent, but this is pretty fast too). One major component, however seem to be missing, if we are effectively using Haskell as an in-memory database where is the SQL for Haskell: a generic query language for Haskell terms? There are three basic functions that every web app has to provide, and all of them could be provided by a generic Haskell SQL: -- query the application state -- transform (possibly monadically) the application state : the result of the query is the new state -- access control: what an user can see is what is returned by an internal access control query The availabilty of such a language would be a major boost for Haskell-based web applications as every application could be accessed via the same API, the only difference being the underlying application-specific data model. So my question is: what ready-made solutions are there in this space, if any? And if there are none, how would you proceed to design/implement such a language? The basic requirements, in decreasing order of importance, are: -- Safe, it must be possible to guarantee that a query: --- cannot cause a system crash --- completes by a fixed time of time --- uses a 'reasonable' amount of space --- cannot perform any unsafe operation (IO, or any unallowed read/write of the application state) -- Expressive (simple queries should be simple, complex queries should be possible) -- Simple to implement -- Efficient: --- Repeated queries should be executed efficiently time-wise (it is acceptable for queries to be executed inefficiently the first time) and all should be space-efficient, so it should not do unnecessary copying. -- User friendly: --- Simple to use for non-haskeller --- Short queries Ah, I almost forgot, it should also be able to make a good espresso. The problem can be broken in two parts: 1) How to implement generic queries on nested terms in Haskell? 2) How to map the queries, written as a string, to the internal Haskell query Regarding the first point, I am aware of with the following options: - SYB (Data.Generics..) - Oleg's Zipper - (Nested) list comprehensions (that are being extended with SQL-like order by and group by operators) Being rather new to Haskell all these options are rather unfamiliar so I would appreciate any advice on what should be preferred and why. Regarding the second point: The simplest solution would be to avoid the problem entirely by using Haskell directly as the query language. This is the LambdaBot way: queries are Haskell expression, compiled in a limited environment (a module with a fixed set of imports, no TH). Lambdabot avoids problems by executing the expression on a separate process in a OS-enforced sandbox that can be as restrictive as required (especially using something like SELinux). However, to get the query to execute efficiently it would probably have to be executed in a GHC thread and I am not sure how safe that would be. Looking at the discussion at http://haskell.org/haskellwiki/Safely_running_untrusted_Haskell_code it seems clear that there are many open issues. For example, how would I enforce limits on the space used by the query? So, it would probably be better to define a separate query language that is less expressive but more controllable than full Haskell, but what form should that take? Any suggestion/tip/reference is very welcome, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] A Query Language for Haskell Terms
On Saturday 23 June 2007 13:52:27 Neil Mitchell wrote: Hi Regarding the first point, I am aware of with the following options: - SYB (Data.Generics..) You may also want to take a look at Uniplate: http://www-users.cs.york.ac.uk/~ndm/uniplate/ Many thanks Neil. That (or SYB) should take care of your query/transform issues, and the ACL stuff can be layered on top of that. I have no idea how you'd manage the space/time requirements though. Talking about space requirements, does Uniplate (or SYB for that matter) always perform a full copy of the traversed structure ? Best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Graphical Haskell
This might be of interest: http://pipes.yahoo.com/pipes/ Best, titto On Friday 22 June 2007 11:15:49 peterv wrote: Hi, Since nobody gave an answer on this topic, I guess it is insane to do it in Haskell (at least for a newbie)? :) Thanks for any info, Peter -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of peterv Sent: Wednesday, June 20, 2007 21:48 To: haskell-cafe@haskell.org Subject: [Haskell-cafe] Graphical Haskell In the book Haskell School of Expression, streams are nicely explained using a graphical flow graph. This is also done more or less in http://research.microsoft.com/~simonpj/papers/marktoberdorf/Marktoberdorf.p p t to explain monads and other concepts. I would like to create a program that allows you to create such flow graphs, and then let GHC generate the code and do type inference. I found a paper where Haskell is used to create a GUI application with undo/redo etc for creating graphical Basian networks (http://www.cs.uu.nl/dazzle/f08-schrage.pdf), so this gave me confidence that I could it do all in Haskell. Now, instead of generating Haskell code (which I could do first, would be easier to debug), I would like to directly create an AST, and use an Haskell API to communicate with GHC. I already found out that GHC indeed has such an API, but how possible is this idea? Has this been done before? I only found a very old attempt at this, confusingly also called Visual Haskell, see http://ptolemy.eecs.berkeley.edu/%7Ejohnr/papers/visual.html, but I can't find any source code for that project. I did a similar project in C# that generated C++ code, so I've done it before, just not in Haskell. Thanks a lot, Peter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.9.1/857 - Release Date: 20/06/2007 14:18 No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.472 / Virus Database: 269.9.1/857 - Release Date: 20/06/2007 14:18 ___ 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] Re: Orthogonal Persistence in Haskell
Many thanks Claus for the extended explanation, it makes perfect sense. For more info I will now turn to the papers :-) Talking about serialisation, an interesting paper has just appeared on lambda-the-ultimate: HOT Pickles http://lambda-the-ultimate.org/node/2305 Regards, titto On Friday 22 June 2007 00:28:53 Claus Reinke wrote: with orthogonal persistence, everything a program touches might persist, but usually, programs talk about the data being persistet (?), not about whether that data is currently temporary or in long-term storage. if you want to move such data between processes or storage areas, you move the reference, and the system handles serialisation/ communication/deserialisation behind the scenes. This is interesting, could you elaborate on it? How would you get data to move around by moving its reference? more elaboration than the various papers, surveys, and phd theses listed in the references i provided?-) the idea is that i give you the reference, and you take care of looking at the data behind it, without me having to serialise the contents;-) but ok, lets see whether i can get the idea accross by example: a) suppose you want to move some x from list a to list b do you get the type of x, devise a type-specific traversal to serialise x from the source, move the flattened data from a to b, and deserialise x in the target? or do you just write: test = move ([1..4],[3..5]) move (x:as) b = (as,x:bs) b) suppose you want to move some x from concurrent haskell process a to concurrent haskell process b do you get the type of x, devise a type-specific traversal to serialise x from the source, move the flattened data from a to b, and deserialise x in the target? or do you write something like: test = do { av-newEmptyMVar; bv-newEmptyMVar; forkIO (putMVar av [1..]); forkIO (takeMVar bv = print . take 10); move av bv } move av bv = takeMVar av = putMVar bv c) suppose you want to move some x from os process a to os process b do you get the type of x, devise a type-specific traversal to serialise x from the source, move the flattened data from a to b, and deserialise x in the target? yes. and if the type is not serialisable, you're stuck. d) suppose you want to move some x from os process a to an os file, for later retrieval in process b do you get the type of x, devise a type-specific traversal to serialise x from the source, move the flattened data from a to b, and deserialise x in the target? yes. and if the type is not serialisable, you're stuck. now, why are c/d so much more troublesome than a/b? i don't care whether the x to be moved is an integer, a matrix, a function, or the list of primes - i just want it to be moved from a to b. or rather, i move the reference to x, and the runtime system moves whatever representation is behind that, if a move is necessary, and without ever exposing that internal representation. and if i happen to move x into a long-term storage area, it will persist there for future reference, without further ado. much more about that idea in the papers i mentioned. or, if you prefer something more recent, have a look at the Clean papers: http://www.st.cs.ru.nl/Onderzoek/Publicaties/publicaties.html a selection of entries related to dynamics and first-class i/o: 1997: 4. Pil, Marco, First Class File I/O 2003: 7. Arjen van Weelden and Rinus Plasmeijer. Towards a Strongly Typed Functional Operating System. 2003: 6. Martijn Vervoort and Rinus Plasmeijer. Lazy Dynamic Input/Output in the lazy functional language Clean 2004: 21. Arjen van Weelden, Rinus Plasmeijer. A Functional Shell that Dynamically Combines Compiled Code. hth, claus ___ 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] Graphical Haskell
On Friday 22 June 2007 11:21:31 Henning Thielemann wrote: On Fri, 22 Jun 2007, peterv wrote: Since nobody gave an answer on this topic, I guess it is insane to do it in Haskell (at least for a newbie)? :) It's certainly an interesting project. Since signal processing is much like functional programming, a graphical Haskell editor could also serve as a nice signal processing graph editor. An existing example of which is CAL's Gem Cutter: http://resources.businessobjects.com/labs/cal/gemcutter-techpaper.pdf titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Re: To yi or not to yi, is this really the question? A plea for a cooperative, ubiquitous, distributed integrated development system.
Thanks for the explanation. But, doesn't this simply mean that the correct signature would be: serialize :: (Int - Int) - IO String to take in account the fact that serialise really use 'external' information that is not in the domain of pure Haskell functions? Having serialize in the IO monad would do no harm as usually one serialise precisely to output a value :-) So, is it correct to conclude that there is no theoretical reason why Haskell cannot have a built-in reification/serialisation facility? titto On Wednesday 20 June 2007 17:05:04 apfelmus wrote: Pasqualino 'Titto' Assini wrote: Is there any fundamental reasons why Haskell functions/closures cannot be serialised? I believe that this is precisely what the distributed version of GHC used to do. Most languages, even Java, have a reflection capability to dynamically inspect an object. It is surprising that Haskell doesn't offer it. Inspecting functions is not referentially transparent. In Haskell, function equality is extensional, i.e. two functions are equal when their results are equal on all arguments. Intensional equality would mean that functions are equal when they have the same representation. If you allow a function serialize :: (Int - Int) - String that can give different results on intensionally different functions, you may not expect equations like f (*3) == f (\n - n+n+n) to hold anymore (because f might inspect its argument). Also, having serialize somehow check whether intensionally different arguments are extensionally the same and should have a unique serialization is no option because this problem is undecidable. Regards, apfelmus ___ 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] Reification in Haskell, was: To yi or not to yi
Hi Bulat, do you mean that as the type information is used only at compilation time and then thrown away there is no way of getting it back at execution time? best, titto On Wednesday 20 June 2007 16:33:12 Bulat Ziganshin wrote: Hello Pasqualino, Wednesday, June 20, 2007, 11:30:32 AM, you wrote: Most languages, even Java, have a reflection capability to dynamically inspect an object. It is surprising that Haskell doesn't offer it. how about asm? :) there are no OOP objects in Haskell, each name is just an address of memory area. all operations are checked statically (at compile time). reflection capabilities may be only handmade - you can get any type info via hidden class dictionary (see http://homepages.inf.ed.ac.uk/wadler/papers/class/class.ps.gz for details of type classes implementation) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Orthogonal Persistence in Haskell
Hi Claus, On Wednesday 20 June 2007 16:41:16 Claus Reinke wrote: with orthogonal persistence, everything a program touches might persist, but usually, programs talk about the data being persistet (?), not about whether that data is currently temporary or in long-term storage. if you want to move such data between processes or storage areas, you move the reference, and the system handles serialisation/ communication/deserialisation behind the scenes. This is interesting, could you elaborate on it? How would you get data to move around by moving its reference? titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell serialisation, was: To yi or not to yi...
Hi Tom, On Thursday 21 June 2007 08:59:42 Tom Schrijvers wrote: On Thu, 21 Jun 2007, Pasqualino 'Titto' Assini wrote: Thanks for the explanation. But, doesn't this simply mean that the correct signature would be: serialize :: (Int - Int) - IO String to take in account the fact that serialise really use 'external' information that is not in the domain of pure Haskell functions? I'm afraid not. The beauty of the IO monad is that it permits equational reasoning over I/O operations. E.g. because of the definition print = putStrLn . show the compiler can freely inline calls to print. Although there's I/O involved, equational reasoning is still valid: the inlined call will behave in the same way as the original code. Hence, the compiler does not have to be aware of IO and treat it in a different way. Your serialize function does not have that property. You don't want its argument to be inlined or otherwise replaced with an equivalent expression. Is it so? I understand that, depending on what the compiler does the result of : do let f = (*) 2 print $ serialise f might differ as, for example, the compiler might have rewritten f as \n - n+n. But, why would that make equational reasoning on serialise not valid? Isn't that true for all functions in the IO monad that, even when invoked with the same arguments, they can produce different results? Am I missing something? titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Haskell serialisation, was: To yi or not to yi...
Hi, On Thursday 21 June 2007 09:27:58 Tomasz Zielonka wrote: I think the reasons are mostly insufficient resources and not enough interest to justify the effort. I think an interesting lesson about this comes from the effort that went into Template Haskell (which, BTW, offers some kind of compile time reflection) - this was probably very hard to design and implement, but my impression is that it's not widely used, despite being cool and useful. I wonder: would it be possible to use the compile time reflection facilities of TH to write a 'serialise' function, keeping the TH AST so that it can be used at run-time? titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Poor man Haskell serialisation using TH, was: Re: [Haskell-cafe] Haskell serialisation
Hi Bulat, I was thinking of something like this (warning: I have never used TH before): {-# OPTIONS -fth #-} module SerialiseTest where import Language.Haskell.TH We have an application whose state is a function Int-Int. We want to be able to serialise this state so that, for example, we might transfer it to a remote location. To do so we preserve both the state and its Template Haskell representation: type State = (Int - Int,ExpQ) This is the initial state: initState :: State initState = (id,[|id|]) The state is modified by composition with the existing state: modifyState (f,e) (nf,ne) = (nf . f , [| $(ne) . $(e) |] ) Some examples of state changing operations: op1 state = modifyState state ((+4),[|(+4)|]) op2 state = modifyState state ((*2),[|(*2)|]) By the way, there must be a way of writing in TH a macro that avoids these repetitions of the same function so that we just write $(ser (*2)) rather then ((*2),[|(*2)|]). main = do Now a little test, we start with our initial state: let st0 = initState Apply a couple of operations: let st1 = op1 st0 let st2 = op2 st1 Let's see what we got: let (f2,e2) = st2 printCode e2 putStrLn . show $ f2 5 where printCode ast = runQ ast = putStrLn . pprint This prints: (GHC.Num.* 2) GHC.Base.. ((GHC.Num.+ 4) GHC.Base.. GHC.Base.id) 18 So, the state is both applicable and serialisable (on the receiving side we should naturally have an interpreter for the TH representation). Not very efficient, but it kind of works :-) Best, titto On Thursday 21 June 2007 13:27:07 Bulat Ziganshin wrote: Hello Pasqualino, Thursday, June 21, 2007, 3:55:35 PM, you wrote: I wonder: would it be possible to use the compile time reflection facilities of TH to write a 'serialise' function, keeping the TH AST so that it can be used at run-time? yes. but you will need to find any functions used in definition - i.e. it should be either fixed set of hard-encoded functions or some sort of dynamic binding a-la hs-plugin ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Poor man Haskell serialisation using TH, was: Re: [Haskell-cafe] Haskell serialisation
Hi Bulat, the receiving side has the option of either interpreting the TH representation or, as you suggested, to just dynamically compile its Haskell source equivalent (as produced by TH's pprint) using GHC API or hs-plugins. Probably not very efficient but quite easy to implement, Best, titto On Thursday 21 June 2007 16:39:58 Bulat Ziganshin wrote: Hello Pasqualino, Thursday, June 21, 2007, 7:35:47 PM, you wrote: So, the state is both applicable and serialisable (on the receiving side we should naturally have an interpreter for the TH representation). and this interpreter should have a way to find function definition by its name - it's the most complex part of job, as i have wrote in previous letter ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Poor man Haskell serialisation using TH, was: Re: [Haskell-cafe] Haskell serialisation
Hi Bulat, On Thursday 21 June 2007 17:29:13 Bulat Ziganshin wrote: how it can interpret call to foo without loading it? :) I am not sure if I understand what you mean. It certainly does load it. Calling hspugins eval (or compiling with GHC API) will cause 'AModule.foo to be loaded and returned (the compiled code will naturally need to import all the modules that are shared by the communicating parties). Or you mean: what if the receiving side does not have 'AModule.foo' in the first place? Well, a shared vocabulary is a pre-requisite for communication anyway. If we didn't share the knowledge of the term 'haskell', how would me and you be able to discuss this subject :-) ? What am I missing? Best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Orthogonal Persistence in Haskell, was: Re: [Haskell-cafe] To yi or not to yi, is this really the question? A plea for a cooperative, ubiquitous, distributed integrated development system.
On Monday 18 June 2007 23:45:23 Claus Reinke wrote: Have you checked the prevayler-inspired approach implemented in HAppS ? no, do you have a reference? but i meant orthogonal persistence, as in all program parts can persist, including functions, thunks, types,.. once you start going down that route, the rigid globally static/dynamic distinction quickly becomes meaningless (instead one has locally static/dynamic phases of evaluating program parts, ie, one does a dynamic type check in each static phase, and if that succeeds, the immediately following dynamic phase will be type correct without further runtime type checks). Prevayler: http://www.prevayler.org/wiki/ HAppS: http://happs.org (look for the MACID monad) Prevayler is an efficient and very simple way of providing application state persistency. Essentially: - all the state is kept in memory, in native language data structures - whenever a write transaction is performed the system automatically serialises a description of the transaction so that it can be replayed later. - occasionally the whole state can be serialised to produce a snapshot - when the system restarts it reads in the last snapshot and replays all transaction since the last snapshot. Is this orthogonal persistence? I guess it would be, if you never took any snapshot. Snapshots are limited by what can be serialised in the language. But transactions might be serialisable even if the state they produce isn't (because, say, includes arbitrary functions). Best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Reification in Haskell, was: To yi or not to yi
Hi everybody, What is the situation with respect to reification of function/thunks in Haskell? Does any current implementation support it ? And, is there any plan for GHC to support it? Claus's comments on this, follow. titto On Monday 18 June 2007 23:45:23 Claus Reinke wrote: Is there any fundamental reasons why Haskell functions/closures cannot be serialised? no, and that is part of the problem: the language would need to be extended, but the academically interesting issues have been tackled, all that is left is a lot of work (that is why these things would be so valuable: complex implementation machinery, controlled by very small language extensions, sometimes even language simplifications, such as lifting existing restrictions on i/o), preferably with very good planning, so that all the work does not become useless right after it is finished. there isn't much hope that this issue is going to be settled via the usual academic funding sources. Most languages, even Java, have a reflection capability to dynamically inspect an object. It is surprising that Haskell doesn't offer it. it has to be done with care, or it will invalidate *all* your nice reasoning about haskell programs. random example reify (f . g) == [| f . g |] =/= [| \x- f (g x) |] == reify (\x- f (g x)) reification is not a referentially transparent program context. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] yi or not to yi was: IDE?
On Sunday 17 June 2007 23:56:51 Claus Reinke wrote: i didn't know that Yi had acquired a tongue-in-cheek mode already!-) at least i hope that's what it was, because the ermacs lesson was not about contributing code or better language, but about sheer size and momentum being in favour of the weaker solution. I think that we should not underestimate the transforming power of dogged determination. Think of Linux: only a terminal idiot could have conceived the plan of writing from scratch a clone of a 20 years old operating system (Unix) when everybody knew that momentum was on the side of the weaker solution (Microsoft) in the PC market and on the many existing commercial Unix versions in the professional market. Well, we all know what that stupid idea has led to. I certainly do, as I am writing this message under Linux. Whenever we act, we do so in a context that determines the value of our actions. However, our actions also create a new context. Linux, in the context in which it was started, was an unequivocaly bad idea. However, its existence has created a new context where it has a real value. So, the idea of writing an Emacs-like system in Haskell might be ill-considered but, as you also notice in the rest of your message, that doesn't make it worthless in a long-term perspective. An even more relevant example might be Eclipse: Eclipse is very much the Java Emacs: a customisable application framework with a zillion extension. Creating it was a major effort but, thanks to that effort, Java has greatly increased its reach and credibility, in particular as a viable solution to write desktop applications. Maybe, just maybe, yi might play a similar role for Haskell. Regards, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] To yi or not to yi, is this really the question? A plea for a cooperative, ubiquitous, distributed integrated development system.
Hi Claus, On Monday 18 June 2007 18:14:58 Claus Reinke wrote: Having just presented a case for the possible rationality of the irrational decision of creating an Emacs-like IDE in Haskell, I wonder if we should not be even more irrational and contemplate the possibility of using Haskell to create a radically different kind of IDE.. New technologies are often used to imitate and reimplement the artefacts of previous technologies. don't underestimate those previous technologies, though. given your you're almost certain to find this interesting: Croquet is a powerful open source software development environment Thanks for the reference. I actually knew about Croquet but I thought of it mostly as an open-source second life because of its emphasys on shared 3D worlds but you are quite right, it might also be useful for cooperative software development. I must admit that my dream doesn't go so far, I was more thinking about Web/Web services kind of technology to integrate distributed traditional development text-based tools (editors, compilers, etc.) plus a configurable Web based UI. if you look closely, you'll see that croquet is implemented in squeak, which in turn is a re-implementation of one of the ancient smalltalks. squeak is by no means the ideal implementation language for this kind of project, nor am i completely convinced by the synchronous approach used for croquet. but while implementation of croquet in squeak is obviously doable, i see various difficulties for doing the same in haskell. where squeak is too dynamic/imperative/flexible, haskell is too static/unreflective/limited (ever tried to pass functions through haskell's i/o interface? Is this really a limitation of the language proper or just of its implementations? Is there any fundamental reasons why Haskell functions/closures cannot be serialised? I believe that this is precisely what the distributed version of GHC used to do. Most languages, even Java, have a reflection capability to dynamically inspect an object. It is surprising that Haskell doesn't offer it. ... persistence [many starts, no finish Have you checked the prevayler-inspired approach implemented in HAppS ? , but see Clean's first class i/o] What advantages does it provide? reflection/meta-programming [Data/Typeable, template haskell..; meta ml?]). one dream would be successors to haskell and croquet so that croquet' could be implemented in haskell''. Is just the lack of reflection in Haskell that you miss? Or there are other things as well? best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] To yi or not to yi, is this really the question? A plea for a cooperative, ubiquitous, distributed integrated development system.
On Monday 18 June 2007 16:13:02 you wrote: I just did a quick read through of your dream and I'm not going to say either way with it. But I would like to point out, just to make sure you've considered it, that my dream--or maybe my reality--involves being able to code without the requirement of a network connection. Bryan That's a very fair point. An ubiquitous IDE should also work when disconnected. Luckily, Web applications can be designed to work offline. In effect, modern AJAX based web apps already execute most of their code on the client side, going back to the server only when absolutely necessary and there are now technologies like Google Gear to efficiently store/access information locally so further reducing dependency on remote services. Best, titto ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
GHC library profiling
Hi, I have a little library that depends on the 'ghc' api library. I would like to build my library in profiling mode but this is not possible as the 'ghc' library itself seems to be distributed only in non-profiling mode. Is there any way out? How can I get or build a profiling version of 'ghc'? An unrelated comment: I guess that the right command to update the darcs version of ghc plus all its related libraries is: sh darcs-all --extra pull Would it be useful to add this info to the ghc README file? Currently it only explains how to get ghc and libs the very first time Thanks in advance for your help, titto ___ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
Re: [GHC] #1210: Unimplemented opcode error while running ZFS
Hi, are you sure that this is the same bug? Bug 1013 appears to have been fixed in GHC 6.6. while this bug is still present in 6.6. Regards, titto On Wednesday 14 March 2007 06:49:13 GHC wrote: #1210: Unimplemented opcode error while running ZFS +-- - Reporter: [EMAIL PROTECTED] | Owner: Type: bug | Status: closed Priority: normal | Milestone: Component: GHCi|Version: 6.6 Severity: normal | Resolution: duplicate Keywords: | Difficulty: Unknown Testcase: | Architecture: x86 Os: Linux | +-- - Changes (by thorkilnaur): * resolution: = duplicate * status: new = closed Comment: Thanks a lot for this report. It seems that this is a duplicate of #1013, so I will take the liberty of closing this ticket. Please feel free to reopen if you still have this problem. ___ Glasgow-haskell-bugs mailing list Glasgow-haskell-bugs@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs
RE: [Haskell-cafe] source code for haskell web server?
There is also the HAppS application server and the HaskellNet library. Would not be possible to merge the protocol-handling parts of all these libraries into a generic Internet Haskell server that could then be expanded to support CGIs, transactions, etc.? Regards, titto -Original Message- From: [EMAIL PROTECTED] [mailto:haskell-cafe- [EMAIL PROTECTED] On Behalf Of Bjorn Bringert Sent: 27 September 2006 12:15 To: Tim Newsham Cc: Henning Thielemann; haskell-cafe Cafe Subject: Re: [Haskell-cafe] source code for haskell web server? On 4 sep 2006, at 20.24, Tim Newsham wrote: Since there are a lot of modifications of HWS around now, it seems to be worthwhile to combine the efforts. E.g. I adapted the HWS adaption provided by WASH http://www.informatik.uni-freiburg.de/~thiemann/WASH/#wsp for my needs. For instance in Request.hs I removed the call to 'Network.URI.unEscapeString' (which is 'deHex' in fptools/HWS/ Request.hs, but 'deHex' is 'id') because that affects interpretation of CGI parameters. I also think that this package needs some cleanup and Cabal. What about a darcs repository at http://darcs.haskell.org/ ? I agree its worthwhile to combine efforts. My only concern is to maintain the code quality. The original HWS was written quite well. The plugins extension I found was not of the same code quality. I haven't looked at the WASH modifications, so I don't know how they compare. I dont know much about using the haskell.org repository, but I'd be happy to contribute to it if there was an HWS repository there... I seem to have duplicated Tim's efforts before I noticed this thread. In order to keep this from happening again, I have put up a darcs repo at http://darcs.haskell.org/hws/ It contains the version from fptools-hws (http://cvs.haskell.org/cgi- bin/cvsweb.cgi/fptools/hws/) with the following modifications: - Use the hierarchical libraries. - Use Data.Map instead of FiniteMap. - Use Parsec from the hierarchical libraries and removed the included old parsec copy. - Removed ifdefs for compatibility with GHC 4.x and 5.x (they wouldn't work with the new imports anyway). - Use IOUArray in Response.squirt - Use Cabal for the build system. It now builds with GHC 6.4.1 and GHC 6.5 (if you add html and regex- compat to the build-depends). If any of you have any other updates, bugfixes etc., you are welcome to add them. Maybe we can even get Simon Marlow to update it with the current state-of-the art in high-performance concurrent Haskell? I'm thinking that we should try to keep this version reasonably close to Simon's original version, or at least its intent, and work on extra features in separate branches. /Björn___ 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] haskell.org down again
From: HostTracker Notifier [mailto:[EMAIL PROTECTED] Sent: 26 September 2006 01:19 To: [EMAIL PROTECTED] Subject: Error Alert Hello, The following url is down: http://haskell.org the error detected is: Http error:Http_client.No_reply Error was detected at 2006-09-26 01:14:41 Your login:titto -- Best regards, http://host-tracker.com/ support team uid:957058 tid:188350 eid:188350-209-0-0-4eee7afa9e44102989dd000c7651f68b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] haskell.org down
Haskell.org has been down for over 7 hours (see attached log). The Web master might use host-tracker.com (or a similar free tracking service) to keep an eye on it. Regards, titto From: HostTracker Notifier [mailto:[EMAIL PROTECTED] Sent: 24 September 2006 10:41 To: [EMAIL PROTECTED] Subject: Operation Restored Alert Hello, http://haskell.org is now back to normal. Operation restored at 2006-09-24 10:36:55. Url was down as a resultat of: Http error:Http_client.No_reply Error was detected at 2006-09-24 03:36:16 Downtime total 7 hour(s) 39 sec(s). Check failures total: 14. Your login:titto -- Best regards, http://host-tracker.com/ support team uid:957058 tid:188350 eid:188350-61-0-0-669df3829d00102989dd000c7651f68b ffeid:188350-47-0-0-a2bced5e9cc5102989dd000c7651f68b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell-cafe] implementing a csv reader
Check first MissingH. I remember that it came with some parsing routines for common text formats. Best, Titto -Original Message- From: [EMAIL PROTECTED] [mailto:haskell-cafe- [EMAIL PROTECTED] On Behalf Of Tamas K Papp Sent: 22 August 2006 10:20 To: Haskell Cafe Subject: [Haskell-cafe] implementing a csv reader Hi, Now that I have read the tutorials, I think that the best way to learn Haskell would be to use the language and write something simple yet useful. I noticed that Haskell lacks a module for reading/writing csv (comma separated value) files, so I thought I could implement that. Questions: 1. Please tell me if you know of a csv module, because then I would do something else. 2. I am looking for a parser, but I don't know Haskell parsers. Is Parsec a good choice? Thanks, Tamas ___ 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] HTTPS in Haskell
Hi Adam, I believe that this is simply to detect that the WASH CGI script is being invoked using HTTPS while running into a Web server (say Apache) that supports it. titto -Original Message- From: [EMAIL PROTECTED] [mailto:haskell-cafe- [EMAIL PROTECTED] On Behalf Of Adam Peacock Sent: 19 August 2006 02:34 To: Haskell-Cafe@haskell.org Subject: Re: [Haskell-cafe] HTTPS in Haskell On 8/18/06, Pasqualino 'Titto' Assini [EMAIL PROTECTED] wrote: Is there any implementation of HTTPS/SSL in Haskell? This would seem to be critical to develop commercial web applications. WASH has a run time function ( runWithOptions ) that has type: runWithOptions :: CGIOptions - CGI () - IO () with... type CGIOptions = [CGIOption] data CGIOption = AutoHttps -- autodetect Https by checking for port number 443 and env var HTTPS ... Taken from: http://www.informatik.uni-freiburg.de/~thiemann/WASH/doc/WASH-CGI-CGI.html Adam. ___ 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] HTTPS in Haskell
Hello, Is there any implementation of HTTPS/SSL in Haskell? This would seem to be critical to develop commercial web applications. Thanks, Titto assini ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
RE: [Haskell] AJAX applications in Haskell
Hi, I have added a page to the Haskell Wiki (http://www.haskell.org/haskellwiki/Hajax) to summarise the key features of a possible tool to develop Ajax applications. Please modify/extend as appropriate. Regards, Titto assini ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
[Haskell-cafe] RE: [Haskell] AJAX applications in Haskell
Hi, I have added a page to the Haskell Wiki (http://www.haskell.org/haskellwiki/Hajax) to summarise the key features of a possible tool to develop Ajax applications. Please modify/extend as appropriate. Regards, Titto assini ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell] AJAX applications in Haskell
Hi, Those among you who have an interest in AJAX-style web development - that is to say the development of web applications that run entirely into the browser environment, calling back to the server back-end only to get raw data -- will probably have noticed the recent appearance of the Google Web Toolkit (http://code.google.com/webtoolkit). The main idea behind it is very simple: you write your Ajax application in Java and your code is compiled down to JavaScript/HTML (rather then to Java Virtual Machine bytecode) so that it can be executed in any browser. The main advantages of this solution are: - Development using a typed language with good compile-time checks and debugger support - No plugins (e.g. a Java VM) required on the user machine The disadvantages are: - An additional compilation step - Probably, a significant loss of performance with respect to hand-written code Assuming that the balance is positive, this naturally raises the question: why not doing the same with our favourite language? This would require to: - Retarget one of the existing Haskell compilers to generate JavaScript (other possible targets would be Flash or higher level UI languages such as OpenLaszlo that in turn compiles down to either Flash or JavaScript/HTML) - Write a suitable runtime library (including support for native JavaScript or Flash UI components, remote method invocations, multi-threading, etc.) - Port a usable subset of the Haskell Libraries - Select an approach to write user interfaces in Haskell. There have been many attempts in this direction but I am unsure if any of them has proven particularly successful. All considered, quite a significant amount of work -- that would require a concerted group effort -- with a rather uncertain pay-off. Is anyone working on anything similar or that might be interested in such a project? And has anyone any thoughts to offer on what compilers/libraries/UI frameworks would be more suitable for the task? Regards, titto assini ___ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell