Re: [Haskell-cafe] building hslogger error windows
On 24 January 2011 02:02, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: You can try with hslogger-1.1.0, which built on 6.12 and 7.0 on hackage, or maybe with hslogger-1.1.2 (which hasn't yet been built on hackage since it was uploaded only yesterday). hslogger-1.1.1 had the same build failure on hackage. Isn't the problem that the cabal file for hslogger doesn't state a dependency on filepath? (even though filepath is a GHC boot lib its not in base). I'd expect the problem could be solved by downloading the hslogger archive, editing the cabal file and installing manually. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Delivery to haskell-platf...@projects.haskell.org
Erik de Castro Lopo wrote: ...my mail server is rejecting the message coming back to me... Nun.haskell.org really should have a reverse DNS entry Ah, that is probably a casualty of the recent upgrade of the haskell.org server. As part of that process, control of the domain was moved from Yale to the community. I think someone at Galois is admin for the domain now, I'll see if I can get them to put the reverse DNS back in. I'm also creating a support ticket for community.haskell.org and taking the liberty of making you the requestor. Regards, Yitz ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building hslogger error windows
On Monday 24 January 2011 09:19:53, Stephen Tetley wrote: On 24 January 2011 02:02, Daniel Fischer daniel.is.fisc...@googlemail.com wrote: You can try with hslogger-1.1.0, which built on 6.12 and 7.0 on hackage, or maybe with hslogger-1.1.2 (which hasn't yet been built on hackage since it was uploaded only yesterday). hslogger-1.1.1 had the same build failure on hackage. Isn't the problem that the cabal file for hslogger doesn't state a dependency on filepath? (even though filepath is a GHC boot lib its not in base). I'd expect the problem could be solved by downloading the hslogger archive, editing the cabal file and installing manually. So do I, but I somehow felt that shouldn't be the first advice to give. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] The F# Team are Hiring
Dear Haskell'ers The F# team in Seattle/Redmond have an opening for a Senior Program Managerhttps://careers.microsoft.com/JobDetails.aspx?ss=pg=0so=rw=1jid=33994jlang=EN. A demonstrated love for applied Haskell/OCaml/F# programming would be highly regarded background experience :) We also have positions open for software development engineers specializing in compilers and tools (see https://careers.microsoft.com/JobDetails.aspx?ss=pg=0so=rw=3jid=34078jlang=EN) Kind regards best wishes, Don Syme The F# Team are Hiring!!! * Do you have a love for modern, industry-leading programming technologies? * Can you help us take the F# language to the next level? * Do you have the vision to combine functional programming with technologies for data, cloud, web, finance and technical computing? * Do you have a passion for delivering great visual tools and a simple, clear end-to-end experience for F# programmers? * And do you want to work on a talented agile team that releases compiler sources on codeplex.com and has originated major innovations for C# and Visual Basic? If so, we have a great opportunity for you! The Visual Studio Pro team is looking for an experienced Program Manager to drive the F# area. Partnering with your engineering team in Redmond and Microsoft Research in Cambridge, you will define the F# developer experience for Visual Studio and out of band releases such as the F# PowerPack. As a strong customer advocate, you will drive changes into the F# language, libraries and tools. You will develop and update community programs that drive increased awareness and adoption of F#. Being responsible for delivering integrated solutions, you have experience in building strong cross-group partnerships, ensuring alignment of schedules and business goals, and the natural skill of getting things done. Specific responsibilities include: * Travelling to major conferences, user group meetings, and enterprises to get people excited about solving problems using F# * Defining the strategy for marketing F# to the developer community * Owning our content strategy and community engagement programs * Driving multiple concurrent projects for the F# team including Visual Studio and out of band releases * Working closely with groups within Microsoft such as Technical Computing, .NET Framework, SQL and Azure to deliver great experiences for F# developers * Contributing to the design of all aspects of F# from language libraries to the tools that integrate with Visual Studio Basic Qualifications: * 3-5 years experience in Program Management or related experience, including a proven track record of delivering on challenging projects * A BS or equivalent degree in Computer Science, Electrical Engineering, or a related field. * Passionate for language and user experience design * Knowledge of Visual Studio, .NET functional programming languages, and the ability to dig deep into technical challenges * Strong sense of teamwork, personal integrity, responsibility and accountability * Excellent verbal and written communication skills * Strong customer advocate, self-starter and problem solver * Strong knowledge of F# or language design on managed platforms is preferred If you'd would like more details, please either contact me (ds...@microsoft.commailto:ds...@microsoft.com), or Sean Laberee (sea...@microsoft.commailto:sea...@microsoft.com) directly. To apply immediately, please fill in the online formshttps://careers.microsoft.com/JobDetails.aspx?ss=pg=0so=rw=1jid=33994jlang=EN and drop us a note that you're applying. https://careers.microsoft.com/JobDetails.aspx?ss=pg=0so=rw=1jid=33994jlang=EN don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Installing a top-level handler on an existing thread
I've been toying with a little thread manager library, and for sanity's sake I really need a way to install another top-level exception handler on an existing thread.I don't want to replace any other handlers, just put my own handler around the thread's continuation. Of course, it would be pretty easy to do if the IO monad had a nice efficient implementation of call/cc and call/cc1, although I don't need the full power of continuations. I really don't want to create my own Thread monad (which could use ContT), I want to be able to do it on plain old IO threads. Is there any way to do this in GHC? Best, Leon ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Tracing applied functions
Is there anyway to get a list of applied functions in the running of a Haskell program ? Many thanks in advance, Aaron ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Cmdargs and common flags
I'm looking for a good way of dealing with common flags in cmdargs. Currently what I do requires a bit of repetition that I'd really like to get rid of: 1. Data types data Modes = Cmd1 { foo :: String, ... } | Cmd2 { foo :: String, ... } 2. Mode specifications cmd1 = Cmd1 { foo = def = help .., ...} cmd2 = Cmd2 { foo = def = help .., ...} I have no idea how to deal with the repetition in the data types, so all suggestions are welcome. For the repetition in the mode specifications I attempted to factor the common bits into a variable: flagFoo = = help .. but that resulted in only the first command getting the proper specification. I suppose this comes down to the impurity, but how do I work around that? (Especially, are there any good examples of using the pure part of the API?) /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: mag...@therning.org jabber: mag...@therning.org twitter: magthe http://therning.org/magnus ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cmdargs and common flags
Magnus, I used the following technique, but it was a couple of iterations of CmdArgs ago: data UIMode = Normal | Batch | Query deriving (Data,Typeable,Show,Eq) uimode_arg :: forall t. t - UIMode uimode_arg _ = enum Normal [ Batch = flag B text batch mode (no interaction) group grp , Query = flag Q text query mode (user verification solicited) group grp ] where grp = Operating Mode data Globalargs = CMD1 { ... , uimode :: UIMode , ... } | CMD2 { ... , uimode :: UIMode , ... } cmd1mode :: Mode Globalargs cmd1mode = mode $ CMD1 { ... , uimode = uimode_arg cmd1 } = text (usage ...) cmd2mode :: Mode Globalargs cmd2mode = mode $ CMD1 { ... , uimode = uimode_arg cmd2 } = text (usage ...) modes :: [ Mode Globalargs ] modes = [ cmd1mode, cmd2mode ] main = do cmdArgs progSummary modes ... I've cut and pasted from my usage and perhaps pasted too little, so let me know if the above is unuseably brief. And again, cmdargs has changed somewhat since this code was written and I haven't tried a recent compilation. -KQ P.S. This often required {-# OPTIONS_GHC -fno-full-laziness -fno-strictness #-} because GHC (6.12? 6.10?) would complain about my uimode_arg type otherwise. On Thu, 20 Jan 2011 01:48:35 -0700, Magnus Therning mag...@therning.org wrote: I'm looking for a good way of dealing with common flags in cmdargs. Currently what I do requires a bit of repetition that I'd really like to get rid of: 1. Data types data Modes = Cmd1 { foo :: String, ... } | Cmd2 { foo :: String, ... } 2. Mode specifications cmd1 = Cmd1 { foo = def = help .., ...} cmd2 = Cmd2 { foo = def = help .., ...} I have no idea how to deal with the repetition in the data types, so all suggestions are welcome. For the repetition in the mode specifications I attempted to factor the common bits into a variable: flagFoo = = help .. but that resulted in only the first command getting the proper specification. I suppose this comes down to the impurity, but how do I work around that? (Especially, are there any good examples of using the pure part of the API?) /M -- -KQ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Cmdargs and common flags
Hi Magnus, What you want is actually easier than you think! To quote from http://hackage.haskell.org/packages/archive/cmdargs/0.6.7/doc/html/System-Console-CmdArgs-Implicit.html: Missing Fields: If a field is shared by multiple modes, it may be omitted in subsequent modes, and will default to the previous value. Therefore you can just do: cmd1 = Cmd1 { foo = def = help .., ...} cmd2 = Cmd2 { ...} -- never mention foo in Cmd2 cmdArgs [cmd1,cmd2] And foo in Cmd2 will act exactly like you duplicated the definition from foo in Cmd1. I use this feature regularly - it's a big time saver. Alternatively, you can use the tricks described by Kevin. Finally, you can switch to the pure annotations. I will document them shortly and give an example in System.Console.CmdArgs.Implicit, but for now the details can be found at http://hackage.haskell.org/packages/archive/cmdargs/0.6.7/doc/html/System-Console-CmdArgs-Annotate.html To translate your cmd1/cmd2: cmd1 = record Cmd1{} [foo := def += help .., ...] cmd2 = record Cmd2{} [foo := def += help .., ...] And then call cmdArgs_ instead. Now you can do anything that equational reasoning supports without any danger: cmd1 = record Cmd1{} [myfoo, ...] cmd2 = record Cmd2{} [myfoo, ...] myfoo = foo := def += help .. Even when using the pure annotations, you can still use missing fields: cmd1 = record Cmd1{} [foo := def += help .., ...] cmd2 = record Cmd2{} [...] Thanks, Neil On Mon, Jan 24, 2011 at 8:50 PM, Kevin Quick qu...@sparq.org wrote: Magnus, I used the following technique, but it was a couple of iterations of CmdArgs ago: data UIMode = Normal | Batch | Query deriving (Data,Typeable,Show,Eq) uimode_arg :: forall t. t - UIMode uimode_arg _ = enum Normal [ Batch = flag B text batch mode (no interaction) group grp , Query = flag Q text query mode (user verification solicited) group grp ] where grp = Operating Mode data Globalargs = CMD1 { ... , uimode :: UIMode , ... } | CMD2 { ... , uimode :: UIMode , ... } cmd1mode :: Mode Globalargs cmd1mode = mode $ CMD1 { ... , uimode = uimode_arg cmd1 } = text (usage ...) cmd2mode :: Mode Globalargs cmd2mode = mode $ CMD1 { ... , uimode = uimode_arg cmd2 } = text (usage ...) modes :: [ Mode Globalargs ] modes = [ cmd1mode, cmd2mode ] main = do cmdArgs progSummary modes ... I've cut and pasted from my usage and perhaps pasted too little, so let me know if the above is unuseably brief. And again, cmdargs has changed somewhat since this code was written and I haven't tried a recent compilation. -KQ P.S. This often required {-# OPTIONS_GHC -fno-full-laziness -fno-strictness #-} because GHC (6.12? 6.10?) would complain about my uimode_arg type otherwise. On Thu, 20 Jan 2011 01:48:35 -0700, Magnus Therning mag...@therning.org wrote: I'm looking for a good way of dealing with common flags in cmdargs. Currently what I do requires a bit of repetition that I'd really like to get rid of: 1. Data types data Modes = Cmd1 { foo :: String, ... } | Cmd2 { foo :: String, ... } 2. Mode specifications cmd1 = Cmd1 { foo = def = help .., ...} cmd2 = Cmd2 { foo = def = help .., ...} I have no idea how to deal with the repetition in the data types, so all suggestions are welcome. For the repetition in the mode specifications I attempted to factor the common bits into a variable: flagFoo = = help .. but that resulted in only the first command getting the proper specification. I suppose this comes down to the impurity, but how do I work around that? (Especially, are there any good examples of using the pure part of the API?) /M -- -KQ ___ 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] Tracing applied functions
On 25 January 2011 02:55, Aaron Gray aaronngray.li...@gmail.com wrote: Is there anyway to get a list of applied functions in the running of a Haskell program ? Profile it? -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Chicago Haskell User Group Meetup this Thursday @ 8PM
Hello, The Chicago Haskell User Group will be meeting at the Pumping Station One hackerspace this Thursday @ 8PM. This meeting coincides with a regularly scheduled Haskell class at PS:One. Among other things, we will discuss how to grow the local Chicago Haskell user community, and a possible group project. Haskell users of all levels (including no experience at all) are invited to come! Facebook Invite: http://www.facebook.com/event.php?eid=158855480832147 Pumping Station One website: http://pumpingstationone.org/ Chicago Haskell User Group Facebook Group: http://www.facebook.com/pages/Chicago-Haskell-User-Group/115989593098 Chicago Haskell User Group Mailing List: http://groups.google.com/group/haskell-chicago - jeremy ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Tracing applied functions
On 24 January 2011 23:01, Ivan Lazar Miljenovic ivan.miljeno...@gmail.comwrote: On 25 January 2011 02:55, Aaron Gray aaronngray.li...@gmail.com wrote: Is there anyway to get a list of applied functions in the running of a Haskell program ? Profile it? Okay, How do I do that ? Aaron ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Tracing applied functions
On 25 January 2011 12:05, Aaron Gray aaronngray.li...@gmail.com wrote: On 24 January 2011 23:01, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 25 January 2011 02:55, Aaron Gray aaronngray.li...@gmail.com wrote: Is there anyway to get a list of applied functions in the running of a Haskell program ? Profile it? Okay, How do I do that ? http://www.haskell.org/haskellwiki/How_to_profile_a_Haskell_program http://book.realworldhaskell.org/read/profiling-and-optimization.html -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Tracing applied functions
On 25 January 2011 02:12, Ivan Lazar Miljenovic ivan.miljeno...@gmail.comwrote: On 25 January 2011 12:05, Aaron Gray aaronngray.li...@gmail.com wrote: On 24 January 2011 23:01, Ivan Lazar Miljenovic ivan.miljeno...@gmail.com wrote: On 25 January 2011 02:55, Aaron Gray aaronngray.li...@gmail.com wrote Is there anyway to get a list of applied functions in the running of a Haskell program ? Profile it? Okay, How do I do that ? http://www.haskell.org/haskellwiki/How_to_profile_a_Haskell_program http://book.realworldhaskell.org/read/profiling-and-optimization.html Thanks I will have a look at those in the morning. Aaron -- Ivan Lazar Miljenovic ivan.miljeno...@gmail.com IvanMiljenovic.wordpress.com ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Proposal: Applicative = Monad: Call for consensus
On Fri, Jan 21, 2011 at 7:58 PM, Casey Hawthorne cas...@istar.ca wrote: uj supplied this: About the discussion putStrLn (readLn + (5 :: Int)).. I'll write it as the following line, importing Control.Applicative main = (+) readLn (return 3) They look almost exactly same in my eyes.. You're missing some bits. main = print = liftM2 (+) readLn (return 3) Which I assert looks like more line noise than some perl programs I've read. :) Now, you *can* get away with simplifying this to main = print = (readLn :: IO Int) + 3 assuming instance Num a = Num (IO a), which sort-of works (show instance and pattern matching are both quite broken; given the naive implementation of fib, fib readLn will give you quite a surprising result!) But I think this case proves the point quite well: it's a special case where Num turns out to be very friendly. Why can't the whole language be that friendly? -- ryan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] web-routes and forms
Hello, I think you should just be able to use showURL to convert the url type into a String that you can use with blaze-html: data SiteURL = Post_Login | etc loginForm :: RoutedNomicServer Html loginForm = do actionURL - showURL Post_Login ok $ H.form ! A.method POST ! A.action actionURL ! enctype multipart/form-data;charset=UTF-8 $ do H.label ! for login $ Login input ! type_ text ! name login ! A.id login ! tabindex 1 ! accesskey L H.label ! for password $ Password input ! type_ text ! name password ! A.id password ! tabindex 2 ! accesskey P input ! type_ submit ! tabindex 3 ! accesskey S ! value Enter Nomic! Using the HSP stuff you can avoid the explicit call to showURL and do: form method=Post_Login enctype=multipart/form-data;charset=utf-8 ... /form But HSP is a fair bit more complex than blaze-html. If blaze-html provide an HtmlT monad that was a real monad transformer then you could do something similar using blaze. But they decided to trade-off functionality for speed. - jeremy On Sat, Jan 22, 2011 at 3:19 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello Jeremy, Yes it would be fine to use solution 1, but I just don't figured how to mix web routes and forms. My forms are like that: loginForm :: RoutedNomicServer Html loginForm = do ok $ H.form ! A.method POST ! A.action /postLogin ! enctype multipart/form-data;charset=UTF-8 $ do H.label ! for login $ Login input ! type_ text ! name login ! A.id login ! tabindex 1 ! accesskey L H.label ! for password $ Password input ! type_ text ! name password ! A.id password ! tabindex 2 ! accesskey P input ! type_ submit ! tabindex 3 ! accesskey S ! value Enter Nomic! And are decoded using a FromData: instance FromData LoginPass where fromData = do login - look login `mplus` (error need login) password - look password `mplus` (error need password) return $ LoginPass login password How this can go inside web routes? I cannot pass the parameters in the URL (here login and password), can I? Thanks, Corentin On Sat, Jan 22, 2011 at 9:49 PM, Jeremy Shaw jer...@n-heptane.com wrote: Hello, I believe you problem is because you are trying to use 'dir' inside RouteT after you have already consumed and decode the path info using implSite. There are two solutions here: 1. just use web-routes for all your URLs instead of using a mixture of type-safe routes and 'dir'. 2. put the calls to dir outside the call to implSite. For example, something like, simpleHTTP nullConf $ msum [ dir Login $ loginPage, , dir postLogin $ postLogin , implSite http://localhost:8000/; (nomicSite sh) ] You to do that, you would also need to modified loginPage and postLogin to not be in the RoutedNomicServer monad. Since they do not appear to use the RouteT stuff anyway, that should not be hard ? But, personally, I would just choose option #1. Can you explain why you thought it was better to mix the web-routes stuff with the 'dir' style guards? Maybe there is a short coming in web-routes that needs to be addressed ? - jeremy On Fri, Jan 21, 2011 at 2:33 PM, Corentin Dupont corentin.dup...@gmail.com wrote: Hello Jeremy, I'm still trying to integrate web routes, but there is one thing I don't understand: how to deal with multiple forms? In my former application, each forms used to redirect to a subdirectory of the web site, and an appropriate handler was waiting there. But now with web routes I don't see how to do that. I've tried to push down the decision over subdirectories (with the guard dir) inside the RouteT monad: type NomicServer = ServerPartT IO type RoutedNomicServer = RouteT PlayerCommand NomicServer nomicSite :: ServerHandle - Site PlayerCommand (NomicServer Html) nomicSite sh = setDefault (Noop 0) Site { handleSite = \f url - unRouteT (routedNomicHandle sh url) f , formatPathSegments = \u - (toPathSegments u, []) , parsePathSegments = parseSegments fromPathSegments } routedNomicHandle :: ServerHandle - PlayerCommand - RoutedNomicServer Html routedNomicHandle sh pc = do d - liftRouteT $ liftIO getDataDir msum [dir Login $ loginPage, dir postLogin $ postLogin, --nullDir fileServe [] d, dir NewRule $ newRule sh, dir NewGame $ newGameWeb sh, dir Nomic $ routedNomicCommands sh pc] routedNomicCommands :: ServerHandle - PlayerCommand - RoutedNomicServer Html routedNomicCommands sh (Noop pn) = nomicPageComm pn sh (return ()) routedNomicCommands sh (JoinGame pn game) = nomicPageComm pn sh (joinGame game pn) routedNomicCommands sh (LeaveGame pn) = nomicPageComm pn sh
[Haskell-cafe] getDirectoryContents and sort order
I have noticed that on my windows box and ghc 6.12.3 I get the return list for System.Direcotry.getDirectoryContents in reverse sorted order. This is a change from previous observed behavior and I would consider it a bug. I would like to verify that it is not just me. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Proposal: Applicative = Monad: Call for consensus
On Tue, Jan 25, 2011 at 05:13, Ryan Ingram ryani.s...@gmail.com wrote: On Fri, Jan 21, 2011 at 7:58 PM, Casey Hawthorne cas...@istar.ca wrote: uj supplied this: About the discussion putStrLn (readLn + (5 :: Int)).. I'll write it as the following line, importing Control.Applicative main = (+) readLn (return 3) They look almost exactly same in my eyes.. You're missing some bits. main = print = liftM2 (+) readLn (return 3) Which I assert looks like more line noise than some perl programs I've read. :) Why not just: main = print . (+3) = readLn This reads almost as well as a function composition f . g . h, I think. Erik P.S. I wanted to say you could also write it left-to-right using from Control.Arrow, but that need parentheses: main = readLn = ((+3) print) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe