From abdulwahidc at gmail.com Fri Nov 1 00:07:40 2013 From: abdulwahidc at gmail.com (Badi' Abdul-Wahid) Date: Thu, 31 Oct 2013 20:07:40 -0400 Subject: [Haskell-cafe] cabal-install sandbox with happy and alex In-Reply-To: References: <20131031101820.b0cb1f54b73331f5c79f3a4d@mega-nerd.com> Message-ID: Hi Brandon, thanks for the suggestion. Unfortunately, it didn't do the trick: [0 :)] badi at olorin /private/tmp/sb ~> export PATH=/tmp/sb/.cabal-sandbox/bin:$PATH [0 :)] badi at olorin /tmp/sb ~> cabal install happy alex Resolving dependencies... Notice: installing into a sandbox located at /private/tmp/sb/.cabal-sandbox Configuring alex-3.1.0... Configuring happy-1.19.0... Building alex-3.1.0... Building happy-1.19.0... Failed to install happy-1.19.0 Last 10 lines of the build log ( /private/tmp/sb/.cabal-sandbox/logs/happy-1.19.0.log ): Building happy-1.19.0... Preprocessing executable 'happy' for happy-1.19.0... setup: The program happy is required but it could not be found Failed to install alex-3.1.0 Last 10 lines of the build log ( /private/tmp/sb/.cabal-sandbox/logs/alex-3.1.0.log ): Building alex-3.1.0... Preprocessing executable 'alex' for alex-3.1.0... setup: The program happy is required but it could not be found cabal: Error: some packages failed to install: alex-3.1.0 failed during the building phase. The exception was: ExitFailure 1 happy-1.19.0 failed during the building phase. The exception was: ExitFailure 1 On Thu, Oct 31, 2013 at 7:34 PM, Brandon Allbery wrote: > On Thu, Oct 31, 2013 at 1:18 PM, Erik de Castro Lopo > wrote: > >> Badi' Abdul-Wahid wrote: >> >> > I've run into difficulty building happy and alex using the sandbox >> feature >> > of cabal-install 1.18.0.2. >> > Installation of dependencies succeeds but both happy and alex fail with: >> > >> > setup: The program happy is required but it could not be found >> > >> > My workaround is to use the --only-dependencies flag, install the >> > dependencies, and manually install the packages. >> >> I've run into this problem myself on Linux. My solution is to install >> ghc, happy, alex, hlint and cabal-install from debian packages and >> everything else using cabal install (either with or without using >> sandboxes). >> > > At a guess, both of you need to find the bin directory created *in the > sandbox* and add it to $PATH while working in the sandbox. Perhaps there is > some better way for cabal sandboxes to handle this automatically. > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Badi' Abdul-Wahid -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpmoresmau at gmail.com Fri Nov 1 08:46:59 2013 From: jpmoresmau at gmail.com (JP Moresmau) Date: Fri, 1 Nov 2013 09:46:59 +0100 Subject: [Haskell-cafe] SYB: queries using IO Monad Message-ID: Hello cafe, I have code that works well using the syb package, and the ext1Q, extQ and gmapQ functions. This code that a Data and transforms it into something else. However I need to make a change, and this change involves calling a function in the IO monad (the function is from another library so I have no choice). However, the ext1Q, extQ and gmapQ functions have no monadic equivalent. There seems to be monadic transformation (from a to different a) but no monadic queries (from a to b). Do I have to rewrite these functions myself to work with monadic queries (it at all possible) or is there a better way? I've seen some functions that work with monads and MonadPlus, but I don't see anything that would work with IO. So far I've checked that the IO() function I'm calling does the job by using unsafePerformIO, but I know that's a sin and I'd like to find a better way! Thanks! JP -- JP Moresmau http://jpmoresmau.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From andres at well-typed.com Fri Nov 1 09:00:05 2013 From: andres at well-typed.com (=?ISO-8859-1?Q?Andres_L=F6h?=) Date: Fri, 1 Nov 2013 10:00:05 +0100 Subject: [Haskell-cafe] SYB: queries using IO Monad In-Reply-To: References: Message-ID: Hi. > However, the ext1Q, extQ and gmapQ functions have no monadic equivalent. > There seems to be monadic transformation (from a to different a) but no > monadic queries (from a to b). > Do I have to rewrite these functions myself to work with monadic queries (it > at all possible) or is there a better way? I've seen some functions that > work with monads and MonadPlus, but I don't see anything that would work > with IO. I think the idea is that the Q functions don't need a monadic counterpart because they can already be used at a monadic result type. Cheers, Andres -- Andres L?h, Haskell Consultant Well-Typed LLP, http://www.well-typed.com From jpmoresmau at gmail.com Fri Nov 1 10:07:28 2013 From: jpmoresmau at gmail.com (JP Moresmau) Date: Fri, 1 Nov 2013 11:07:28 +0100 Subject: [Haskell-cafe] SYB: queries using IO Monad In-Reply-To: References: Message-ID: You're perfectly right Andres. ext1Q and extQ work well with monadic result type. I can't get gmapQ to work though, but I seem to in fact not need it, so I've removed its usage totally. Thanks a million! JP On Fri, Nov 1, 2013 at 10:00 AM, Andres L?h wrote: > Hi. > > > However, the ext1Q, extQ and gmapQ functions have no monadic equivalent. > > There seems to be monadic transformation (from a to different a) but no > > monadic queries (from a to b). > > Do I have to rewrite these functions myself to work with monadic queries > (it > > at all possible) or is there a better way? I've seen some functions that > > work with monads and MonadPlus, but I don't see anything that would work > > with IO. > > I think the idea is that the Q functions don't need a monadic > counterpart because they can already be used at a monadic result type. > > Cheers, > Andres > > -- > Andres L?h, Haskell Consultant > Well-Typed LLP, http://www.well-typed.com > -- JP Moresmau http://jpmoresmau.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpmoresmau at gmail.com Fri Nov 1 10:59:53 2013 From: jpmoresmau at gmail.com (JP Moresmau) Date: Fri, 1 Nov 2013 11:59:53 +0100 Subject: [Haskell-cafe] SYB: queries using IO Monad In-Reply-To: References: Message-ID: Well, I'm stupid, I only need to combine sequence with gmapQ and it works! Thanks Andres! JP On Fri, Nov 1, 2013 at 11:07 AM, JP Moresmau wrote: > You're perfectly right Andres. ext1Q and extQ work well with monadic > result type. I can't get gmapQ to work though, but I seem to in fact not > need it, so I've removed its usage totally. > > Thanks a million! > > JP > > > On Fri, Nov 1, 2013 at 10:00 AM, Andres L?h wrote: > >> Hi. >> >> > However, the ext1Q, extQ and gmapQ functions have no monadic equivalent. >> > There seems to be monadic transformation (from a to different a) but no >> > monadic queries (from a to b). >> > Do I have to rewrite these functions myself to work with monadic >> queries (it >> > at all possible) or is there a better way? I've seen some functions that >> > work with monads and MonadPlus, but I don't see anything that would work >> > with IO. >> >> I think the idea is that the Q functions don't need a monadic >> counterpart because they can already be used at a monadic result type. >> >> Cheers, >> Andres >> >> -- >> Andres L?h, Haskell Consultant >> Well-Typed LLP, http://www.well-typed.com >> > > > > -- > JP Moresmau > http://jpmoresmau.blogspot.com/ > -- JP Moresmau http://jpmoresmau.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From guthrie at mum.edu Fri Nov 1 13:30:17 2013 From: guthrie at mum.edu (Gregory Guthrie) Date: Fri, 1 Nov 2013 08:30:17 -0500 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) Message-ID: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> "I *strongly* suggest everyone start transitioning from cabal-dev to cabal sandboxes." Is there any reason that this is not just the default install mode for Cabal? Anything that prevents the current cabal-swamp of broken dependencies is a great help. I have tried to use Haskell in some classes, but it is hard when students (and I) cannot install packages, and the only answer is the Microsoft-like; "delete everything and start over; reinstall". It certainly reduces their confidence that Haskell is a feasible working environment. From johan.tibell at gmail.com Fri Nov 1 14:14:50 2013 From: johan.tibell at gmail.com (Johan Tibell) Date: Fri, 1 Nov 2013 15:14:50 +0100 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: Personally I'd like for it to be the default, but I don't if everyone agrees. If we make it the default, people who wanted a "global" install would have to use `cabal install --user`. On Fri, Nov 1, 2013 at 2:30 PM, Gregory Guthrie wrote: > "I *strongly* suggest everyone start transitioning from cabal-dev to > cabal sandboxes." > > Is there any reason that this is not just the default install mode for > Cabal? > > Anything that prevents the current cabal-swamp of broken dependencies is a > great help. I have tried to use Haskell in some classes, but it is hard > when students (and I) cannot install packages, and the only answer is the > Microsoft-like; "delete everything and start over; reinstall". It certainly > reduces their confidence that Haskell is a feasible working environment. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at bergmark.nl Fri Nov 1 15:57:56 2013 From: adam at bergmark.nl (Adam Bergmark) Date: Fri, 1 Nov 2013 16:57:56 +0100 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev In-Reply-To: References: Message-ID: For small projects (few packages) cabal sandboxes are great, otherwise I still use cabal-dev. The bugs Erik mentioned and a few other annoyances (I can't find the tickets at the moment) makes cabal-dev a lot faster to work with for big projects. But these are all accepted issues so once they go away I'll make the full switch. - Adam On Thu, Oct 31, 2013 at 5:35 PM, Rogan Creswick wrote: > On Wed, Oct 30, 2013 at 2:05 AM, Johan Tibell wrote: > >> (Note: I'm one of the developers/designers of cabal sandboxes.) >> > > ...and I'm one of the developers / maintainers of cabal-dev :) > > I'll echo Johan's comments -- cabal sandboxes have the level of > integration with cabal that cabal-dev could only aspire to; and as such, > cabal sandboxes can do it *right* :) (add-source and cabal repl are two > great examples of this already). > > Cabal-dev is also not likely to be maintained very much longer, since > cabal sandboxes solve the problem that cabal-dev addressed. I like to > think that cabal-dev, capri, and other similar haskell sandboxing tools > demonstrated that the concept was sound and useful, but cabal sandbox has > taken the idea and refined it to be properly integrated and much more > reliable. > > tl/dr; I *strongly* suggest everyone start transitioning from cabal-dev to > cabal sandboxes. > > --Rogan > > >> >> Cabal sandboxes were developed after cabal-dev and was generally an >> effort to bring sandboxes to the masses by integrating them into cabal >> proper. There are a couple of benefits to this integration: >> >> * New features are designed with sandboxes in mind. >> * We can generally get a smoother integration with rest of Cabal. >> * We support add-source deps as links rather than copies (see the docs). >> >> >> >> On Wed, Oct 30, 2013 at 10:01 AM, Graham Berks wrote: >> >>> Can someone point me in the direction of why you would use one over the >>> other ?? >>> >>> Thanks >>> Graham >>> >>> >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guthrie at mum.edu Fri Nov 1 17:37:05 2013 From: guthrie at mum.edu (Gregory Guthrie) Date: Fri, 1 Nov 2013 12:37:05 -0500 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A36@MAIL.cs.mum.edu> Is it accurate to say that for a single user system, one could just alias cabal to use default mode of sandbox, and transparently ti would just work the same, but avoid cabal library conflicts? ------------------------------------------------------- Personally I'd like for it to be the default, but I don't if everyone agrees. If we make it the default, people who wanted a "global" install would have to use `cabal install --user`. On Fri, Nov 1, 2013 at 2:30 PM, Gregory Guthrie > wrote: "I *strongly* suggest everyone start transitioning from cabal-dev to cabal sandboxes." Is there any reason that this is not just the default install mode for Cabal? Anything that prevents the current cabal-swamp of broken dependencies is a great help. I have tried to use Haskell in some classes, but it is hard when students (and I) cannot install packages, and the only answer is the Microsoft-like; "delete everything and start over; reinstall". It certainly reduces their confidence that Haskell is a feasible working environment. -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.dupont at gmail.com Fri Nov 1 17:41:20 2013 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Fri, 1 Nov 2013 18:41:20 +0100 Subject: [Haskell-cafe] Accessing own haddock files Message-ID: Hi the list, I have an application that need to access its own haddock documentation (to display on a web site). What is the best way to do that? Unfortunatly Cabal doesn't seem to provide that. Cabal generates a file "_Path.hs" containing: *bindir = "/home/kau/.cabal/bin" libdir = "/home/kau/.cabal/lib/Nomyx-Language-0.4.0/ghc-7.6.3" datadir = "/home/kau/.cabal/share/Nomyx-Language-0.4.0"* But there is no: *docdir = "/home/kau/.cabal/share/doc/Nomyx-Language-0.4.0"* That would be handy in my situation :) Best, Corentin -------------- next part -------------- An HTML attachment was scrubbed... URL: From creswick at gmail.com Fri Nov 1 17:58:26 2013 From: creswick at gmail.com (Rogan Creswick) Date: Fri, 1 Nov 2013 10:58:26 -0700 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: On Fri, Nov 1, 2013 at 6:30 AM, Gregory Guthrie wrote: > "I *strongly* suggest everyone start transitioning from cabal-dev to > cabal sandboxes." > > Is there any reason that this is not just the default install mode for > Cabal? > I'm on the fence about this -- iirc, ruby has a similar concept (revn?) that has this default, and it can be quite confusing (and, in my experience, generates a fair bit of clutter, although that would probably go down with experience.) Perhaps if cabal prompted for confirmation when creating a new sandbox (but only if running in an interactive context)? I could see my self inadvertently cabal-installing utilities (eg: newt, bnfc, etc...) in sandboxes on accident. --Rogan > > Anything that prevents the current cabal-swamp of broken dependencies is a > great help. I have tried to use Haskell in some classes, but it is hard > when students (and I) cannot install packages, and the only answer is the > Microsoft-like; "delete everything and start over; reinstall". It certainly > reduces their confidence that Haskell is a feasible working environment. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuuzetsu at fuuzetsu.co.uk Fri Nov 1 18:04:29 2013 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 01 Nov 2013 18:04:29 +0000 Subject: [Haskell-cafe] Accessing own haddock files In-Reply-To: References: Message-ID: <5273ED2D.7080208@fuuzetsu.co.uk> On 01/11/13 17:41, Corentin Dupont wrote: > Hi the list, > I have an application that need to access its own haddock documentation (to > display on a web site). > What is the best way to do that? > Unfortunatly Cabal doesn't seem to provide that. > > Cabal generates a file "_Path.hs" containing: > > *bindir = "/home/kau/.cabal/bin" > libdir = "/home/kau/.cabal/lib/Nomyx-Language-0.4.0/ghc-7.6.3" > datadir = "/home/kau/.cabal/share/Nomyx-Language-0.4.0"* > > But there is no: > *docdir = "/home/kau/.cabal/share/doc/Nomyx-Language-0.4.0"* > > That would be handy in my situation :) > > Best, > Corentin > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > Oops, didn't reply to the list. Here goes again: You can use ?cabal haddock? command which provides --haddock-options. You can then use that to use Haddock's --odir flag. -- Mateusz K. From carter.schonwald at gmail.com Fri Nov 1 18:09:41 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 1 Nov 2013 14:09:41 -0400 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: theres a bit of work planned out for the next year or so to make it so cabal can have reasonable "package manager" esque powers so you can evade many of the issues none sandboxed builds have. Theres also the flip side, that having sandboxed builds by default would make it none obvious how to install all sorts of neat CLI utils like pandoc! if you want to help out, get involved in cabal / cabal-install dev! they always need more people helping! :) --Carter On Fri, Nov 1, 2013 at 1:58 PM, Rogan Creswick wrote: > On Fri, Nov 1, 2013 at 6:30 AM, Gregory Guthrie wrote: > >> "I *strongly* suggest everyone start transitioning from cabal-dev to >> cabal sandboxes." >> >> Is there any reason that this is not just the default install mode for >> Cabal? >> > > I'm on the fence about this -- iirc, ruby has a similar concept (revn?) > that has this default, and it can be quite confusing (and, in my > experience, generates a fair bit of clutter, although that would probably > go down with experience.) > > Perhaps if cabal prompted for confirmation when creating a new sandbox > (but only if running in an interactive context)? I could see my self > inadvertently cabal-installing utilities (eg: newt, bnfc, etc...) in > sandboxes on accident. > > --Rogan > > > >> >> Anything that prevents the current cabal-swamp of broken dependencies is >> a great help. I have tried to use Haskell in some classes, but it is hard >> when students (and I) cannot install packages, and the only answer is the >> Microsoft-like; "delete everything and start over; reinstall". It certainly >> reduces their confidence that Haskell is a feasible working environment. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From amindfv at gmail.com Fri Nov 1 18:16:21 2013 From: amindfv at gmail.com (amindfv at gmail.com) Date: Fri, 1 Nov 2013 14:16:21 -0400 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: <5646ED70-385A-4B3C-9A9F-1B5DA13F73D1@gmail.com> El Nov 1, 2013, a las 14:09, Carter Schonwald escribi?: > Theres also the flip side, that having sandboxed builds by default would make it none obvious how to install all sorts of neat CLI utils like pandoc! > Also xmonad, no? Tom From bob at redivi.com Fri Nov 1 18:19:52 2013 From: bob at redivi.com (Bob Ippolito) Date: Fri, 1 Nov 2013 11:19:52 -0700 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: node.js's npm doesn't seem to have a problem with this. Sandboxed builds are the default, and when you want to install a tool globally you do it with npm -g. On Fri, Nov 1, 2013 at 11:09 AM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > theres a bit of work planned out for the next year or so to make it so > cabal can have reasonable "package manager" esque powers so you can evade > many of the issues none sandboxed builds have. Theres also the flip side, > that having sandboxed builds by default would make it none obvious how to > install all sorts of neat CLI utils like pandoc! > > if you want to help out, get involved in cabal / cabal-install dev! they > always need more people helping! > :) > > > --Carter > > > On Fri, Nov 1, 2013 at 1:58 PM, Rogan Creswick wrote: > >> On Fri, Nov 1, 2013 at 6:30 AM, Gregory Guthrie wrote: >> >>> "I *strongly* suggest everyone start transitioning from cabal-dev to >>> cabal sandboxes." >>> >>> Is there any reason that this is not just the default install mode for >>> Cabal? >>> >> >> I'm on the fence about this -- iirc, ruby has a similar concept (revn?) >> that has this default, and it can be quite confusing (and, in my >> experience, generates a fair bit of clutter, although that would probably >> go down with experience.) >> >> Perhaps if cabal prompted for confirmation when creating a new sandbox >> (but only if running in an interactive context)? I could see my self >> inadvertently cabal-installing utilities (eg: newt, bnfc, etc...) in >> sandboxes on accident. >> >> --Rogan >> >> >> >>> >>> Anything that prevents the current cabal-swamp of broken dependencies is >>> a great help. I have tried to use Haskell in some classes, but it is hard >>> when students (and I) cannot install packages, and the only answer is the >>> Microsoft-like; "delete everything and start over; reinstall". It certainly >>> reduces their confidence that Haskell is a feasible working environment. >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guthrie at mum.edu Fri Nov 1 18:31:33 2013 From: guthrie at mum.edu (Gregory Guthrie) Date: Fri, 1 Nov 2013 13:31:33 -0500 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> I don't understand the details - what is the downside of such a default ? "I could see myself inadvertently cabal-installing utilities (eg: newt, bnfc, etc...) in sandboxes on accident. What is wrong with this? -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Nov 1 18:37:13 2013 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 1 Nov 2013 18:37:13 +0000 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> Message-ID: <20131101183713.GE16562@weber> On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: > "I could see myself inadvertently cabal-installing utilities (eg: newt, bnfc, etc...) in sandboxes on accident. > > What is wrong with this? My guess is that Rogan was suggesting they wouldn't appear on the PATH. From carter.schonwald at gmail.com Fri Nov 1 18:44:28 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 1 Nov 2013 14:44:28 -0400 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <20131101183713.GE16562@weber> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> Message-ID: yup, exactly that On Fri, Nov 1, 2013 at 2:37 PM, Tom Ellis < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: > > "I could see myself inadvertently cabal-installing utilities (eg: > newt, bnfc, etc...) in sandboxes on accident. > > > > What is wrong with this? > > My guess is that Rogan was suggesting they wouldn't appear on the PATH. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Fri Nov 1 18:54:43 2013 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Fri, 1 Nov 2013 18:54:43 +0000 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <20131101183713.GE16562@weber> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> Message-ID: <20131101185443.GF16562@weber> On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: > > "I could see myself inadvertently cabal-installing utilities (eg: newt, bnfc, etc...) in sandboxes on accident. > > > > What is wrong with this? > > My guess is that Rogan was suggesting they wouldn't appear on the PATH. I wonder if some compromise is possible whereby the binary builds in the sandbox but is installed to some user-wide location on the PATH. Tom From creswick at gmail.com Fri Nov 1 18:50:42 2013 From: creswick at gmail.com (Rogan Creswick) Date: Fri, 1 Nov 2013 11:50:42 -0700 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <20131101183713.GE16562@weber> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> Message-ID: On Fri, Nov 1, 2013 at 11:37 AM, Tom Ellis < tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote: > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: > > "I could see myself inadvertently cabal-installing utilities (eg: > newt, bnfc, etc...) in sandboxes on accident. > > > > What is wrong with this? > > My guess is that Rogan was suggesting they wouldn't appear on the PATH. That, and I don't want sandboxes scattered around in (somewhat) random places. I might later want a sandbox there for a specific purpose, and a pre-existing sandbox could confound things. Mostly I don't like clutter, and the tools wouldn't be on the PATH though. (To be clear, these *are* pretty minor complaints.) --Rogan -------------- next part -------------- An HTML attachment was scrubbed... URL: From acfoltzer at gmail.com Fri Nov 1 19:11:21 2013 From: acfoltzer at gmail.com (Adam Foltzer) Date: Fri, 1 Nov 2013 12:11:21 -0700 Subject: [Haskell-cafe] Internship opportunities at Galois Message-ID: Hello, Galois has some exciting opportunities for interns in software engineering and research for 2014. Most of our projects use Haskell to some extent, so this is a great chance to get experience applying functional programming to real-world problems. Please pass along this posting to anyone you think might be interested, even if they don't yet know Haskell! Thank you, Adam Foltzer --- # Galois Software Engineering/Research Intern # Galois is currently seeking software engineering and research interns for 2014 at all educational levels. We are committed to matching interns with exciting and engaging engineering work that fits their particular interests, creating lasting value for interns, Galois, and our community. A Galois internship is a chance to tackle cutting-edge, meaningful problems in a uniquely collaborative environment with world-leading researchers. Roles may include technology research and development, requirements gathering, implementation, testing, formal verification, and infrastructure development. Past interns have integrated formal methods tools into larger projects, built comprehensive validation suites, synthesized high-performance cryptographic algorithms, written autopilots for quad-copters, designed the syntax and semantics of scripting languages, and researched type system extensions for academic publication. We deeply believe in providing comprehensive support and mentorship to all of our employees, particularly interns. We provide our employees with a steward who regularly checks in to ensure that they feel welcome and safe in the Galois community while gaining real value from their experiences. ## About Galois ## Our mission is to create trustworthiness in critical systems. We're in the business of taking blue-sky ideas and turning them into real-world technology solutions. We've been developing real-world systems for over ten years using functional programming, language design, and formal methods. Galois values diversity. We believe that differing viewpoints and experiences are essential to the process of innovation. We look broadly, including outside of established communities, to deliver innovation. ## How to Prepare ## An internship is an opportunity for learning and growth as an engineer. To make the most of the opportunity, we ask that candidates have experience reading, writing, and maintaining code in a realistic project. Many university courses involve multi-week collaborative projects that provide this type of experience. Most of our projects use the Haskell programming language and the git version control system. These tools aren't often taught in computer science classes, but there are many free resources available that we recommend for learning: - [Learn You a Haskell for Great Good!] [1] by Miran Lipova?a - [Real World Haskell] [2] by Bryan O'Sullivan, Don Stewart, and John Goerzen - [tryGit] [3] by Code School - [Pro Git] [4] by Scott Chacon [1]: http://learnyouahaskell.com/ [2]: http://book.realworldhaskell.org/ [3]: http://try.github.io [4]: http://git-scm.com/book ## Qualifications ## - The ability to be geographically located in Portland during the internship - Experience reading, writing, and maintaining code in a project as described above - Proficiency in software development practices such as design, documentation, testing, and the use of version control - Well-developed verbal and written communication skills; comfort in a collaborative team environment The following skills are not required, but may be relevant to a particular project. - Proficiency in Haskell or other programming languages with rich type systems (eg., OCaml, Standard ML, Scala) - Experience using C and assembly languages for low-level systems programming - Development experience in high assurance systems or security software - Specific experience in an area of Galois' expertise, such as: - Assured information sharing - Software modelling and formal verification - Cyber-physical systems and control systems - Operating systems, virtualization and secure platforms - Networking and mobile technology - Cyber defense systems - Scientific computing - Program analysis and software evaluation - Web security ## Logistics ## The length and start date of the internship are negotiable: starting any time from the new year through next fall is acceptable, but an intern must be at Galois for at least three continuous months. The internship is paid competitively, and interns are responsible for living arrangements (although we can certainly help you find arrangements). Galois is located in the heart of downtown Portland with multiple public transportation options available and world-class bicycle infrastructure. ## Application Details ## Send an email to careers at galois.com with the subject line "Internship 2014" with the following contents: - Email body: a brief plain-text note explaining your interests, experience, and other relevant details - Attachment: CV/Resume (PDF, plain text, or markdown only) **Applications must be received at least two months before the desired start date**. For example, we must receive your application by November 6, 2013, if you wish to start on January 6, 2014. -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Fri Nov 1 19:32:01 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 1 Nov 2013 15:32:01 -0400 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <20131101185443.GF16562@weber> References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> <20131101185443.GF16562@weber> Message-ID: This. Actually the Mac brew folks are hitting this issue exactly. Subtlty being you want to be able to install bin and share assets both to a custom location. Unclear how to do that currently. On Friday, November 1, 2013, Tom Ellis wrote: > On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: > > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: > > > "I could see myself inadvertently cabal-installing utilities (eg: > newt, bnfc, etc...) in sandboxes on accident. > > > > > > What is wrong with this? > > > > My guess is that Rogan was suggesting they wouldn't appear on the PATH. > > I wonder if some compromise is possible whereby the binary builds in the > sandbox but is installed to some user-wide location on the PATH. > > Tom > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bob at redivi.com Fri Nov 1 19:49:46 2013 From: bob at redivi.com (Bob Ippolito) Date: Fri, 1 Nov 2013 12:49:46 -0700 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> <20131101185443.GF16562@weber> Message-ID: symlinks are generally how this gets "solved" in practice. On Friday, November 1, 2013, Carter Schonwald wrote: > This. > > Actually the Mac brew folks are hitting this issue exactly. Subtlty being > you want to be able to install bin and share assets both to a custom > location. Unclear how to do that currently. > > On Friday, November 1, 2013, Tom Ellis wrote: > >> On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: >> > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: >> > > "I could see myself inadvertently cabal-installing utilities (eg: >> newt, bnfc, etc...) in sandboxes on accident. >> > > >> > > What is wrong with this? >> > >> > My guess is that Rogan was suggesting they wouldn't appear on the PATH. >> >> I wonder if some compromise is possible whereby the binary builds in the >> sandbox but is installed to some user-wide location on the PATH. >> >> Tom >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ydewit at gmail.com Fri Nov 1 20:14:14 2013 From: ydewit at gmail.com (Yuri de Wit) Date: Fri, 1 Nov 2013 18:14:14 -0200 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> <20131101185443.GF16562@weber> Message-ID: I quite like the approach taken by 'brew' where you can 'link' and 'unlink' executables to and from a specific folder in the path: *brew install apple-gcc42 > **brew link apple-gcc42 > **brew unlink apple-gcc42 * The installed package has the knowledge of what needs to be linked and unlinked to/from the path (btw, it is a path managed by brew in /usr/local/bin similar to .cabal/bin or Library/Haskell/bin) and it is quite easy to manage the path with it. On Fri, Nov 1, 2013 at 5:49 PM, Bob Ippolito wrote: > symlinks are generally how this gets "solved" in practice. > > > On Friday, November 1, 2013, Carter Schonwald wrote: > >> This. >> >> Actually the Mac brew folks are hitting this issue exactly. Subtlty >> being you want to be able to install bin and share assets both to a custom >> location. Unclear how to do that currently. >> >> On Friday, November 1, 2013, Tom Ellis wrote: >> >>> On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: >>> > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: >>> > > "I could see myself inadvertently cabal-installing utilities (eg: >>> newt, bnfc, etc...) in sandboxes on accident. >>> > > >>> > > What is wrong with this? >>> > >>> > My guess is that Rogan was suggesting they wouldn't appear on the PATH. >>> >>> I wonder if some compromise is possible whereby the binary builds in the >>> sandbox but is installed to some user-wide location on the PATH. >>> >>> Tom >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickolay.kudasov at gmail.com Fri Nov 1 20:23:29 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 2 Nov 2013 00:23:29 +0400 Subject: [Haskell-cafe] How do I lift Control.Monad.Reader.local? In-Reply-To: References: Message-ID: So you have some particular ts for which you wish to provide a MonadReaderinstance? In that case for each t which lacks MonadReader instance (look herefor existing instances) you need to implement it: instance MonadReader r m => MonadReader r (t m) where ask = lift ask local = ... The way to implement local is individual for each t, so you might want to specify which transformers are you working with. Nick 2013/11/1 David Fox > I mean m, not M. > > > On Thu, Oct 31, 2013 at 3:54 PM, David Fox wrote: > >> Hmm, I'm still having trouble implementing local for the MonadReader >> instance of M. >> >> >> On Thu, Oct 31, 2013 at 11:59 AM, Nickolay Kudasov < >> nickolay.kudasov at gmail.com> wrote: >> >>> Hi David, >>> >>> I believe the easiest way to do what you want is to use MonadReaderclass instead of explicit t >>> (Reader [String] a): >>> >>> push' :: MonadReader [String] m => String -> m a -> m apush' s = local (s:) >>> >>> Best, >>> Nick >>> >>> >>> 2013/10/31 David Fox >>> >>>> I can write a stack push function in the reader monad like so: >>>> >>>> import Control.Monad.Reader >>>> >>>> push :: String -> Reader [String] a -> Reader [String] a >>>> push s action = local (s :) action >>>> >>>> How can I write a push that works inside a monad transformer? >>>> >>>> push' :: MonadTrans t => String -> t (Reader [String]) a -> t >>>> (Reader [String]) a >>>> push' s action = ??? >>>> >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Fri Nov 1 20:34:45 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 1 Nov 2013 16:34:45 -0400 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> <20131101185443.GF16562@weber> Message-ID: my prior email is about how the BREW folks are having a hard time using cabal sandboxing to support providing brew formulae for things like pandoc etc On Fri, Nov 1, 2013 at 4:14 PM, Yuri de Wit wrote: > I quite like the approach taken by 'brew' where you can 'link' and > 'unlink' executables to and from a specific folder in the path: > > *brew install apple-gcc42 >> **brew link apple-gcc42 >> **brew unlink apple-gcc42 * > > > The installed package has the knowledge of what needs to be linked and > unlinked to/from the path (btw, it is a path managed by brew in > /usr/local/bin similar to .cabal/bin or Library/Haskell/bin) and it is > quite easy to manage the path with it. > > > > > > On Fri, Nov 1, 2013 at 5:49 PM, Bob Ippolito wrote: > >> symlinks are generally how this gets "solved" in practice. >> >> >> On Friday, November 1, 2013, Carter Schonwald wrote: >> >>> This. >>> >>> Actually the Mac brew folks are hitting this issue exactly. Subtlty >>> being you want to be able to install bin and share assets both to a custom >>> location. Unclear how to do that currently. >>> >>> On Friday, November 1, 2013, Tom Ellis wrote: >>> >>>> On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: >>>> > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: >>>> > > "I could see myself inadvertently cabal-installing utilities >>>> (eg: newt, bnfc, etc...) in sandboxes on accident. >>>> > > >>>> > > What is wrong with this? >>>> > >>>> > My guess is that Rogan was suggesting they wouldn't appear on the >>>> PATH. >>>> >>>> I wonder if some compromise is possible whereby the binary builds in the >>>> sandbox but is installed to some user-wide location on the PATH. >>>> >>>> Tom >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gagliardi.curtis at gmail.com Fri Nov 1 21:38:49 2013 From: gagliardi.curtis at gmail.com (Curtis Gagliardi) Date: Fri, 1 Nov 2013 14:38:49 -0700 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> <20131101185443.GF16562@weber> Message-ID: As a noob to haskell, is there a tutorial or anything someone can point me to that's up to do date about how to use cabal with sandboxes? Now that I'm trying to do more than play around at the repl, I'm trying to get up to speed with cabal and the ecosystem, but all the tutorials I see either recommend cabal-dev or don't mention sandboxing at all. On Fri, Nov 1, 2013 at 1:34 PM, Carter Schonwald wrote: > my prior email is about how the BREW folks are having a hard time using > cabal sandboxing to support providing brew formulae for things like pandoc > etc > > > On Fri, Nov 1, 2013 at 4:14 PM, Yuri de Wit wrote: > >> I quite like the approach taken by 'brew' where you can 'link' and >> 'unlink' executables to and from a specific folder in the path: >> >> *brew install apple-gcc42 >>> **brew link apple-gcc42 >>> **brew unlink apple-gcc42 * >> >> >> The installed package has the knowledge of what needs to be linked and >> unlinked to/from the path (btw, it is a path managed by brew in >> /usr/local/bin similar to .cabal/bin or Library/Haskell/bin) and it is >> quite easy to manage the path with it. >> >> >> >> >> >> On Fri, Nov 1, 2013 at 5:49 PM, Bob Ippolito wrote: >> >>> symlinks are generally how this gets "solved" in practice. >>> >>> >>> On Friday, November 1, 2013, Carter Schonwald wrote: >>> >>>> This. >>>> >>>> Actually the Mac brew folks are hitting this issue exactly. Subtlty >>>> being you want to be able to install bin and share assets both to a custom >>>> location. Unclear how to do that currently. >>>> >>>> On Friday, November 1, 2013, Tom Ellis wrote: >>>> >>>>> On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: >>>>> > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: >>>>> > > "I could see myself inadvertently cabal-installing utilities >>>>> (eg: newt, bnfc, etc...) in sandboxes on accident. >>>>> > > >>>>> > > What is wrong with this? >>>>> > >>>>> > My guess is that Rogan was suggesting they wouldn't appear on the >>>>> PATH. >>>>> >>>>> I wonder if some compromise is possible whereby the binary builds in >>>>> the >>>>> sandbox but is installed to some user-wide location on the PATH. >>>>> >>>>> Tom >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vogt.adam at gmail.com Fri Nov 1 21:43:34 2013 From: vogt.adam at gmail.com (adam vogt) Date: Fri, 1 Nov 2013 17:43:34 -0400 Subject: [Haskell-cafe] ANNOUNCE: HList-0.3 Message-ID: Greetings, We are pleased to announce HList-0.3. This is an update the well-known library for strongly typed heterogenous lists, records, type-indexed products (TIP) and co-products. Some of the highlights are: * works with lens. See examples/labelable.hs * modern features such as TypeFamilies, DataKinds (Symbol), ConstraintKinds, PolyKinds, QuasiQuotes * Data instances for HList and Record. One application is given in examples/cmdargs.hs * named and optional function parameters (using Keyword or perhaps RecordPuns) are part of the library proper * additional functions including: HTranspose, HZip, HFoldl, HScanr, HReplicate * improved type inference. To give an example: > let y = hMap (Fun' read :: Fun' Read String) x This is about the same as `let y = map read x', but each element of the HList `y' can have a different type. Only one of the two lengths needs to be specified. * more documentation and examples, which should make it easier to find your way around. Refer to the included ChangeLog or `darcs changes` for more details. This release requires ghc>=7.6. You can get the release from or use cabal-install: $ cabal update $ cabal install HList-0.3 For now it seems that hackage is rejecting the upload due to language extensions it doesn't know about, so in the meantime you can get it with: $ cabal install http://code.haskell.org/~aavogt/HList/HList-0.3.0.tar.gz With haddocks at . -- Adam From hvr at gnu.org Fri Nov 1 21:43:53 2013 From: hvr at gnu.org (Herbert Valerio Riedel) Date: Fri, 01 Nov 2013 22:43:53 +0100 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> (Gregory Guthrie's message of "Fri, 1 Nov 2013 08:30:17 -0500") References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> Message-ID: <87fvrflrvq.fsf@gnu.org> Hello Gregory, On 2013-11-01 at 14:30:17 +0100, Gregory Guthrie wrote: > "I *strongly* suggest everyone start transitioning from cabal-dev to cabal sandboxes." > > Is there any reason that this is not just the default install mode for > Cabal? 'cabal install'ing a package manually has usually the purpose to make it available to a 'ghc --make SomeHaskellProg.hs' (n.b. a .cabal-less compilation) or for 'runghc SomeHaskellScript.hs'; is this possible with 'cabal sandbox' environments, and if not, what purpose does it serve to 'cabal install ' into a sandbox by default? Cheers, hvr From erochest at gmail.com Sat Nov 2 02:46:14 2013 From: erochest at gmail.com (Eric Rochester) Date: Fri, 1 Nov 2013 22:46:14 -0400 Subject: [Haskell-cafe] Cabal sandboxes over cabal-dev (Rogan Creswick) In-Reply-To: References: <08EF9DA445C4B5439C4733E1F35705BA032C1B133A2F@MAIL.cs.mum.edu> <08EF9DA445C4B5439C4733E1F35705BA032C1B133A45@MAIL.cs.mum.edu> <20131101183713.GE16562@weber> <20131101185443.GF16562@weber> Message-ID: This isn't robust enough for brew, I'm sure, but I've been using the script in this gist to install pandoc myself in a sandbox, but to have brew manage the links for the binaries. https://gist.github.com/erochest/7274727 Eric On Fri, Nov 1, 2013 at 4:34 PM, Carter Schonwald wrote: > my prior email is about how the BREW folks are having a hard time using > cabal sandboxing to support providing brew formulae for things like pandoc > etc > > > On Fri, Nov 1, 2013 at 4:14 PM, Yuri de Wit wrote: > >> I quite like the approach taken by 'brew' where you can 'link' and >> 'unlink' executables to and from a specific folder in the path: >> >> *brew install apple-gcc42 >>> **brew link apple-gcc42 >>> **brew unlink apple-gcc42 * >> >> >> The installed package has the knowledge of what needs to be linked and >> unlinked to/from the path (btw, it is a path managed by brew in >> /usr/local/bin similar to .cabal/bin or Library/Haskell/bin) and it is >> quite easy to manage the path with it. >> >> >> >> >> >> On Fri, Nov 1, 2013 at 5:49 PM, Bob Ippolito wrote: >> >>> symlinks are generally how this gets "solved" in practice. >>> >>> >>> On Friday, November 1, 2013, Carter Schonwald wrote: >>> >>>> This. >>>> >>>> Actually the Mac brew folks are hitting this issue exactly. Subtlty >>>> being you want to be able to install bin and share assets both to a custom >>>> location. Unclear how to do that currently. >>>> >>>> On Friday, November 1, 2013, Tom Ellis wrote: >>>> >>>>> On Fri, Nov 01, 2013 at 06:37:13PM +0000, Tom Ellis wrote: >>>>> > On Fri, Nov 01, 2013 at 01:31:33PM -0500, Gregory Guthrie wrote: >>>>> > > "I could see myself inadvertently cabal-installing utilities >>>>> (eg: newt, bnfc, etc...) in sandboxes on accident. >>>>> > > >>>>> > > What is wrong with this? >>>>> > >>>>> > My guess is that Rogan was suggesting they wouldn't appear on the >>>>> PATH. >>>>> >>>>> I wonder if some compromise is possible whereby the binary builds in >>>>> the >>>>> sandbox but is installed to some user-wide location on the PATH. >>>>> >>>>> Tom >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.howard at frigidcode.com Sat Nov 2 05:40:43 2013 From: christopher.howard at frigidcode.com (Christopher Howard) Date: Fri, 01 Nov 2013 21:40:43 -0800 Subject: [Haskell-cafe] more generic class instances? Message-ID: <5274905B.10800@frigidcode.com> Hi. I am playing around with basic Haskell overloading. What I'm interested in is how to do specialization in Haskell -- i.e., functions that work generically on all (or many) types but work more efficiently on certain types. So, I am trying to make a class of functions which can be fed into a partial sum calculator. Maybe something like so: class PartialSum f where -- params: term function, end index partialSum :: Integral b => f -> b -> a The most generic instance would be any function that takes an integer and returns a number. The specialized instances would things like, say, a wrapped function which is guaranteed to be linear (through safe constructors or something). But I'm having trouble figuring out how even to make the generic version. I'm thinking something like this: instance PartialSum (a -> b) where partialSum f n = foldl (\u v -> u + f v) 0 [1..n] But the compiler complains it can't prove that the input to the "f" function is the same type as the "n" parameter. That makes sense, but I'm not sure how to fix that. From nickolay.kudasov at gmail.com Sat Nov 2 07:14:25 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 2 Nov 2013 11:14:25 +0400 Subject: [Haskell-cafe] more generic class instances? In-Reply-To: <5274905B.10800@frigidcode.com> References: <5274905B.10800@frigidcode.com> Message-ID: Hi Christopher, What you want is to make b (and a) depend on f. This can be done in several ways. With functional dependencies: class (Integral a, Num b) => PartialSum a b f | f -> a b where partialSum :: f -> a -> b instance (Integral a, Num b) => PartialSum a b (a -> b) where partialSum f n = foldl (\u v -> u + f v) 0 [1..n] With type families: class PartialSum f where type End f type Res f partialSum' :: f -> End f -> Res f instance (Integral a, Num b) => PartialSum (a -> b) where type End (a -> b) = a type Res (a -> b) = b partialSum f n = foldl (\u v -> u + f v) 0 [1..n] I can?t see though what you?re trying to achieve. Could you provide some more use cases for that class? Best, Nick 2013/11/2 Christopher Howard > Hi. I am playing around with basic Haskell overloading. What I'm > interested in is how to do specialization in Haskell -- i.e., functions > that work generically on all (or many) types but work more efficiently on > certain types. So, I am trying to make a class of functions which can be > fed into a partial sum calculator. Maybe something like so: > > class PartialSum f where > -- params: term function, end index > partialSum :: Integral b => f -> b -> a > > The most generic instance would be any function that takes an integer and > returns a number. The specialized instances would things like, say, a > wrapped function which is guaranteed to be linear (through safe > constructors or something). But I'm having trouble figuring out how even to > make the generic version. I'm thinking something like this: > > instance PartialSum (a -> b) where > partialSum f n = foldl (\u v -> u + f v) 0 [1..n] > > But the compiler complains it can't prove that the input to the "f" > function is the same type as the "n" parameter. That makes sense, but I'm > not sure how to fix that. > ______________________________**_________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/**mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.howard at frigidcode.com Sat Nov 2 08:13:57 2013 From: christopher.howard at frigidcode.com (Christopher Howard) Date: Sat, 02 Nov 2013 00:13:57 -0800 Subject: [Haskell-cafe] more generic class instances? In-Reply-To: References: <5274905B.10800@frigidcode.com> Message-ID: <5274B445.9010805@frigidcode.com> On 11/01/2013 11:14 PM, Nickolay Kudasov wrote: > > Hi Christopher, > > What you want is to make |b| (and |a|) depend on |f|. This can be done > in several ways. > > With functional dependencies: > > |class (Integral a,Num b) =>PartialSum a b f | f -> a bwhere > partialSum :: f -> a -> b > > instance (Integral a,Num b) =>PartialSum a b (a -> b)where > partialSum f n = foldl (\u v -> u + f v)0 [1..n]| > > With type families: > > |class PartialSum fwhere > type End f > type Res f > partialSum' :: f ->End f ->Res f > > instance (Integral a,Num b) =>PartialSum (a -> b)where > type End (a ->b) = a > type Res (a ->b) = b > partialSum f n = foldl (\u v -> u + f v)0 [1..n]| > > I can?t see though what you?re trying to achieve. Could you provide > some more use cases for that class? > > Thanks for the response. I'll have to read up more on functional dependencies and type families. Which do you think is more appropriate? This little class is mostly just a test case for me to use in exploring the specialization idea. Partial sums are something mentioned in my math class. Generically, you can calculate any partial sum by adding up the terms (a_1 + a_2 + a_3 + ... + a_n). However, when the terms are in certain forms, you can use shortcut formulas. E.g., if the term is just n, then you can just plug n into n*(n+1)/2. So, the idea was to have a partialSum function that can calculate the partial sum with any function passed to it (the long and slow way) but can use a shortcut method when the function is of a particular form. Say, a term of this type: data LinearTerm f = LinearTerm f -- constructor not exported linearTerm coefficient = LinearTerm (\x -> coefficient * x) If my toy case is silly, I'm sure there are plenty of better examples that could be given. For example, sorting functions that can "choose" better algorithms depending on the type. (Say, the generic function uses a comparison sort, but a type with a small number of possible values would be better suited for a pigeon hole algorithm.) -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.howard at frigidcode.com Sat Nov 2 08:50:55 2013 From: christopher.howard at frigidcode.com (Christopher Howard) Date: Sat, 02 Nov 2013 00:50:55 -0800 Subject: [Haskell-cafe] beginners list for common lisp? Message-ID: <5274BCEF.2060003@frigidcode.com> Does anybody know if there is something like a Common Lisp version of the Haskell Beginner's mailing list? Haskell's great, of course, but I've also been picking up Lisp, and I'm looking for a Lisp list that is very newbie friendly. From chrisdone at gmail.com Sat Nov 2 11:41:03 2013 From: chrisdone at gmail.com (Christopher Done) Date: Sat, 2 Nov 2013 12:41:03 +0100 Subject: [Haskell-cafe] beginners list for common lisp? In-Reply-To: <5274BCEF.2060003@frigidcode.com> References: <5274BCEF.2060003@frigidcode.com> Message-ID: > for a Lisp list that is very newbie friendly. Not sure I'd go to Common Lisp. Try Clojure or Racket. On 2 November 2013 09:50, Christopher Howard < christopher.howard at frigidcode.com> wrote: > Does anybody know if there is something like a Common Lisp version of the > Haskell Beginner's mailing list? Haskell's great, of course, but I've also > been picking up Lisp, and I'm looking for a Lisp list that is very newbie > friendly. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickolay.kudasov at gmail.com Sat Nov 2 12:27:44 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 2 Nov 2013 16:27:44 +0400 Subject: [Haskell-cafe] more generic class instances? In-Reply-To: <5274B445.9010805@frigidcode.com> References: <5274905B.10800@frigidcode.com> <5274B445.9010805@frigidcode.com> Message-ID: Okay, I think I got what you are trying to accomplish. With separate data types for each term type this could be done like that: newtype Constant a = Constant a deriving (Eq, Show, Enum, Num) data Linear a = Linear a (Constant a)data Quadratic a = Quadratic a (Linear a) data Arbitrary a = Arbitrary (a -> a) class PartialSum term where partialSum :: (Integral a) => a -> term a -> a instance PartialSum Constant where partialSum n (Constant c) = n * c instance PartialSum Linear where partialSum n (Linear k c) = k * n * (n + 1) `div` 2 + partialSum n c instance PartialSum Quadratic where partialSum n (Quadratic k l) = k * n * (n + 1) * (2 * n + 1) `div` 6 + partialSum n l instance PartialSum Arbitrary where partialSum n (Arbitrary f) = sum $ map f [1..n] Now you can calculate partialSum effectively like that: partialSum 10 $ Quadratic 1 $ Linear 2 1 -- sum = 505, a_n = n^2 + 2n + 1partialSum 10 $ Linear 3 (-1) -- sum = 155, a_n = 3n - 1partialSum 10 $ Arbitrary (2^) -- sum = 2046, a_n = 2^n Note that I didn?t use any of FunctionalDependencies or TypeFamiliesextensions. Instead I made terms accept a type parameter. You can easily make types of a_n and n different using 2 type parameters, but I kept them the same for simplicity. The problem with this implementation is that you can?t compose different terms. E.g. if you have term1 :: Linear Int and term2 :: Quadratic Int, you can?t write term1 + term2. If you?d like to do that, you can make a single data structure representing all kinds of terms: data Term a = Constant a | Linear a a | Quadratic a a a | Arbitrary (a -> a) Now you could implement a Num instance on that: instance Num a => Num (Term a) where fromInteger = Constant ? fromInteger Constant c + Linear k c' = Linear k (c + c') Constant c + Quadratic a k c' = Quadratic a k (c + c') Linear k c + Quadratic a k' c' = Quadratic a (k + k') (c + c') -- ... x + y = y + x Constant c * Linear k c' = Linear (c * k) (c * c') Constant c * Quadratic a b c' = Quadratic (c * a) (c * b) (c * c') -- ... x * y = y * x negate (Constant c) = Constant (negate c) negate (Linear k b) = Linear (negate k) (negate b) negate (Quadratic a b c) = Quadratic (negate a) (negate b) (negate c) -- ... as well as partialSum: partialSum :: (Integral a) => a -> Term a -> apartialSum n (Constant c) = n * cpartialSum n (Linear k b) = k * n * (n + 1) `div` 2 + partialSum n (Constant b)partialSum n (Quadratic a b c) = a * n * (n + 1) * (2 * n + 1) `div` 6 + partialSum n (Linear b c)partialSum n (Arbitrary f) = sum $ map f [1..n] Note that we don?t have to use typeclasses for that! Finally, you could make some useful aliases: n :: Integral a => Term an = Linear 1 0 n2 :: Integral a => Term an2 = Quadratic 1 0 0 And go on calculating what you want: partialSum 10 $ 3 * n2 - 5 * n + 10 -- sum = 980 Hope that helps, Nick 2013/11/2 Christopher Howard > On 11/01/2013 11:14 PM, Nickolay Kudasov wrote: > > Hi Christopher, > > What you want is to make b (and a) depend on f. This can be done in > several ways. > > With functional dependencies: > > class (Integral a, Num b) => PartialSum a b f | f -> a b where > partialSum :: f -> a -> b > instance (Integral a, Num b) => PartialSum a b (a -> b) where > partialSum f n = foldl (\u v -> u + f v) 0 [1..n] > > With type families: > > class PartialSum f where > type End f > type Res f > partialSum' :: f -> End f -> Res f > instance (Integral a, Num b) => PartialSum (a -> b) where > type End (a -> b) = a > type Res (a -> b) = b > partialSum f n = foldl (\u v -> u + f v) 0 [1..n] > > I can?t see though what you?re trying to achieve. Could you provide some > more use cases for that class? > > > Thanks for the response. I'll have to read up more on functional > dependencies and type families. Which do you think is more appropriate? > > This little class is mostly just a test case for me to use in exploring > the specialization idea. Partial sums are something mentioned in my math > class. Generically, you can calculate any partial sum by adding up the > terms (a_1 + a_2 + a_3 + ... + a_n). However, when the terms are in certain > forms, you can use shortcut formulas. E.g., if the term is just n, then you > can just plug n into n*(n+1)/2. > > So, the idea was to have a partialSum function that can calculate the > partial sum with any function passed to it (the long and slow way) but can > use a shortcut method when the function is of a particular form. Say, a > term of this type: > > data LinearTerm f = LinearTerm f -- constructor not exported > linearTerm coefficient = LinearTerm (\x -> coefficient * x) > > If my toy case is silly, I'm sure there are plenty of better examples that > could be given. For example, sorting functions that can "choose" better > algorithms depending on the type. (Say, the generic function uses a > comparison sort, but a type with a small number of possible values would be > better suited for a pigeon hole algorithm.) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat Nov 2 16:26:17 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 2 Nov 2013 12:26:17 -0400 Subject: [Haskell-cafe] beginners list for common lisp? In-Reply-To: References: <5274BCEF.2060003@frigidcode.com> Message-ID: I'll second racket. Few languages have such great IDE support out of the box as racket. The devs are great pl researchers who also care about pedagogy. On Saturday, November 2, 2013, Christopher Done wrote: > > for a Lisp list that is very newbie friendly. > > Not sure I'd go to Common Lisp. Try Clojure or Racket. > > > On 2 November 2013 09:50, Christopher Howard < > christopher.howard at frigidcode.com 'christopher.howard at frigidcode.com');>> wrote: > >> Does anybody know if there is something like a Common Lisp version of the >> Haskell Beginner's mailing list? Haskell's great, of course, but I've also >> been picking up Lisp, and I'm looking for a Lisp list that is very newbie >> friendly. >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org > 'Haskell-Cafe at haskell.org');> >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christopher.howard at frigidcode.com Sat Nov 2 18:25:11 2013 From: christopher.howard at frigidcode.com (Christopher Howard) Date: Sat, 02 Nov 2013 10:25:11 -0800 Subject: [Haskell-cafe] more generic class instances? In-Reply-To: References: <5274905B.10800@frigidcode.com> <5274B445.9010805@frigidcode.com> Message-ID: <52754387.4030300@frigidcode.com> Thanks for the continued help. The only issue with your recently described approach is that, as near as I can tell, it requires the terms to be integral. data Arbitrary a = Arbitrary (a -> a) class PartialSum term where partialSum :: (Integral a) => a -> term a -> a instance PartialSum Arbitrary where partialSum n (Arbitrary f) = sum $ map f [1..n] I cannot, for example, do h> partialSum 10 (Arbitrary (\x -> 1.5 * x :: Float)) :88:1: No instance for (Integral Float) arising from a use of `partialSum' Possible fix: add an instance declaration for (Integral Float) In the expression: partialSum 10 (Arbitrary (\ x -> 1.5 * x :: Float)) In an equation for `it': it = partialSum 10 (Arbitrary (\ x -> 1.5 * x :: Float)) h> partialSum 10 (Arbitrary (\ x -> (1 % 5) * x)) :100:1: No instance for (Integral (Ratio a0)) arising from a use of `partialSum' Possible fix: add an instance declaration for (Integral (Ratio a0)) In the expression: partialSum 10 (Arbitrary (\ x -> (1 % 5) * x)) In an equation for `it': it = partialSum 10 (Arbitrary (\ x -> (1 % 5) * x)) From obscaenvs at gmail.com Sat Nov 2 18:29:54 2013 From: obscaenvs at gmail.com (Obscaenvs) Date: Sat, 02 Nov 2013 19:29:54 +0100 Subject: [Haskell-cafe] LiberalTypeSynonyms: documentation issue Message-ID: <527544A2.5040407@gmail.com> In the docs for GHC 7.6.3, e.g. at [1], it is said that one can use LiberalTypeSynonyms as so: `type Discard a = forall b. Show b => a -> b -> (a, String)` This is, however, not possible without RankNTypes which is stated in a tutorial at FPComplete [2] and, of course, GHC 7.6.3 itself says so when trying to compile something with the above definition for Discard: ` Illegal polymorphic or qualified type: forall b. Show b => a -> b -> (a, String) Perhaps you intended to use -XRankNTypes or -XRank2Types In the type declaration for `Discard' ` Maybe the GHC User Guide should be updated to reflect this? /Fredrik References: [1] http://www.bugthunk.net/ghc/docs/7.6.3/html/users_guide_repl/data-type-extensions.html#type-synonyms [2] https://www.fpcomplete.com/school/to-infinity-and-beyond/pick-of-the-week/guide-to-ghc-extensions/explicit-forall#interaction-with-liberaltypesynonyms From eli.lee.frey at gmail.com Sat Nov 2 19:25:18 2013 From: eli.lee.frey at gmail.com (Eli Frey) Date: Sat, 2 Nov 2013 12:25:18 -0700 Subject: [Haskell-cafe] SSL support for hackage and cabal Message-ID: Hello all, It recently came to my attention that hackage is http only. I would love to do anything I can to help hackage support https. What is the process for volunteering with the IHG (I imagine this is the avenue for helping with hackage/haskell.org). If the IHG is having dificulty getting an SSL certificate, GlobalSign (ful disclosure, they are my employer) provides free certificates to FOSS projects. here is a link: https://www.globalsign.com/ssl/ssl-open-source/ I am also concerned that cabal does not have support for SSL, but hackage must come first and at least then a sufficiently paranoid person can download their packages over https and ad them to their cabal sandboxes. Cheers, Eli -------------- next part -------------- An HTML attachment was scrubbed... URL: From bytbox at gmail.com Sat Nov 2 19:30:07 2013 From: bytbox at gmail.com (Scott Lawrence) Date: Sat, 2 Nov 2013 15:30:07 -0400 (EDT) Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: Hello, On the other side: cabal, at least, uses the HTTP package, and I've been (slowly) working on adding SSL support. On Sat, 2 Nov 2013, Eli Frey wrote: > Hello all, > > It recently came to my attention that hackage is http only. I would love > to do anything I can to help hackage support https. What is the process for > volunteering with the IHG (I imagine this is the avenue for helping with > hackage/haskell.org). > > If the IHG is having dificulty getting an SSL certificate, GlobalSign (ful > disclosure, they are my employer) provides free certificates to FOSS > projects. > > here is a link: https://www.globalsign.com/ssl/ssl-open-source/ > > I am also concerned that cabal does not have support for SSL, but hackage > must come first and at least then a sufficiently paranoid person can > download their packages over https and ad them to their cabal sandboxes. > > Cheers, > Eli > -- Scott Lawrence From dagitj at gmail.com Sat Nov 2 19:58:48 2013 From: dagitj at gmail.com (Jason Dagit) Date: Sat, 2 Nov 2013 12:58:48 -0700 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: On Sat, Nov 2, 2013 at 12:25 PM, Eli Frey wrote: > Hello all, > > It recently came to my attention that hackage is http only. I would love > to do anything I can to help hackage support https. What is the process for > volunteering with the IHG (I imagine this is the avenue for helping with > hackage/haskell.org). > > If the IHG is having dificulty getting an SSL certificate, GlobalSign (ful > disclosure, they are my employer) provides free certificates to FOSS > projects. > Yes! And they have graciously given us an SSL certificate. We are very pleased by that :) Having an SSL certificate is a recent thing for us and the infrastructure team is currently busy wrapping up other tasks. We do have folks assigned to putting the cert in place and configuring everything, they just need a bit more time :) (More volunteers would help too, but that's longer term.) I am also concerned that cabal does not have support for SSL, but hackage > must come first and at least then a sufficiently paranoid person can > download their packages over https and ad them to their cabal sandboxes. > Yes, this is the next part to tackle. Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickolay.kudasov at gmail.com Sat Nov 2 19:59:49 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 2 Nov 2013 23:59:49 +0400 Subject: [Haskell-cafe] more generic class instances? In-Reply-To: <52754387.4030300@frigidcode.com> References: <5274905B.10800@frigidcode.com> <5274B445.9010805@frigidcode.com> <52754387.4030300@frigidcode.com> Message-ID: I mentioned in my last email that you can do that with extra type parameter. Apparently, it?s much simpler but my code needs some improvement: {-# LANGUAGE GeneralizedNewtypeDeriving #-} ? {-# LANGUAGE RankNTypes #-} newtype Constant a = Constant a deriving (Eq, Ord, Num, Enum) data Linear a = Linear a (Constant a)data Quadratic a = Quadratic a (Linear a)data Arbitrary a = Arbitrary (forall n. Integral n => n -> a) class PartialSum term where partialSum :: (Integral a, Num b) => a -> term b -> b instance PartialSum Constant where partialSum n (Constant c) = fromIntegral n * c instance PartialSum Linear where partialSum n (Linear k c) = k * fromIntegral (n * (n + 1) `div` 2) + partialSum n c instance PartialSum Quadratic where partialSum n (Quadratic k l) = k * fromIntegral (n * (n + 1) * (2 * n + 1) `div` 6) + partialSum n l instance PartialSum Arbitrary where partialSum n (Arbitrary f) = sum $ map f [1..n] This gives you appropriate behavior: -- integerspartialSum 10 $ Linear 1 0partialSum 10 $ Arbitrary (2^)-- floatspartialSum 10 $ Arbitrary (\n -> 1.5 * fromIntegral n :: Float)partialSum 10 $ Arbitrary (sqrt . fromIntegral)-- complex (from Data.Complex)partialSum 10 $ Arbitrary (\n -> fromIntegral n^2 :+ fromIntegral n) Nick 2013/11/2 Christopher Howard > Thanks for the continued help. The only issue with your recently described > approach is that, as near as I can tell, it requires the terms to be > integral. > > > data Arbitrary a = Arbitrary (a -> a) > > class PartialSum term where > > partialSum :: (Integral a) => a -> term a -> a > > instance PartialSum Arbitrary where > > partialSum n (Arbitrary f) = sum $ map f [1..n] > > I cannot, for example, do > > h> partialSum 10 (Arbitrary (\x -> 1.5 * x :: Float)) > > :88:1: > > No instance for (Integral Float) > > arising from a use of `partialSum' > > Possible fix: add an instance declaration for (Integral Float) > > In the expression: > > partialSum 10 (Arbitrary (\ x -> 1.5 * x :: Float)) > > In an equation for `it': > > it = partialSum 10 (Arbitrary (\ x -> 1.5 * x :: Float)) > > h> partialSum 10 (Arbitrary (\ x -> (1 % 5) * x)) > > :100:1: > > No instance for (Integral (Ratio a0)) > > arising from a use of `partialSum' > > Possible fix: add an instance declaration for (Integral (Ratio a0)) > > In the expression: partialSum 10 (Arbitrary (\ x -> (1 % 5) * x)) > > In an equation for `it': > > it = partialSum 10 (Arbitrary (\ x -> (1 % 5) * x)) > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eli.lee.frey at gmail.com Sat Nov 2 20:33:46 2013 From: eli.lee.frey at gmail.com (Eli Frey) Date: Sat, 2 Nov 2013 13:33:46 -0700 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: > Yes! And they have graciously given us an SSL certificate. We are very pleased by that :) Who-da thunk it :). Configuring ssl can be tricky, especially getting it right. I'de love to help if you have any problems. We use sslcheck.x509labs.com internally to make sure everything is working correctly. It even has step-by-step instructions on how to fix some problems. > On the other side: cabal, at least, uses the HTTP package, and I've been (slowly) working on adding SSL support. Oh lovely! I can not find your work through the github repos, but I'd love to take a look and see if I can help. On Sat, Nov 2, 2013 at 12:58 PM, Jason Dagit wrote: > > > > On Sat, Nov 2, 2013 at 12:25 PM, Eli Frey wrote: > >> Hello all, >> >> It recently came to my attention that hackage is http only. I would love >> to do anything I can to help hackage support https. What is the process for >> volunteering with the IHG (I imagine this is the avenue for helping with >> hackage/haskell.org). >> >> If the IHG is having dificulty getting an SSL certificate, GlobalSign >> (ful disclosure, they are my employer) provides free certificates to FOSS >> projects. >> > > Yes! And they have graciously given us an SSL certificate. We are very > pleased by that :) > > Having an SSL certificate is a recent thing for us and the infrastructure > team is currently busy wrapping up other tasks. We do have folks assigned > to putting the cert in place and configuring everything, they just need a > bit more time :) (More volunteers would help too, but that's longer term.) > > I am also concerned that cabal does not have support for SSL, but hackage >> must come first and at least then a sufficiently paranoid person can >> download their packages over https and ad them to their cabal sandboxes. >> > > Yes, this is the next part to tackle. > > Jason > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Sat Nov 2 20:34:28 2013 From: johan.tibell at gmail.com (Johan Tibell) Date: Sat, 2 Nov 2013 21:34:28 +0100 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: Hi, On Sat, Nov 2, 2013 at 8:25 PM, Eli Frey wrote: > I am also concerned that cabal does not have support for SSL, but hackage > must come first and at least then a sufficiently paranoid person can > download their packages over https and ad them to their cabal sandboxes. > We need an SSL library that cabal can depend on. This means that it needs to be cross-platform, not pull in too many other depedencies, etc. Someone needs to investigate the options and perhaps write a new binding if needed. -- Johan -------------- next part -------------- An HTML attachment was scrubbed... URL: From bytbox at gmail.com Sat Nov 2 20:41:04 2013 From: bytbox at gmail.com (Scott Lawrence) Date: Sat, 2 Nov 2013 16:41:04 -0400 (EDT) Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: I believe tls and tls-extra (http://hackage.haskell.org/package/tls-1.1.5) satisfy those requirements, being pure haskell. On Sat, 2 Nov 2013, Johan Tibell wrote: > Hi, > > On Sat, Nov 2, 2013 at 8:25 PM, Eli Frey wrote: > >> I am also concerned that cabal does not have support for SSL, but hackage >> must come first and at least then a sufficiently paranoid person can >> download their packages over https and ad them to their cabal sandboxes. >> > > We need an SSL library that cabal can depend on. This means that it needs > to be cross-platform, not pull in too many other depedencies, etc. Someone > needs to investigate the options and perhaps write a new binding if needed. > > -- Johan > -- Scott Lawrence From bytbox at gmail.com Sat Nov 2 20:42:22 2013 From: bytbox at gmail.com (Scott Lawrence) Date: Sat, 2 Nov 2013 16:42:22 -0400 (EDT) Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: On Sat, 2 Nov 2013, Eli Frey wrote: > Oh lovely! I can not find your work through the github repos, but I'd love > to take a look and see if I can help. Nothing posted online yet. I'll slap a fork up and post here as soon as it's working enough for multiple eyes to be meaningful (bug finding/fixing etc). -- Scott Lawrence From alfredo.dinapoli at gmail.com Sat Nov 2 21:06:08 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sat, 2 Nov 2013 21:06:08 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick Message-ID: Hello Caf?, this is what I'm getting: ??$ cabal install vector-0.10.9.1 1 ? Resolving dependencies... Configuring vector-0.10.9.1... Building vector-0.10.9.1... Preprocessing library vector-0.10.9.1... [ 1 of 19] Compiling Data.Vector.Storable.Internal ( Data/Vector/Storable/Internal.hs, dist/build/Data/Vector/Storable/Internal.o ) [ 2 of 19] Compiling Data.Vector.Fusion.Util ( Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( Data/Vector/Fusion/Stream/Size.hs, dist/build/Data/Vector/Fusion/Stream/Size.o ) Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: No explicit method or default declaration for `*' In the instance declaration for `Num Size' Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: No explicit method or default declaration for `abs' In the instance declaration for `Num Size' Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: No explicit method or default declaration for `signum' In the instance declaration for `Num Size' [ 4 of 19] Compiling Data.Vector.Internal.Check ( Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o ) Loading package ghc-prim ... linking ... done. Loading package integer-gmp ... linking ... done. Loading package base ... : can't load .so/.DLL for: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, 9): no suitable image found. Did find: /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: mach-o, but wrong filetype) Failed to install vector-0.10.9.1 cabal: Error: some packages failed to install: vector-0.10.9.1 failed during the building phase. The exception was: ExitFailure 1 I've did the trick of installing gcc-4.8 as described here: http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 I'm running a compiled version of ghc 7.6.3 (so not installed via the Haskell platform). Have anyone stumbled upon this? Thanks, Alfredo -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat Nov 2 21:09:17 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 2 Nov 2013 17:09:17 -0400 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: You need to have xcode 5 installed if you wish for the lib issues to go way if you're using the gcc approach, it sounds like you don't have xcode 5 installed. On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < alfredo.dinapoli at gmail.com> wrote: > Hello Caf?, > this is what I'm getting: > > > ??$ cabal install vector-0.10.9.1 > 1 ? > Resolving dependencies... > Configuring vector-0.10.9.1... > Building vector-0.10.9.1... > Preprocessing library vector-0.10.9.1... > [ 1 of 19] Compiling Data.Vector.Storable.Internal ( > Data/Vector/Storable/Internal.hs, > dist/build/Data/Vector/Storable/Internal.o ) > [ 2 of 19] Compiling Data.Vector.Fusion.Util ( Data/Vector/Fusion/Util.hs, > dist/build/Data/Vector/Fusion/Util.o ) > [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( > Data/Vector/Fusion/Stream/Size.hs, > dist/build/Data/Vector/Fusion/Stream/Size.o ) > > Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: > No explicit method or default declaration for `*' > In the instance declaration for `Num Size' > > Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: > No explicit method or default declaration for `abs' > In the instance declaration for `Num Size' > > Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: > No explicit method or default declaration for `signum' > In the instance declaration for `Num Size' > [ 4 of 19] Compiling Data.Vector.Internal.Check ( > Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) > [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( > Data/Vector/Fusion/Stream/Monadic.hs, > dist/build/Data/Vector/Fusion/Stream/Monadic.o ) > Loading package ghc-prim ... linking ... done. > Loading package integer-gmp ... linking ... done. > Loading package base ... : can't load .so/.DLL for: > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib > (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, > 9): no suitable image found. Did find: > > /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: > mach-o, but wrong filetype) > Failed to install vector-0.10.9.1 > cabal: Error: some packages failed to install: > vector-0.10.9.1 failed during the building phase. The exception was: > ExitFailure 1 > > > > I've did the trick of installing gcc-4.8 as described here: > > > http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 > > I'm running a compiled version of ghc 7.6.3 (so not installed via the > Haskell platform). > > Have anyone stumbled upon this? > > Thanks, > Alfredo > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo.dinapoli at gmail.com Sat Nov 2 22:02:21 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sat, 2 Nov 2013 22:02:21 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: Hi Carter, I do have Xcode 5 installed, this is the strange thing. Do you suggest to try reinstall Xcode or to downgrade gcc? (I'm using 4.8 atm). Also, the error is triggered by base, do you think I should try reinstalling ghc compiling with the newly installed gcc? Thanks, A. On 2 November 2013 21:09, Carter Schonwald wrote: > You need to have xcode 5 installed if you wish for the lib issues to go > way if you're using the gcc approach, it sounds like you don't have xcode 5 > installed. > > > > > On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < > alfredo.dinapoli at gmail.com> wrote: > >> Hello Caf?, >> this is what I'm getting: >> >> >> ??$ cabal install vector-0.10.9.1 >> 1 ? >> Resolving dependencies... >> Configuring vector-0.10.9.1... >> Building vector-0.10.9.1... >> Preprocessing library vector-0.10.9.1... >> [ 1 of 19] Compiling Data.Vector.Storable.Internal ( >> Data/Vector/Storable/Internal.hs, >> dist/build/Data/Vector/Storable/Internal.o ) >> [ 2 of 19] Compiling Data.Vector.Fusion.Util ( >> Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) >> [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( >> Data/Vector/Fusion/Stream/Size.hs, >> dist/build/Data/Vector/Fusion/Stream/Size.o ) >> >> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >> No explicit method or default declaration for `*' >> In the instance declaration for `Num Size' >> >> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >> No explicit method or default declaration for `abs' >> In the instance declaration for `Num Size' >> >> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >> No explicit method or default declaration for `signum' >> In the instance declaration for `Num Size' >> [ 4 of 19] Compiling Data.Vector.Internal.Check ( >> Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) >> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( >> Data/Vector/Fusion/Stream/Monadic.hs, >> dist/build/Data/Vector/Fusion/Stream/Monadic.o ) >> Loading package ghc-prim ... linking ... done. >> Loading package integer-gmp ... linking ... done. >> Loading package base ... : can't load .so/.DLL for: >> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib >> (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, >> 9): no suitable image found. Did find: >> >> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: >> mach-o, but wrong filetype) >> Failed to install vector-0.10.9.1 >> cabal: Error: some packages failed to install: >> vector-0.10.9.1 failed during the building phase. The exception was: >> ExitFailure 1 >> >> >> >> I've did the trick of installing gcc-4.8 as described here: >> >> >> http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 >> >> I'm running a compiled version of ghc 7.6.3 (so not installed via the >> Haskell platform). >> >> Have anyone stumbled upon this? >> >> Thanks, >> Alfredo >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat Nov 2 22:23:37 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 2 Nov 2013 18:23:37 -0400 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: i have no clue. Doesn't GHC also come prebuilt with Vector? might be worth filing a ticket on GHC track too. perhaps. On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < alfredo.dinapoli at gmail.com> wrote: > Hi Carter, > > I do have Xcode 5 installed, this is the strange thing. > Do you suggest to try reinstall Xcode or to downgrade gcc? (I'm using 4.8 > atm). > Also, the error is triggered by base, do you think I should try > reinstalling ghc compiling with the newly installed gcc? > > Thanks, > A. > > > On 2 November 2013 21:09, Carter Schonwald wrote: > >> You need to have xcode 5 installed if you wish for the lib issues to go >> way if you're using the gcc approach, it sounds like you don't have xcode 5 >> installed. >> >> >> >> >> On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < >> alfredo.dinapoli at gmail.com> wrote: >> >>> Hello Caf?, >>> this is what I'm getting: >>> >>> >>> ??$ cabal install vector-0.10.9.1 >>> 1 ? >>> Resolving dependencies... >>> Configuring vector-0.10.9.1... >>> Building vector-0.10.9.1... >>> Preprocessing library vector-0.10.9.1... >>> [ 1 of 19] Compiling Data.Vector.Storable.Internal ( >>> Data/Vector/Storable/Internal.hs, >>> dist/build/Data/Vector/Storable/Internal.o ) >>> [ 2 of 19] Compiling Data.Vector.Fusion.Util ( >>> Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) >>> [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( >>> Data/Vector/Fusion/Stream/Size.hs, >>> dist/build/Data/Vector/Fusion/Stream/Size.o ) >>> >>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>> No explicit method or default declaration for `*' >>> In the instance declaration for `Num Size' >>> >>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>> No explicit method or default declaration for `abs' >>> In the instance declaration for `Num Size' >>> >>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>> No explicit method or default declaration for `signum' >>> In the instance declaration for `Num Size' >>> [ 4 of 19] Compiling Data.Vector.Internal.Check ( >>> Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) >>> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( >>> Data/Vector/Fusion/Stream/Monadic.hs, >>> dist/build/Data/Vector/Fusion/Stream/Monadic.o ) >>> Loading package ghc-prim ... linking ... done. >>> Loading package integer-gmp ... linking ... done. >>> Loading package base ... : can't load .so/.DLL for: >>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib >>> (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, >>> 9): no suitable image found. Did find: >>> >>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: >>> mach-o, but wrong filetype) >>> Failed to install vector-0.10.9.1 >>> cabal: Error: some packages failed to install: >>> vector-0.10.9.1 failed during the building phase. The exception was: >>> ExitFailure 1 >>> >>> >>> >>> I've did the trick of installing gcc-4.8 as described here: >>> >>> >>> http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 >>> >>> I'm running a compiled version of ghc 7.6.3 (so not installed via the >>> Haskell platform). >>> >>> Have anyone stumbled upon this? >>> >>> Thanks, >>> Alfredo >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo.dinapoli at gmail.com Sat Nov 2 22:40:56 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sat, 2 Nov 2013 22:40:56 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: I'm trying to fiddle with clang scripts from Manuel Chakavarty and this one: https://gist.github.com/mzero/7245290 the former works (vector builds fine), but when installing Snap it generates the following error: Loading package network-2.4.2.0 ... GHCi runtime linker: fatal error: I found a duplicate definition for symbol _hsnet_freeaddrinfo whilst processing object file /Users/adinapoli/programming/haskell/faceguess/.cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/network-2.4.2.0/libHSnetwork-2.4.2.0.a This could be caused by: * Loading two different object files which export the same symbol * Specifying the same object file twice on the GHCi command line * An incorrect `package.conf' entry, causing some object to be loaded twice. GHCi cannot safely continue in this situation. Exiting now. Sorry. Failed to install snap-0.13.0.4 cabal: Error: some packages failed to install: snap-0.13.0.4 failed during the building phase. The exception was: ExitFailure 1 I haven't tried the latter, though. A. On 2 November 2013 22:23, Carter Schonwald wrote: > i have no clue. Doesn't GHC also come prebuilt with Vector? > > might be worth filing a ticket on GHC track too. perhaps. > > > On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < > alfredo.dinapoli at gmail.com> wrote: > >> Hi Carter, >> >> I do have Xcode 5 installed, this is the strange thing. >> Do you suggest to try reinstall Xcode or to downgrade gcc? (I'm using 4.8 >> atm). >> Also, the error is triggered by base, do you think I should try >> reinstalling ghc compiling with the newly installed gcc? >> >> Thanks, >> A. >> >> >> On 2 November 2013 21:09, Carter Schonwald wrote: >> >>> You need to have xcode 5 installed if you wish for the lib issues to go >>> way if you're using the gcc approach, it sounds like you don't have xcode 5 >>> installed. >>> >>> >>> >>> >>> On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < >>> alfredo.dinapoli at gmail.com> wrote: >>> >>>> Hello Caf?, >>>> this is what I'm getting: >>>> >>>> >>>> ??$ cabal install vector-0.10.9.1 >>>> 1 ? >>>> Resolving dependencies... >>>> Configuring vector-0.10.9.1... >>>> Building vector-0.10.9.1... >>>> Preprocessing library vector-0.10.9.1... >>>> [ 1 of 19] Compiling Data.Vector.Storable.Internal ( >>>> Data/Vector/Storable/Internal.hs, >>>> dist/build/Data/Vector/Storable/Internal.o ) >>>> [ 2 of 19] Compiling Data.Vector.Fusion.Util ( >>>> Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) >>>> [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( >>>> Data/Vector/Fusion/Stream/Size.hs, >>>> dist/build/Data/Vector/Fusion/Stream/Size.o ) >>>> >>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>> No explicit method or default declaration for `*' >>>> In the instance declaration for `Num Size' >>>> >>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>> No explicit method or default declaration for `abs' >>>> In the instance declaration for `Num Size' >>>> >>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>> No explicit method or default declaration for `signum' >>>> In the instance declaration for `Num Size' >>>> [ 4 of 19] Compiling Data.Vector.Internal.Check ( >>>> Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) >>>> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( >>>> Data/Vector/Fusion/Stream/Monadic.hs, >>>> dist/build/Data/Vector/Fusion/Stream/Monadic.o ) >>>> Loading package ghc-prim ... linking ... done. >>>> Loading package integer-gmp ... linking ... done. >>>> Loading package base ... : can't load .so/.DLL for: >>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib >>>> (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, >>>> 9): no suitable image found. Did find: >>>> >>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: >>>> mach-o, but wrong filetype) >>>> Failed to install vector-0.10.9.1 >>>> cabal: Error: some packages failed to install: >>>> vector-0.10.9.1 failed during the building phase. The exception was: >>>> ExitFailure 1 >>>> >>>> >>>> >>>> I've did the trick of installing gcc-4.8 as described here: >>>> >>>> >>>> http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 >>>> >>>> I'm running a compiled version of ghc 7.6.3 (so not installed via the >>>> Haskell platform). >>>> >>>> Have anyone stumbled upon this? >>>> >>>> Thanks, >>>> Alfredo >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johan.tibell at gmail.com Sat Nov 2 22:44:55 2013 From: johan.tibell at gmail.com (Johan Tibell) Date: Sat, 2 Nov 2013 23:44:55 +0100 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: True. Although to be honest I want something true and tested when it comes to crypto. On Sat, Nov 2, 2013 at 9:41 PM, Scott Lawrence wrote: > I believe tls and tls-extra (http://hackage.haskell.org/package/tls-1.1.5) > satisfy those requirements, being pure haskell. > > > On Sat, 2 Nov 2013, Johan Tibell wrote: > > Hi, >> >> On Sat, Nov 2, 2013 at 8:25 PM, Eli Frey wrote: >> >> I am also concerned that cabal does not have support for SSL, but hackage >>> must come first and at least then a sufficiently paranoid person can >>> download their packages over https and ad them to their cabal sandboxes. >>> >>> >> We need an SSL library that cabal can depend on. This means that it needs >> to be cross-platform, not pull in too many other depedencies, etc. Someone >> needs to investigate the options and perhaps write a new binding if >> needed. >> >> -- Johan >> >> > -- > Scott Lawrence > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo.dinapoli at gmail.com Sat Nov 2 23:14:51 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sat, 2 Nov 2013 23:14:51 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: Ok, for the lost souls which will find this thread, I've solved the problem in two steps: a) Used the script here: http://justtesting.org/post/64947952690/the-glasgow-haskell-compiler-ghc-on-os-x-10-9 b) Specifically for the snap problem, I've solved it following the FAQ here: http://www.haskell.org/haskellwiki/GHC/FAQ#I_get_an_error_message_from_GHCi_about_a_.22duplicate_definition_for_symbol_module_registered.22 The command was: cabal install snap --ld-options="-x" HTH, A. On 2 November 2013 22:40, Alfredo Di Napoli wrote: > I'm trying to fiddle with clang scripts from Manuel Chakavarty and this > one: > > https://gist.github.com/mzero/7245290 > > the former works (vector builds fine), but when installing Snap it > generates the following error: > > Loading package network-2.4.2.0 ... > > GHCi runtime linker: fatal error: I found a duplicate definition for symbol > _hsnet_freeaddrinfo > whilst processing object file > > /Users/adinapoli/programming/haskell/faceguess/.cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/network-2.4.2.0/libHSnetwork-2.4.2.0.a > This could be caused by: > * Loading two different object files which export the same symbol > * Specifying the same object file twice on the GHCi command line > * An incorrect `package.conf' entry, causing some object to be > loaded twice. > GHCi cannot safely continue in this situation. Exiting now. Sorry. > > Failed to install snap-0.13.0.4 > cabal: Error: some packages failed to install: > snap-0.13.0.4 failed during the building phase. The exception was: > ExitFailure 1 > > > I haven't tried the latter, though. > > A. > > > On 2 November 2013 22:23, Carter Schonwald wrote: > >> i have no clue. Doesn't GHC also come prebuilt with Vector? >> >> might be worth filing a ticket on GHC track too. perhaps. >> >> >> On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < >> alfredo.dinapoli at gmail.com> wrote: >> >>> Hi Carter, >>> >>> I do have Xcode 5 installed, this is the strange thing. >>> Do you suggest to try reinstall Xcode or to downgrade gcc? (I'm using >>> 4.8 atm). >>> Also, the error is triggered by base, do you think I should try >>> reinstalling ghc compiling with the newly installed gcc? >>> >>> Thanks, >>> A. >>> >>> >>> On 2 November 2013 21:09, Carter Schonwald wrote: >>> >>>> You need to have xcode 5 installed if you wish for the lib issues to go >>>> way if you're using the gcc approach, it sounds like you don't have xcode 5 >>>> installed. >>>> >>>> >>>> >>>> >>>> On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < >>>> alfredo.dinapoli at gmail.com> wrote: >>>> >>>>> Hello Caf?, >>>>> this is what I'm getting: >>>>> >>>>> >>>>> ??$ cabal install vector-0.10.9.1 >>>>> 1 ? >>>>> Resolving dependencies... >>>>> Configuring vector-0.10.9.1... >>>>> Building vector-0.10.9.1... >>>>> Preprocessing library vector-0.10.9.1... >>>>> [ 1 of 19] Compiling Data.Vector.Storable.Internal ( >>>>> Data/Vector/Storable/Internal.hs, >>>>> dist/build/Data/Vector/Storable/Internal.o ) >>>>> [ 2 of 19] Compiling Data.Vector.Fusion.Util ( >>>>> Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) >>>>> [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( >>>>> Data/Vector/Fusion/Stream/Size.hs, >>>>> dist/build/Data/Vector/Fusion/Stream/Size.o ) >>>>> >>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>> No explicit method or default declaration for `*' >>>>> In the instance declaration for `Num Size' >>>>> >>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>> No explicit method or default declaration for `abs' >>>>> In the instance declaration for `Num Size' >>>>> >>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>> No explicit method or default declaration for `signum' >>>>> In the instance declaration for `Num Size' >>>>> [ 4 of 19] Compiling Data.Vector.Internal.Check ( >>>>> Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) >>>>> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( >>>>> Data/Vector/Fusion/Stream/Monadic.hs, >>>>> dist/build/Data/Vector/Fusion/Stream/Monadic.o ) >>>>> Loading package ghc-prim ... linking ... done. >>>>> Loading package integer-gmp ... linking ... done. >>>>> Loading package base ... : can't load .so/.DLL for: >>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib >>>>> (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, >>>>> 9): no suitable image found. Did find: >>>>> >>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: >>>>> mach-o, but wrong filetype) >>>>> Failed to install vector-0.10.9.1 >>>>> cabal: Error: some packages failed to install: >>>>> vector-0.10.9.1 failed during the building phase. The exception was: >>>>> ExitFailure 1 >>>>> >>>>> >>>>> >>>>> I've did the trick of installing gcc-4.8 as described here: >>>>> >>>>> >>>>> http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 >>>>> >>>>> I'm running a compiled version of ghc 7.6.3 (so not installed via the >>>>> Haskell platform). >>>>> >>>>> Have anyone stumbled upon this? >>>>> >>>>> Thanks, >>>>> Alfredo >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo.dinapoli at gmail.com Sat Nov 2 23:17:15 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sat, 2 Nov 2013 23:17:15 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: Oh, before I forgot (sorry for the spam): The above cabal cmd worked NOT in a cabal sandbox. Issuing that into a cabal sandbox still triggers the problems. I'll try to ask into the cabal issue tracker to see if I discover something. A. On 2 November 2013 23:14, Alfredo Di Napoli wrote: > Ok, for the lost souls which will find this thread, I've solved the > problem in two steps: > > a) Used the script here: > http://justtesting.org/post/64947952690/the-glasgow-haskell-compiler-ghc-on-os-x-10-9 > > b) Specifically for the snap problem, I've solved it following the FAQ > here: > http://www.haskell.org/haskellwiki/GHC/FAQ#I_get_an_error_message_from_GHCi_about_a_.22duplicate_definition_for_symbol_module_registered.22 > > The command was: > cabal install snap --ld-options="-x" > > HTH, > A. > > > On 2 November 2013 22:40, Alfredo Di Napoli wrote: > >> I'm trying to fiddle with clang scripts from Manuel Chakavarty and this >> one: >> >> https://gist.github.com/mzero/7245290 >> >> the former works (vector builds fine), but when installing Snap it >> generates the following error: >> >> Loading package network-2.4.2.0 ... >> >> GHCi runtime linker: fatal error: I found a duplicate definition for >> symbol >> _hsnet_freeaddrinfo >> whilst processing object file >> >> /Users/adinapoli/programming/haskell/faceguess/.cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/network-2.4.2.0/libHSnetwork-2.4.2.0.a >> This could be caused by: >> * Loading two different object files which export the same symbol >> * Specifying the same object file twice on the GHCi command line >> * An incorrect `package.conf' entry, causing some object to be >> loaded twice. >> GHCi cannot safely continue in this situation. Exiting now. Sorry. >> >> Failed to install snap-0.13.0.4 >> cabal: Error: some packages failed to install: >> snap-0.13.0.4 failed during the building phase. The exception was: >> ExitFailure 1 >> >> >> I haven't tried the latter, though. >> >> A. >> >> >> On 2 November 2013 22:23, Carter Schonwald wrote: >> >>> i have no clue. Doesn't GHC also come prebuilt with Vector? >>> >>> might be worth filing a ticket on GHC track too. perhaps. >>> >>> >>> On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < >>> alfredo.dinapoli at gmail.com> wrote: >>> >>>> Hi Carter, >>>> >>>> I do have Xcode 5 installed, this is the strange thing. >>>> Do you suggest to try reinstall Xcode or to downgrade gcc? (I'm using >>>> 4.8 atm). >>>> Also, the error is triggered by base, do you think I should try >>>> reinstalling ghc compiling with the newly installed gcc? >>>> >>>> Thanks, >>>> A. >>>> >>>> >>>> On 2 November 2013 21:09, Carter Schonwald wrote: >>>> >>>>> You need to have xcode 5 installed if you wish for the lib issues to >>>>> go way if you're using the gcc approach, it sounds like you don't have >>>>> xcode 5 installed. >>>>> >>>>> >>>>> >>>>> >>>>> On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < >>>>> alfredo.dinapoli at gmail.com> wrote: >>>>> >>>>>> Hello Caf?, >>>>>> this is what I'm getting: >>>>>> >>>>>> >>>>>> ??$ cabal install vector-0.10.9.1 >>>>>> 1 ? >>>>>> Resolving dependencies... >>>>>> Configuring vector-0.10.9.1... >>>>>> Building vector-0.10.9.1... >>>>>> Preprocessing library vector-0.10.9.1... >>>>>> [ 1 of 19] Compiling Data.Vector.Storable.Internal ( >>>>>> Data/Vector/Storable/Internal.hs, >>>>>> dist/build/Data/Vector/Storable/Internal.o ) >>>>>> [ 2 of 19] Compiling Data.Vector.Fusion.Util ( >>>>>> Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) >>>>>> [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( >>>>>> Data/Vector/Fusion/Stream/Size.hs, >>>>>> dist/build/Data/Vector/Fusion/Stream/Size.o ) >>>>>> >>>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>>> No explicit method or default declaration for `*' >>>>>> In the instance declaration for `Num Size' >>>>>> >>>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>>> No explicit method or default declaration for `abs' >>>>>> In the instance declaration for `Num Size' >>>>>> >>>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>>> No explicit method or default declaration for `signum' >>>>>> In the instance declaration for `Num Size' >>>>>> [ 4 of 19] Compiling Data.Vector.Internal.Check ( >>>>>> Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) >>>>>> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( >>>>>> Data/Vector/Fusion/Stream/Monadic.hs, >>>>>> dist/build/Data/Vector/Fusion/Stream/Monadic.o ) >>>>>> Loading package ghc-prim ... linking ... done. >>>>>> Loading package integer-gmp ... linking ... done. >>>>>> Loading package base ... : can't load .so/.DLL for: >>>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib >>>>>> (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, >>>>>> 9): no suitable image found. Did find: >>>>>> >>>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: >>>>>> mach-o, but wrong filetype) >>>>>> Failed to install vector-0.10.9.1 >>>>>> cabal: Error: some packages failed to install: >>>>>> vector-0.10.9.1 failed during the building phase. The exception was: >>>>>> ExitFailure 1 >>>>>> >>>>>> >>>>>> >>>>>> I've did the trick of installing gcc-4.8 as described here: >>>>>> >>>>>> >>>>>> http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 >>>>>> >>>>>> I'm running a compiled version of ghc 7.6.3 (so not installed via the >>>>>> Haskell platform). >>>>>> >>>>>> Have anyone stumbled upon this? >>>>>> >>>>>> Thanks, >>>>>> Alfredo >>>>>> >>>>>> _______________________________________________ >>>>>> Haskell-Cafe mailing list >>>>>> Haskell-Cafe at haskell.org >>>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Sun Nov 3 05:46:04 2013 From: magnus at therning.org (Magnus Therning) Date: Sun, 3 Nov 2013 06:46:04 +0100 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: <5272C89B.3070302@vex.net> References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> Message-ID: <20131103054604.GB2047@mteis> On Thu, Oct 31, 2013 at 05:16:11PM -0400, Albert Y. C. Lai wrote: > On 13-10-31 04:26 PM, Magnus Therning wrote: > >We've had a discussion about DSOs on the arch-haskell mailing list[1] > >and it made me realise one thing: > > > > --enable-shared will cause the generation of DSOs for libraries, but > > it won't cause executables to be dynamically linked > > > >Is the only way to cause these executables to be dynamically linked > >against their dependencies to pass the -dynamic flag to ghc (e.g. via > >the --ghc-options flag when configuring the package)? > > Have you seen --enable-executable-dynamic? It's there since cabal-install > 0.14 or earlier. It is also available to Setup.hs since Cabal 1.14 or > earlier, which came with GHC 7.4. > > Have you done a "cabal install --help | less" lately? Also "cabal configure > --help | less". Now I have tried the `--enable-executable-dynamic` flag and have found one problem with it, it doesn't work that well for packages that have both executables and a library. I tried it on pandoc. Here's what I got: % file /usr/bin/pandoc % /usr/bin/pandoc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=bb046a49bb820ab4d592d154bd0a5064f40bba5b, stripped So far so good, but % pandoc --help pandoc: error while loading shared libraries: libHSpandoc-1.12.1-ghc7.6.3.so: cannot open shared object file: No such file or directory The DSO is installed though % pacman -Ql haskell-pandoc|grep libHSpandoc haskell-pandoc /usr/lib/ghc-7.6.3/site-local/pandoc-1.12.1/libHSpandoc-1.12.1-ghc7.6.3.so haskell-pandoc /usr/lib/ghc-7.6.3/site-local/pandoc-1.12.1/libHSpandoc-1.12.1.a haskell-pandoc /usr/lib/ghc-7.6.3/site-local/pandoc-1.12.1/libHSpandoc-1.12.1_p.a It just can't be found % ldd /usr/bin/pandoc|grep libHSpandoc libHSpandoc-1.12.1-ghc7.6.3.so => not found libHSpandoc-types-1.12.3-ghc7.6.3.so => /usr/lib/ghc-7.6.3/site-local/pandoc-types-1.12.3/libHSpandoc-types-1.12.3-ghc7.6.3.so (0x00007f60bf3e1000) The problem is that RPATH doesn't contain the location where the *installed* pandoc lib ends up, but only the location where the pandoc lib is *built*: % readelf -d /usr/bin/pandoc|grep RPATH|head 0x000000000000000f (RPATH) Library rpath: [/build/haskell-pandoc/src/pandoc-1.12.1/dist/build:/usr/lib/ghc-7.6.3/site-local/zip-archive-0.1.4:/usr/lib/ghc... Is there already a way to get Cabal to put in an RPATH such that an *installed* executable works correctly, or is this a fairly serious bug in Cabal? /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus Some operating systems are called 'user friendly', Linux however is 'expert friendly'. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From carter.schonwald at gmail.com Sun Nov 3 06:27:06 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 3 Nov 2013 01:27:06 -0500 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: <20131103054604.GB2047@mteis> References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> <20131103054604.GB2047@mteis> Message-ID: could you file a bug report on the cabal issue tracker? github.com/haskell/cabal/issues :) On Sun, Nov 3, 2013 at 1:46 AM, Magnus Therning wrote: > On Thu, Oct 31, 2013 at 05:16:11PM -0400, Albert Y. C. Lai wrote: > > On 13-10-31 04:26 PM, Magnus Therning wrote: > > >We've had a discussion about DSOs on the arch-haskell mailing list[1] > > >and it made me realise one thing: > > > > > > --enable-shared will cause the generation of DSOs for libraries, but > > > it won't cause executables to be dynamically linked > > > > > >Is the only way to cause these executables to be dynamically linked > > >against their dependencies to pass the -dynamic flag to ghc (e.g. via > > >the --ghc-options flag when configuring the package)? > > > > Have you seen --enable-executable-dynamic? It's there since cabal-install > > 0.14 or earlier. It is also available to Setup.hs since Cabal 1.14 or > > earlier, which came with GHC 7.4. > > > > Have you done a "cabal install --help | less" lately? Also "cabal > configure > > --help | less". > > Now I have tried the `--enable-executable-dynamic` flag and have found > one problem with it, it doesn't work that well for packages that have > both executables and a library. > > I tried it on pandoc. Here's what I got: > > % file /usr/bin/pandoc > % /usr/bin/pandoc: ELF 64-bit LSB executable, x86-64, version 1 > (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, > BuildID[sha1]=bb046a49bb820ab4d592d154bd0a5064f40bba5b, stripped > > So far so good, but > > % pandoc --help > pandoc: error while loading shared libraries: > libHSpandoc-1.12.1-ghc7.6.3.so: cannot open shared object file: No such > file or directory > > The DSO is installed though > > % pacman -Ql haskell-pandoc|grep libHSpandoc > haskell-pandoc /usr/lib/ghc-7.6.3/site-local/pandoc-1.12.1/ > libHSpandoc-1.12.1-ghc7.6.3.so > haskell-pandoc > /usr/lib/ghc-7.6.3/site-local/pandoc-1.12.1/libHSpandoc-1.12.1.a > haskell-pandoc > /usr/lib/ghc-7.6.3/site-local/pandoc-1.12.1/libHSpandoc-1.12.1_p.a > > It just can't be found > > % ldd /usr/bin/pandoc|grep libHSpandoc > libHSpandoc-1.12.1-ghc7.6.3.so => not found > libHSpandoc-types-1.12.3-ghc7.6.3.so => > /usr/lib/ghc-7.6.3/site-local/pandoc-types-1.12.3/ > libHSpandoc-types-1.12.3-ghc7.6.3.so (0x00007f60bf3e1000) > > The problem is that RPATH doesn't contain the location where the > *installed* pandoc lib ends up, but only the location where the pandoc lib > is *built*: > > % readelf -d /usr/bin/pandoc|grep RPATH|head > 0x000000000000000f (RPATH) Library rpath: > [/build/haskell-pandoc/src/pandoc-1.12.1/dist/build:/usr/lib/ghc-7.6.3/site-local/zip-archive-0.1.4:/usr/lib/ghc... > > Is there already a way to get Cabal to put in an RPATH such that an > *installed* > executable works correctly, or is this a fairly serious bug in Cabal? > > /M > > -- > Magnus Therning OpenPGP: 0xAB4DFBA4 > email: magnus at therning.org jabber: magnus at therning.org > twitter: magthe http://therning.org/magnus > > Some operating systems are called 'user friendly', Linux however is > 'expert friendly'. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From johnw at fpcomplete.com Sun Nov 3 07:02:16 2013 From: johnw at fpcomplete.com (John Wiegley) Date: Sun, 03 Nov 2013 01:02:16 -0600 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: (Johan Tibell's message of "Sat, 2 Nov 2013 23:44:55 +0100") References: Message-ID: >>>>> Johan Tibell writes: > True. Although to be honest I want something true and tested when it comes > to crypto. Although in this case, the worst scenario is that we return to parity with the status quo (i.e., the security lib is worthless and we revert back to having no security). -- John Wiegley FP Complete Haskell tools, training and consulting http://fpcomplete.com johnw on #haskell/irc.freenode.net From magnus at therning.org Sun Nov 3 09:15:26 2013 From: magnus at therning.org (Magnus Therning) Date: Sun, 3 Nov 2013 10:15:26 +0100 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> <20131103054604.GB2047@mteis> Message-ID: <20131103091526.GA4120@mteis> On Sun, Nov 03, 2013 at 01:27:06AM -0500, Carter Schonwald wrote: > could you file a bug report on the cabal issue tracker? > github.com/haskell/cabal/issues :) Done, it became issue #1568 [1]. I'm hopeful it's a simple fix and that we can see a backport to 1.16 as well as a fix for 1.18 ;) /M [1]: https://github.com/haskell/cabal/issues/1568 -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus I would rather use Java than Perl. And I'd rather be eaten by a crocodile than use Java. -- Trouser -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From alfredo.dinapoli at gmail.com Sun Nov 3 09:22:07 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sun, 3 Nov 2013 09:22:07 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: Eventually, this is what worked for me (so gcc 4.8 was a no-go for me): http://haskell-workshop.github.io/tutorials/osx/2013-10-23-mavericks-ghc.html HTH, A. On 2 November 2013 23:17, Alfredo Di Napoli wrote: > Oh, before I forgot (sorry for the spam): > > The above cabal cmd worked NOT in a cabal sandbox. Issuing that into a > cabal sandbox still triggers the problems. I'll try to ask into the cabal > issue tracker to see if I discover something. > > A. > > > On 2 November 2013 23:14, Alfredo Di Napoli wrote: > >> Ok, for the lost souls which will find this thread, I've solved the >> problem in two steps: >> >> a) Used the script here: >> http://justtesting.org/post/64947952690/the-glasgow-haskell-compiler-ghc-on-os-x-10-9 >> >> b) Specifically for the snap problem, I've solved it following the FAQ >> here: >> http://www.haskell.org/haskellwiki/GHC/FAQ#I_get_an_error_message_from_GHCi_about_a_.22duplicate_definition_for_symbol_module_registered.22 >> >> The command was: >> cabal install snap --ld-options="-x" >> >> HTH, >> A. >> >> >> On 2 November 2013 22:40, Alfredo Di Napoli wrote: >> >>> I'm trying to fiddle with clang scripts from Manuel Chakavarty and this >>> one: >>> >>> https://gist.github.com/mzero/7245290 >>> >>> the former works (vector builds fine), but when installing Snap it >>> generates the following error: >>> >>> Loading package network-2.4.2.0 ... >>> >>> GHCi runtime linker: fatal error: I found a duplicate definition for >>> symbol >>> _hsnet_freeaddrinfo >>> whilst processing object file >>> >>> /Users/adinapoli/programming/haskell/faceguess/.cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/network-2.4.2.0/libHSnetwork-2.4.2.0.a >>> This could be caused by: >>> * Loading two different object files which export the same symbol >>> * Specifying the same object file twice on the GHCi command line >>> * An incorrect `package.conf' entry, causing some object to be >>> loaded twice. >>> GHCi cannot safely continue in this situation. Exiting now. Sorry. >>> >>> Failed to install snap-0.13.0.4 >>> cabal: Error: some packages failed to install: >>> snap-0.13.0.4 failed during the building phase. The exception was: >>> ExitFailure 1 >>> >>> >>> I haven't tried the latter, though. >>> >>> A. >>> >>> >>> On 2 November 2013 22:23, Carter Schonwald wrote: >>> >>>> i have no clue. Doesn't GHC also come prebuilt with Vector? >>>> >>>> might be worth filing a ticket on GHC track too. perhaps. >>>> >>>> >>>> On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < >>>> alfredo.dinapoli at gmail.com> wrote: >>>> >>>>> Hi Carter, >>>>> >>>>> I do have Xcode 5 installed, this is the strange thing. >>>>> Do you suggest to try reinstall Xcode or to downgrade gcc? (I'm using >>>>> 4.8 atm). >>>>> Also, the error is triggered by base, do you think I should try >>>>> reinstalling ghc compiling with the newly installed gcc? >>>>> >>>>> Thanks, >>>>> A. >>>>> >>>>> >>>>> On 2 November 2013 21:09, Carter Schonwald >>>> > wrote: >>>>> >>>>>> You need to have xcode 5 installed if you wish for the lib issues to >>>>>> go way if you're using the gcc approach, it sounds like you don't have >>>>>> xcode 5 installed. >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Sat, Nov 2, 2013 at 5:06 PM, Alfredo Di Napoli < >>>>>> alfredo.dinapoli at gmail.com> wrote: >>>>>> >>>>>>> Hello Caf?, >>>>>>> this is what I'm getting: >>>>>>> >>>>>>> >>>>>>> ??$ cabal install vector-0.10.9.1 >>>>>>> 1 ? >>>>>>> Resolving dependencies... >>>>>>> Configuring vector-0.10.9.1... >>>>>>> Building vector-0.10.9.1... >>>>>>> Preprocessing library vector-0.10.9.1... >>>>>>> [ 1 of 19] Compiling Data.Vector.Storable.Internal ( >>>>>>> Data/Vector/Storable/Internal.hs, >>>>>>> dist/build/Data/Vector/Storable/Internal.o ) >>>>>>> [ 2 of 19] Compiling Data.Vector.Fusion.Util ( >>>>>>> Data/Vector/Fusion/Util.hs, dist/build/Data/Vector/Fusion/Util.o ) >>>>>>> [ 3 of 19] Compiling Data.Vector.Fusion.Stream.Size ( >>>>>>> Data/Vector/Fusion/Stream/Size.hs, >>>>>>> dist/build/Data/Vector/Fusion/Stream/Size.o ) >>>>>>> >>>>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>>>> No explicit method or default declaration for `*' >>>>>>> In the instance declaration for `Num Size' >>>>>>> >>>>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>>>> No explicit method or default declaration for `abs' >>>>>>> In the instance declaration for `Num Size' >>>>>>> >>>>>>> Data/Vector/Fusion/Stream/Size.hs:25:10: Warning: >>>>>>> No explicit method or default declaration for `signum' >>>>>>> In the instance declaration for `Num Size' >>>>>>> [ 4 of 19] Compiling Data.Vector.Internal.Check ( >>>>>>> Data/Vector/Internal/Check.hs, dist/build/Data/Vector/Internal/Check.o ) >>>>>>> [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( >>>>>>> Data/Vector/Fusion/Stream/Monadic.hs, >>>>>>> dist/build/Data/Vector/Fusion/Stream/Monadic.o ) >>>>>>> Loading package ghc-prim ... linking ... done. >>>>>>> Loading package integer-gmp ... linking ... done. >>>>>>> Loading package base ... : can't load .so/.DLL for: >>>>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib >>>>>>> (dlopen(/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib, >>>>>>> 9): no suitable image found. Did find: >>>>>>> >>>>>>> /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libiconv.dylib: >>>>>>> mach-o, but wrong filetype) >>>>>>> Failed to install vector-0.10.9.1 >>>>>>> cabal: Error: some packages failed to install: >>>>>>> vector-0.10.9.1 failed during the building phase. The exception was: >>>>>>> ExitFailure 1 >>>>>>> >>>>>>> >>>>>>> >>>>>>> I've did the trick of installing gcc-4.8 as described here: >>>>>>> >>>>>>> >>>>>>> http://cp.reddit.com/r/haskell/comments/1ozukp/anyone_running_ghc_763_on_osx_mavericks/ccxpla5 >>>>>>> >>>>>>> I'm running a compiled version of ghc 7.6.3 (so not installed via >>>>>>> the Haskell platform). >>>>>>> >>>>>>> Have anyone stumbled upon this? >>>>>>> >>>>>>> Thanks, >>>>>>> Alfredo >>>>>>> >>>>>>> _______________________________________________ >>>>>>> Haskell-Cafe mailing list >>>>>>> Haskell-Cafe at haskell.org >>>>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bytbox at gmail.com Sun Nov 3 09:48:59 2013 From: bytbox at gmail.com (Scott Lawrence) Date: Sun, 3 Nov 2013 04:48:59 -0500 (EST) Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: One could argue that the potential for a false sense of security could make (very) bad encryption worse than no encryption. Personally, I've always been a bit uncomfortable with the small number of widely-used implementations (AFAIK OpenSSL and GnuTLS combined account for pretty much all TLS-using open-source software), and I think pushing another one into wider usage would be a good thing (while acknowledging that it's likely more vulnerable than the older implementations). On Sun, 3 Nov 2013, John Wiegley wrote: >>>>>> Johan Tibell writes: > >> True. Although to be honest I want something true and tested when it comes >> to crypto. > > Although in this case, the worst scenario is that we return to parity with the > status quo (i.e., the security lib is worthless and we revert back to having > no security). > > -- > John Wiegley > FP Complete Haskell tools, training and consulting > http://fpcomplete.com johnw on #haskell/irc.freenode.net > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Scott Lawrence From martin.drautzburg at web.de Sun Nov 3 13:46:53 2013 From: martin.drautzburg at web.de (martin) Date: Sun, 03 Nov 2013 14:46:53 +0100 Subject: [Haskell-cafe] How to avoid floods of fromIntegral (in ALSA.Sequencer) Message-ID: <527653CD.2030702@web.de> Hello all, in my recent attempts to work with ALSA.Sequencer, I frequently stumble across the problem that this library uses GHC.Word.Word8 (don't know where this comes from), but I am passing in plain Ints. Adding a fromIntegral solves this issue, but I end up with code like the following: type T = Int -- time type C = Int -- channel type N = Int -- note type V = Int -- velocity type L = Int -- LSB type M = Int -- MSB type P = Int -- program type X = Int -- something data DtzEvent = NoteOn C N V | NoteOff C N V | ProgChange C P | PitchBend C X | BankSelMsb C X | BankSelLsb C X ... playSong :: DtzEvents -> IO() playSong events = runContT (foo "128:0" 120 (map render events)) print where render (t,(NoteOn c n v)) = ((fromIntegral t), noteOn (fromIntegral c) (fromIntegral n) (fromIntegral v)) render (t,(NoteOff c n v)) = ((fromIntegral t), noteOff (fromIntegral c) (fromIntegral n) (fromIntegral v)) render (t,(ProgChange c p)) = ((fromIntegral t), progChange (fromIntegral c) (fromIntegral p)) render (t,(PitchBend c x)) = ((fromIntegral t), pitchBend (fromIntegral c) (fromIntegral x)) render (t,(BankSelMsb c x)) = ((fromIntegral t), bankSelMsb (fromIntegral c) (fromIntegral x)) render (t,(BankSelLsb c x)) = ((fromIntegral t), bankSelLsb (fromIntegral c) (fromIntegral x)) The last piece looks pretty ugly. Is there a way to avoid this? From mail at nh2.me Sun Nov 3 14:35:01 2013 From: mail at nh2.me (=?ISO-8859-1?Q?Niklas_Hamb=FCchen?=) Date: Sun, 03 Nov 2013 14:35:01 +0000 Subject: [Haskell-cafe] How to avoid floods of fromIntegral (in ALSA.Sequencer) In-Reply-To: <527653CD.2030702@web.de> References: <527653CD.2030702@web.de> Message-ID: <52765F15.9070504@nh2.me> It depends a bit: What is supposed to happen / what happens in your library when one of the numbers is larger than a Word8? That usually determines where / how the conversion fits in nicely. For example, if you already know that all the values in DtzEvent can only be Word8s, then they should probably already be Word8s and not Int. On 03/11/13 13:46, martin wrote: > Hello all, > > in my recent attempts to work with ALSA.Sequencer, I frequently stumble across the problem that this library uses > GHC.Word.Word8 (don't know where this comes from), but I am passing in plain Ints. Adding a fromIntegral solves this > issue, but I end up with code like the following: > > type T = Int -- time > type C = Int -- channel > type N = Int -- note > type V = Int -- velocity > type L = Int -- LSB > type M = Int -- MSB > type P = Int -- program > type X = Int -- something > > data DtzEvent = NoteOn C N V > | NoteOff C N V > | ProgChange C P > | PitchBend C X > | BankSelMsb C X > | BankSelLsb C X > ... > > playSong :: DtzEvents -> IO() > playSong events = runContT (foo "128:0" 120 (map render events)) print > where > render (t,(NoteOn c n v)) = ((fromIntegral t), noteOn (fromIntegral c) (fromIntegral n) (fromIntegral v)) > render (t,(NoteOff c n v)) = ((fromIntegral t), noteOff (fromIntegral c) (fromIntegral n) (fromIntegral v)) > render (t,(ProgChange c p)) = ((fromIntegral t), progChange (fromIntegral c) (fromIntegral p)) > render (t,(PitchBend c x)) = ((fromIntegral t), pitchBend (fromIntegral c) (fromIntegral x)) > render (t,(BankSelMsb c x)) = ((fromIntegral t), bankSelMsb (fromIntegral c) (fromIntegral x)) > render (t,(BankSelLsb c x)) = ((fromIntegral t), bankSelLsb (fromIntegral c) (fromIntegral x)) > > The last piece looks pretty ugly. Is there a way to avoid this? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From donn at avvanta.com Sun Nov 3 17:02:06 2013 From: donn at avvanta.com (Donn Cave) Date: Sun, 3 Nov 2013 09:02:06 -0800 (PST) Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: <20131103170206.6B020F393A@mail.avvanta.com> Quoth Johan Tibell, [ ... Re Haskell TLS implementation ] > True. Although to be honest I want something true and tested when it comes > to crypto. Don't believe in security by obscurity? How strongly do you feel about the cross platform and dependency issues? When I needed SSL encryption, I whipped up a little module with foreign calls to OpenSSL. For an ordinary client, which is all I use it for any more, it's a simple interface -- init, connect, read, write, a couple error functions. I have to link -lssl -lcrypto. The great thing about this is, not only do I have a high degree of confidence in the implementation, I don't expect it to _ever_ change in a way that will inconvenience me. If my application ever needs to work on a platform with a different SSL, just need a new module with init/connect/write etc. Does that seem like a possibility, just write minimal interfaces to existing platform standard SSL implementations, and move on to more interesting problems? Or is this really an area with interesting problems of its own that I'm missing? Donn From mike at izbicki.me Sun Nov 3 17:35:43 2013 From: mike at izbicki.me (Mike Izbicki) Date: Sun, 3 Nov 2013 09:35:43 -0800 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <20131103170206.6B020F393A@mail.avvanta.com> References: <20131103170206.6B020F393A@mail.avvanta.com> Message-ID: What's the standard practice for how FOSS software actually keeps a private key private? This requirement is rather counter cultural, and so I imagine it's often not done in a robust way. Do you typically just trust that whomever is in charge of the project didn't make any mistakes in the installation and didn't sellout the key to someone else? Or is there a way for other eyes to verify that everything happened correctly without exposing the private key to every contributor? On Sun, Nov 3, 2013 at 9:02 AM, Donn Cave wrote: > Quoth Johan Tibell, > [ ... Re Haskell TLS implementation ] > > > True. Although to be honest I want something true and tested when it > comes > > to crypto. > > Don't believe in security by obscurity? > > How strongly do you feel about the cross platform and dependency issues? > > When I needed SSL encryption, I whipped up a little module with foreign > calls to OpenSSL. For an ordinary client, which is all I use it for any > more, it's a simple interface -- init, connect, read, write, a couple > error functions. I have to link -lssl -lcrypto. The great thing about > this is, not only do I have a high degree of confidence in the > implementation, > I don't expect it to _ever_ change in a way that will inconvenience me. > If my application ever needs to work on a platform with a different SSL, > just need a new module with init/connect/write etc. > > Does that seem like a possibility, just write minimal interfaces to > existing platform standard SSL implementations, and move on to more > interesting problems? Or is this really an area with interesting problems > of its own that I'm missing? > > Donn > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martin.drautzburg at web.de Sun Nov 3 17:36:16 2013 From: martin.drautzburg at web.de (martin) Date: Sun, 03 Nov 2013 18:36:16 +0100 Subject: [Haskell-cafe] How to avoid floods of fromIntegral (in ALSA.Sequencer) In-Reply-To: <52765F15.9070504@nh2.me> References: <527653CD.2030702@web.de> <52765F15.9070504@nh2.me> Message-ID: <52768990.1060406@web.de> Am 11/03/2013 03:35 PM, schrieb Niklas Hamb?chen: > It depends a bit: > > What is supposed to happen / what happens in your library when one of > the numbers is larger than a Word8? > > That usually determines where / how the conversion fits in nicely. > > For example, if you already know that all the values in DtzEvent can > only be Word8s, then they should probably already be Word8s and not Int. Silly me, yes using Word8 instead of Ints got rid of most of the fromIntegrals. I didn't know that Word8 was an actual haskell type. Thought it was something private to ALSA.Sequencer. There is one remaining fromIntegral. This is "time" Couldn't match expected type `alsa-seq-0.6.0.2:Sound.ALSA.Sequencer.Marshal.Time.Tick' with actual type `T' This seems to be realy a private thing and I found to way other than fromIntegral to make the compiler happy. From carter.schonwald at gmail.com Sun Nov 3 17:41:56 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 3 Nov 2013 12:41:56 -0500 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: Those are the directions for using gcc-4.8 too. I wrote them. Sounds like you were actually not using GCC 4.8 before..? On Sunday, November 3, 2013, Alfredo Di Napoli wrote: > Eventually, this is what worked for me (so gcc 4.8 was a no-go for me): > > > http://haskell-workshop.github.io/tutorials/osx/2013-10-23-mavericks-ghc.html > > HTH, > A. > > > On 2 November 2013 23:17, Alfredo Di Napoli wrote: > > Oh, before I forgot (sorry for the spam): > > The above cabal cmd worked NOT in a cabal sandbox. Issuing that into a > cabal sandbox still triggers the problems. I'll try to ask into the cabal > issue tracker to see if I discover something. > > A. > > > On 2 November 2013 23:14, Alfredo Di Napoli wrote: > > Ok, for the lost souls which will find this thread, I've solved the > problem in two steps: > > a) Used the script here: > http://justtesting.org/post/64947952690/the-glasgow-haskell-compiler-ghc-on-os-x-10-9 > > b) Specifically for the snap problem, I've solved it following the FAQ > here: > http://www.haskell.org/haskellwiki/GHC/FAQ#I_get_an_error_message_from_GHCi_about_a_.22duplicate_definition_for_symbol_module_registered.22 > > The command was: > cabal install snap --ld-options="-x" > > HTH, > A. > > > On 2 November 2013 22:40, Alfredo Di Napoli wrote: > > I'm trying to fiddle with clang scripts from Manuel Chakavarty and this > one: > > https://gist.github.com/mzero/7245290 > > the former works (vector builds fine), but when installing Snap it > generates the following error: > > Loading package network-2.4.2.0 ... > > GHCi runtime linker: fatal error: I found a duplicate definition for symbol > _hsnet_freeaddrinfo > whilst processing object file > > /Users/adinapoli/programming/haskell/faceguess/.cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/network-2.4.2.0/libHSnetwork-2.4.2.0.a > This could be caused by: > * Loading two different object files which export the same symbol > * Specifying the same object file twice on the GHCi command line > * An incorrect `package.conf' entry, causing some object to be > loaded twice. > GHCi cannot safely continue in this situation. Exiting now. Sorry. > > Failed to install snap-0.13.0.4 > cabal: Error: some packages failed to install: > snap-0.13.0.4 failed during the building phase. The exception was: > ExitFailure 1 > > > I haven't tried the latter, though. > > A. > > > On 2 November 2013 22:23, Carter Schonwald wrote: > > i have no clue. Doesn't GHC also come prebuilt with Vector? > > might be worth filing a ticket on GHC track too. perhaps. > > > On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < > alfredo.dinapoli at gmail.com> wrote: > > Hi Carter, > > I do have Xcode 5 installed, this is the strange thing. > Do you suggest to try rei > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bytbox at gmail.com Sun Nov 3 17:49:39 2013 From: bytbox at gmail.com (Scott Lawrence) Date: Sun, 3 Nov 2013 12:49:39 -0500 (EST) Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: <20131103170206.6B020F393A@mail.avvanta.com> Message-ID: Even if you do expose the private key to other people, there's no way for them to know that the administrator didn't also send it somewhere else -- you can't prove that somebody hasn't duplicated information, without making sure they don't have access to the information (which the admin must). At the end of the day, trusting admins is what almost always happens. The other route is for packages to be individually signed by developers. As I recall, that's been explicitly discussed and informally rejected here before, on the grounds that it makes the uploading process significantly more cumbersome for many people. On Sun, 3 Nov 2013, Mike Izbicki wrote: > What's the standard practice for how FOSS software actually keeps a private > key private? This requirement is rather counter cultural, and so I imagine > it's often not done in a robust way. > > Do you typically just trust that whomever is in charge of the project > didn't make any mistakes in the installation and didn't sellout the key to > someone else? Or is there a way for other eyes to verify that everything > happened correctly without exposing the private key to every contributor? > > > On Sun, Nov 3, 2013 at 9:02 AM, Donn Cave wrote: > >> Quoth Johan Tibell, >> [ ... Re Haskell TLS implementation ] >> >>> True. Although to be honest I want something true and tested when it >> comes >>> to crypto. >> >> Don't believe in security by obscurity? >> >> How strongly do you feel about the cross platform and dependency issues? >> >> When I needed SSL encryption, I whipped up a little module with foreign >> calls to OpenSSL. For an ordinary client, which is all I use it for any >> more, it's a simple interface -- init, connect, read, write, a couple >> error functions. I have to link -lssl -lcrypto. The great thing about >> this is, not only do I have a high degree of confidence in the >> implementation, >> I don't expect it to _ever_ change in a way that will inconvenience me. >> If my application ever needs to work on a platform with a different SSL, >> just need a new module with init/connect/write etc. >> >> Does that seem like a possibility, just write minimal interfaces to >> existing platform standard SSL implementations, and move on to more >> interesting problems? Or is this really an area with interesting problems >> of its own that I'm missing? >> >> Donn >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -- Scott Lawrence From mail at nh2.me Sun Nov 3 18:19:49 2013 From: mail at nh2.me (=?ISO-8859-1?Q?Niklas_Hamb=FCchen?=) Date: Sun, 03 Nov 2013 18:19:49 +0000 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: <20131103170206.6B020F393A@mail.avvanta.com> Message-ID: <527693C5.6060201@nh2.me> On 03/11/13 17:49, Scott Lawrence wrote: > Even if you do expose the private key to other people, there's no way > for them to know that the administrator didn't also send it somewhere > else -- you can't prove that somebody hasn't duplicated information, > without making sure they don't have access to the information (which the > admin must). > > At the end of the day, trusting admins is what almost always happens. > The other route is for packages to be individually signed by developers. > As I recall, that's been explicitly discussed and informally rejected > here before, on the grounds that it makes the uploading process > significantly more cumbersome for many people. It is clear that putting HTTPS on the Hackage web site is the first step. Then comes cabal SSL support, and then maybe in the future the package signing. Once again, could we please just go ahead and push forward that the SSL certificate gets on the web server? As Jason Dagit said: We do have folks assigned to putting the cert in place and configuring everything, they just need a bit more time (More volunteers would help too, but that's longer term.) Who are the folks, and what needs more time? There seem to be a lot of volunteers around who would like to help (for example, I have asked for this multiple times over the last years and this thread shows that there are many more people interested in it). From carter.schonwald at gmail.com Sun Nov 3 18:27:57 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sun, 3 Nov 2013 13:27:57 -0500 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <527693C5.6060201@nh2.me> References: <20131103170206.6B020F393A@mail.avvanta.com> <527693C5.6060201@nh2.me> Message-ID: Theres a Haskell-infrastructure team that is now managing much of the community infrastructure, talk with them if you want to get involved. they're often found on the #haskell-infrastructure irc channel on freenode and they're amazingly responsive (despite being all volunteers) On Sun, Nov 3, 2013 at 1:19 PM, Niklas Hamb?chen wrote: > On 03/11/13 17:49, Scott Lawrence wrote: > > Even if you do expose the private key to other people, there's no way > > for them to know that the administrator didn't also send it somewhere > > else -- you can't prove that somebody hasn't duplicated information, > > without making sure they don't have access to the information (which the > > admin must). > > > > At the end of the day, trusting admins is what almost always happens. > > The other route is for packages to be individually signed by developers. > > As I recall, that's been explicitly discussed and informally rejected > > here before, on the grounds that it makes the uploading process > > significantly more cumbersome for many people. > > It is clear that putting HTTPS on the Hackage web site is the first step. > > Then comes cabal SSL support, and then maybe in the future the package > signing. > > Once again, could we please just go ahead and push forward that the SSL > certificate gets on the web server? > > As Jason Dagit said: > > We do have folks assigned to putting the cert in place and > configuring everything, they just need a bit more time > (More volunteers would help too, but that's longer term.) > > Who are the folks, and what needs more time? > > There seem to be a lot of volunteers around who would like to help (for > example, I have asked for this multiple times over the last years and > this thread shows that there are many more people interested in it). > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gershomb at gmail.com Sun Nov 3 19:00:45 2013 From: gershomb at gmail.com (Gershom Bazerman) Date: Sun, 03 Nov 2013 14:00:45 -0500 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <527693C5.6060201@nh2.me> References: <20131103170206.6B020F393A@mail.avvanta.com> <527693C5.6060201@nh2.me> Message-ID: <52769D5D.50408@gmail.com> On various topics: Security is a multifaceted beast with many related issues, depending on which attack vectors we're concerned about, with what degree of assurance. Ultimately, we rely on trusted parties, and so of course don't have a defense (other than 'many eyes') if someone were to hand e.g. SPJ or Austin or the maintainer of a key package in the Platform a swiss bank account with some quantity of gold sufficient to induce them to put in a backdoor, or perhaps just steal their computers, passwords, and keys to put in a backdoor themselves. That said, even if we consider that we 'trust' key individuals involved, as well as the security of their keys and identity, we still have other vectors to prevent. Here's my summary of what I understand (thanks to Duncan for helping me sort this out on IRC. Most insights his, all omissions mine). 1) Only those individuals who own packages should be able to upload their packages. A) This is solvable soon and directly by adding SSL to hackage, so that they can upload (via the web interface) in a secure manner. B) To upload securely via "cabal upload" we'll need cabal to have access to the right secure protocols. C) The "easy" answer here is to shell out to curl or the like, and place the obligation on the end user to have the right security-enabled binaries on their system. D) Other than that, we need to use e.g. "tls" and "tls-extras" E) To trust those, we should encourage outreach to the security community as a whole to examine, harden, etc. the code. It is in the interests of many, not just in the haskell world, to have more, different, and reliable open-source implementations of our open protocols for secure communication. F) Even if we don't 'trust' tls sufficiently to bless it for the platform, we can still bake it into platform-distributed cabal-install binaries, as better than nothing. 2) When I download a package, I should be able to trust that the package I download is one uploaded by a verified uploader. A) This is about signing and verification, not a secure protocol as such. B) It requires a different design. The library support is easier than that for SSL. However, there are more options for "how verified" we want the chain of trust to be -- is it sufficient for hackage to sign the tarballs, or do we want to let users sign their own tarballs and allow verification of that, etc. On a related topic: On 11/3/13 1:19 PM, Niklas Hamb?chen wrote: > There seem to be a lot of volunteers around who would like to help > (for example, I have asked for this multiple times over the last years > and this thread shows that there are many more people interested in it). What we need is not a 'drive by' volunteer just for one-time certificate deployment (which is easy). Volunteers for hackage and cabal to tackle the bigger technical issues described above would be much more important. Join the cabal-devel mailinglist, or hang out in #hackage on irc, or both. On reducing the load on the core infra team, what would be best is people able to devote a consistent (even if small) amount of time on a prolonged basis. Someone familiar with various virtualization technologies and deployment on linux would be ideal. Join the #haskell-infrastructure channel on irc, the haskell-infrastructure list hosted by galois, email admin at haskell.org, or email me directly, and we'll see where you might fit in best. It's great if people want to jump in -- there's plenty of work to be done. Let's centralize what people have to offer, so that we can work most efficiently! Cheers, Gershom From allbery.b at gmail.com Sun Nov 3 20:38:38 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 3 Nov 2013 15:38:38 -0500 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <20131103170206.6B020F393A@mail.avvanta.com> References: <20131103170206.6B020F393A@mail.avvanta.com> Message-ID: On Sun, Nov 3, 2013 at 12:02 PM, Donn Cave wrote: > not only do I have a high degree of confidence in the implementation, > I don't expect it to _ever_ change in a way that will inconvenience me. > Not familiar with how OpenSSL handles compatibility, I take it? I have no such confidence. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From eli.lee.frey at gmail.com Sun Nov 3 20:40:21 2013 From: eli.lee.frey at gmail.com (Eli Frey) Date: Sun, 3 Nov 2013 12:40:21 -0800 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <52769D5D.50408@gmail.com> References: <20131103170206.6B020F393A@mail.avvanta.com> <527693C5.6060201@nh2.me> <52769D5D.50408@gmail.com> Message-ID: > Theres a Haskell-infrastructure team that is now managing much of the community infrastructure, talk with them if you want to get involved. they're often found on the #haskell-infrastructure irc channel on freenode and they're amazingly responsive (despite being all volunteers) > What we need is not a 'drive by' volunteer just for one-time certificate deployment (which is easy). Volunteers for hackage and cabal to tackle the bigger technical issues described above would be much more important. Join the cabal-devel mailinglist, or hang out in #hackage on irc, or both. Good points, I'll quit back seat driving :P. On Sun, Nov 3, 2013 at 11:00 AM, Gershom Bazerman wrote: > On various topics: > > Security is a multifaceted beast with many related issues, depending on > which attack vectors we're concerned about, with what degree of assurance. > > Ultimately, we rely on trusted parties, and so of course don't have a > defense (other than 'many eyes') if someone were to hand e.g. SPJ or Austin > or the maintainer of a key package in the Platform a swiss bank account > with some quantity of gold sufficient to induce them to put in a backdoor, > or perhaps just steal their computers, passwords, and keys to put in a > backdoor themselves. > > That said, even if we consider that we 'trust' key individuals involved, > as well as the security of their keys and identity, we still have other > vectors to prevent. Here's my summary of what I understand (thanks to > Duncan for helping me sort this out on IRC. Most insights his, all > omissions mine). > > 1) Only those individuals who own packages should be able to upload their > packages. > A) This is solvable soon and directly by adding SSL to hackage, so > that they can upload (via the web interface) in a secure manner. > B) To upload securely via "cabal upload" we'll need cabal to have > access to the right secure protocols. > C) The "easy" answer here is to shell out to curl or the like, and > place the obligation on the end user to have the right security-enabled > binaries on their system. > D) Other than that, we need to use e.g. "tls" and "tls-extras" > E) To trust those, we should encourage outreach to the security > community as a whole to examine, harden, etc. the code. It is in the > interests of many, not just in the haskell world, to have more, different, > and reliable open-source implementations of our open protocols for secure > communication. > F) Even if we don't 'trust' tls sufficiently to bless it for the > platform, we can still bake it into platform-distributed cabal-install > binaries, as better than nothing. > > 2) When I download a package, I should be able to trust that the package I > download is one uploaded by a verified uploader. > A) This is about signing and verification, not a secure protocol as > such. > B) It requires a different design. The library support is easier than > that for SSL. However, there are more options for "how verified" we want > the chain of trust to be -- is it sufficient for hackage to sign the > tarballs, or do we want to let users sign their own tarballs and allow > verification of that, etc. > > On a related topic: > > > On 11/3/13 1:19 PM, Niklas Hamb?chen wrote: > >> There seem to be a lot of volunteers around who would like to help (for >> example, I have asked for this multiple times over the last years and this >> thread shows that there are many more people interested in it). >> > > What we need is not a 'drive by' volunteer just for one-time certificate > deployment (which is easy). Volunteers for hackage and cabal to tackle the > bigger technical issues described above would be much more important. Join > the cabal-devel mailinglist, or hang out in #hackage on irc, or both. > > On reducing the load on the core infra team, what would be best is people > able to devote a consistent (even if small) amount of time on a prolonged > basis. Someone familiar with various virtualization technologies and > deployment on linux would be ideal. Join the #haskell-infrastructure > channel on irc, the haskell-infrastructure list hosted by galois, email > admin at haskell.org, or email me directly, and we'll see where you might > fit in best. It's great if people want to jump in -- there's plenty of work > to be done. Let's centralize what people have to offer, so that we can work > most efficiently! > > Cheers, > Gershom > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alfredo.dinapoli at gmail.com Sun Nov 3 21:43:28 2013 From: alfredo.dinapoli at gmail.com (Alfredo Di Napoli) Date: Sun, 3 Nov 2013 21:43:28 +0000 Subject: [Haskell-cafe] Can't install vector-0.10.9.1 on OS X Maverick In-Reply-To: References: Message-ID: Well, if you meant using it BEFORE the update to Maverick no, I was using the old apple-gcc42 compiler. Perhaps that was the source of confusion :) A. On 3 November 2013 17:41, Carter Schonwald wrote: > Those are the directions for using gcc-4.8 too. I wrote them. Sounds like > you were actually not using GCC 4.8 before..? > > > On Sunday, November 3, 2013, Alfredo Di Napoli wrote: > >> Eventually, this is what worked for me (so gcc 4.8 was a no-go for me): >> >> >> http://haskell-workshop.github.io/tutorials/osx/2013-10-23-mavericks-ghc.html >> >> HTH, >> A. >> >> >> On 2 November 2013 23:17, Alfredo Di Napoli wrote: >> >> Oh, before I forgot (sorry for the spam): >> >> The above cabal cmd worked NOT in a cabal sandbox. Issuing that into a >> cabal sandbox still triggers the problems. I'll try to ask into the cabal >> issue tracker to see if I discover something. >> >> A. >> >> >> On 2 November 2013 23:14, Alfredo Di Napoli wrote: >> >> Ok, for the lost souls which will find this thread, I've solved the >> problem in two steps: >> >> a) Used the script here: >> http://justtesting.org/post/64947952690/the-glasgow-haskell-compiler-ghc-on-os-x-10-9 >> >> b) Specifically for the snap problem, I've solved it following the FAQ >> here: >> http://www.haskell.org/haskellwiki/GHC/FAQ#I_get_an_error_message_from_GHCi_about_a_.22duplicate_definition_for_symbol_module_registered.22 >> >> The command was: >> cabal install snap --ld-options="-x" >> >> HTH, >> A. >> >> >> On 2 November 2013 22:40, Alfredo Di Napoli wrote: >> >> I'm trying to fiddle with clang scripts from Manuel Chakavarty and this >> one: >> >> https://gist.github.com/mzero/7245290 >> >> the former works (vector builds fine), but when installing Snap it >> generates the following error: >> >> Loading package network-2.4.2.0 ... >> >> GHCi runtime linker: fatal error: I found a duplicate definition for >> symbol >> _hsnet_freeaddrinfo >> whilst processing object file >> >> /Users/adinapoli/programming/haskell/faceguess/.cabal-sandbox/lib/x86_64-osx-ghc-7.6.3/network-2.4.2.0/libHSnetwork-2.4.2.0.a >> This could be caused by: >> * Loading two different object files which export the same symbol >> * Specifying the same object file twice on the GHCi command line >> * An incorrect `package.conf' entry, causing some object to be >> loaded twice. >> GHCi cannot safely continue in this situation. Exiting now. Sorry. >> >> Failed to install snap-0.13.0.4 >> cabal: Error: some packages failed to install: >> snap-0.13.0.4 failed during the building phase. The exception was: >> ExitFailure 1 >> >> >> I haven't tried the latter, though. >> >> A. >> >> >> On 2 November 2013 22:23, Carter Schonwald wrote: >> >> i have no clue. Doesn't GHC also come prebuilt with Vector? >> >> might be worth filing a ticket on GHC track too. perhaps. >> >> >> On Sat, Nov 2, 2013 at 6:02 PM, Alfredo Di Napoli < >> alfredo.dinapoli at gmail.com> wrote: >> >> Hi Carter, >> >> I do have Xcode 5 installed, this is the strange thing. >> Do you suggest to try rei >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From trebla at vex.net Sun Nov 3 22:05:40 2013 From: trebla at vex.net (Albert Y. C. Lai) Date: Sun, 03 Nov 2013 17:05:40 -0500 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: <20131103054604.GB2047@mteis> References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> <20131103054604.GB2047@mteis> Message-ID: <5276C8B4.80108@vex.net> On 13-11-03 01:46 AM, Magnus Therning wrote: > Is there already a way to get Cabal to put in an RPATH such that an *installed* > executable works correctly, or is this a fairly serious bug in Cabal? It is usually desirable to set RPATH to libs' installation locations rather than libs' build trees, and I think I prefer it too. But the exception is during "cabal test", when you should test against libs in the build tree. It is somewhat a dilemma. It is, in fact, sad that we have to set RPATH at all, and we have to because Haskell libs are not common, and they are not dumped directly into /usr/lib and /usr/local/lib. (They are, instead, scattered over /usr/local/lib/p-n/ghc-m, for wide ranges of values of p, n, and m.) If not for this, we would set no RPATH, we would do nothing special for installations, and we just had to play with LD_LIBRARY_PATH or LD_RUN_PATH or something during testing. (I would, in fact, not mind that organization, if symlinks were set up directly in /usr/local/lib. Note: the filename is already libHSp-n-ghcm.so, it already records p, n, and m, there is no clash putting that name right into /usr/local/lib alongside siblings and cousins --- well, no more clash than the /usr/local/lib/p-n/ghc-m scheme.) From dburke.gw at gmail.com Sun Nov 3 22:08:24 2013 From: dburke.gw at gmail.com (Doug Burke) Date: Sun, 3 Nov 2013 17:08:24 -0500 Subject: [Haskell-cafe] How to avoid floods of fromIntegral (in ALSA.Sequencer) In-Reply-To: <52768990.1060406@web.de> References: <527653CD.2030702@web.de> <52765F15.9070504@nh2.me> <52768990.1060406@web.de> Message-ID: For Word8, take a look at Data.Word - e.g. http://hackage.haskell.org/package/base-4.6.0.1/docs/Data-Word.html Doug On Nov 3, 2013 12:36 PM, "martin" wrote: > Am 11/03/2013 03:35 PM, schrieb Niklas Hamb?chen: > > It depends a bit: > > > > What is supposed to happen / what happens in your library when one of > > the numbers is larger than a Word8? > > > > That usually determines where / how the conversion fits in nicely. > > > > For example, if you already know that all the values in DtzEvent can > > only be Word8s, then they should probably already be Word8s and not Int. > > > Silly me, > > yes using Word8 instead of Ints got rid of most of the fromIntegrals. I > didn't know that Word8 was an actual haskell > type. Thought it was something private to ALSA.Sequencer. > > There is one remaining fromIntegral. This is "time" > > > Couldn't match expected type > `alsa-seq-0.6.0.2:Sound.ALSA.Sequencer.Marshal.Time.Tick' > with actual type `T' > > This seems to be realy a private thing and I found to way other than > fromIntegral to make the compiler happy. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Sun Nov 3 23:13:48 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Sun, 3 Nov 2013 18:13:48 -0500 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: <5276C8B4.80108@vex.net> References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> <20131103054604.GB2047@mteis> <5276C8B4.80108@vex.net> Message-ID: On Sun, Nov 3, 2013 at 5:05 PM, Albert Y. C. Lai wrote: > It is usually desirable to set RPATH to libs' installation locations > rather than libs' build trees May I note that this is system dependent? OS X compiles in full paths (and DYLD_LIBRARY_PATH overrides these, which is part of why it's much more dangerous than Linux's LD_LIBRARY_PATH). On the other end, I don't think Windows has much of an RPATH mechanism at all. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From conal at conal.net Mon Nov 4 04:38:46 2013 From: conal at conal.net (Conal Elliott) Date: Sun, 3 Nov 2013 20:38:46 -0800 Subject: [Haskell-cafe] How to avoid floods of fromIntegral (in ALSA.Sequencer) In-Reply-To: <52768990.1060406@web.de> References: <527653CD.2030702@web.de> <52765F15.9070504@nh2.me> <52768990.1060406@web.de> Message-ID: You can factor out the fromIntegral t part using (***) from Control.Arrow. For functions, > (f *** g) (x,y) = (f x, g y) Drop time (t) handling from render: > playSong :: DtzEvents -> IO() > playSong events = runContT (foo "128:0" 120 (map (fromIntegral *** render) events)) print > where > render (NoteOn c n v) = noteOn c n v > ... -- Conal On Sun, Nov 3, 2013 at 9:36 AM, martin wrote: > Am 11/03/2013 03:35 PM, schrieb Niklas Hamb?chen: > > It depends a bit: > > > > What is supposed to happen / what happens in your library when one of > > the numbers is larger than a Word8? > > > > That usually determines where / how the conversion fits in nicely. > > > > For example, if you already know that all the values in DtzEvent can > > only be Word8s, then they should probably already be Word8s and not Int. > > > Silly me, > > yes using Word8 instead of Ints got rid of most of the fromIntegrals. I > didn't know that Word8 was an actual haskell > type. Thought it was something private to ALSA.Sequencer. > > There is one remaining fromIntegral. This is "time" > > > Couldn't match expected type > `alsa-seq-0.6.0.2:Sound.ALSA.Sequencer.Marshal.Time.Tick' > with actual type `T' > > This seems to be realy a private thing and I found to way other than > fromIntegral to make the compiler happy. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tab at snarc.org Mon Nov 4 06:24:21 2013 From: tab at snarc.org (Vincent Hanquez) Date: Mon, 04 Nov 2013 14:24:21 +0800 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: Message-ID: <52773D95.6050509@snarc.org> On 2013-11-03 17:48, Scott Lawrence wrote: > One could argue that the potential for a false sense of security could > make (very) bad encryption worse than no encryption. > Well. No, false sense of security is bad, however is has no link with your absolute level of security. Even bad cryptographic implementation provide some security in a sense, at worse by obscurity (which is very poor security, but not zero), and In the best case (of the bad) a rather hard problem for resource-less people. Now i'm not saying that bad implementations are OK, and certainly I hope that's not the case in tls, but in the context where we got nothing, just as John Wiegley rightfully mentioned, the risk is quite small. it's rather sad to see the "i'ld rather have *no* security whatsoever, than maybe have some" hard line. > Personally, I've always been a bit uncomfortable with the small number > of widely-used implementations (AFAIK OpenSSL and GnuTLS combined > account for pretty much all TLS-using open-source software), and I > think pushing another one into wider usage would be a good thing > (while acknowledging that it's likely more vulnerable than the older > implementations). > That, and also that half of openssl CVE in the past 20 years were buffer overflow/underflow. Nothing to do with cryptography, but rather just simple memory management. I think this got to give some security points for a (mostly) haskell implementation. -- Vincent From tab at snarc.org Mon Nov 4 06:35:48 2013 From: tab at snarc.org (Vincent Hanquez) Date: Mon, 04 Nov 2013 14:35:48 +0800 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <20131103170206.6B020F393A@mail.avvanta.com> References: <20131103170206.6B020F393A@mail.avvanta.com> Message-ID: <52774044.9030702@snarc.org> On 2013-11-04 01:02, Donn Cave wrote: > How strongly do you feel about the cross platform and dependency issues? Quite ? I think that would be rather bad to have cabal have ssl on unix, but not on MacOSX and Windows. > When I needed SSL encryption, I whipped up a little module with foreign > calls to OpenSSL. For an ordinary client, which is all I use it for any > more, it's a simple interface -- init, connect, read, write, a couple > error functions. I have to link -lssl -lcrypto. The great thing about > this is, not only do I have a high degree of confidence in the implementation, > I don't expect it to _ever_ change in a way that will inconvenience me. > If my application ever needs to work on a platform with a different SSL, > just need a new module with init/connect/write etc. > > Does that seem like a possibility, just write minimal interfaces to > existing platform standard SSL implementations, and move on to more > interesting problems? Or is this really an area with interesting problems > of its own that I'm missing? > I think that's the best alternative (provided wide spread non support for tls), except there's no platform standards (think about chromium, and mozilla cases for a very similar problem), and it's probably going to be "interesting" to maintain (as in it take probably quite a bit of resource for browsers to keep on top). -- Vincent From carter.schonwald at gmail.com Mon Nov 4 06:37:30 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 4 Nov 2013 01:37:30 -0500 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <52773D95.6050509@snarc.org> References: <52773D95.6050509@snarc.org> Message-ID: broadly speaking, believing that a communication is secure/valid changes the behavior of communicating participants vs if communication is not secure. this is how most social engineering security issues come to pass. for matters of security, being conversative about possible risks is a responsible strategy. That said, if some folks comfortable with security and the like could do some white hat auditing/hammering on hs-tls, I think that would be the *ideal* way to help get buy in to that proposed approach. (not sure if such volunteers exist, but that would be the ideal scenario). I could ask 1-2 folks i know if they have any suggestions. On Mon, Nov 4, 2013 at 1:24 AM, Vincent Hanquez wrote: > On 2013-11-03 17:48, Scott Lawrence wrote: > >> One could argue that the potential for a false sense of security could >> make (very) bad encryption worse than no encryption. >> >> Well. No, false sense of security is bad, however is has no link with > your absolute level of security. > > Even bad cryptographic implementation provide some security in a sense, at > worse by obscurity > (which is very poor security, but not zero), and In the best case (of the > bad) a rather hard problem > for resource-less people. > > Now i'm not saying that bad implementations are OK, and certainly I hope > that's not the case in tls, > but in the context where we got nothing, just as John Wiegley rightfully > mentioned, the risk is > quite small. > > it's rather sad to see the "i'ld rather have *no* security whatsoever, > than maybe have some" hard line. > > > Personally, I've always been a bit uncomfortable with the small number of >> widely-used implementations (AFAIK OpenSSL and GnuTLS combined account for >> pretty much all TLS-using open-source software), and I think pushing >> another one into wider usage would be a good thing (while acknowledging >> that it's likely more vulnerable than the older implementations). >> >> > That, and also that half of openssl CVE in the past 20 years were buffer > overflow/underflow. > Nothing to do with cryptography, but rather just simple memory management. > I think this got to give some security points for a (mostly) haskell > implementation. > > -- > Vincent > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Mon Nov 4 06:39:46 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 4 Nov 2013 01:39:46 -0500 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <52774044.9030702@snarc.org> References: <20131103170206.6B020F393A@mail.avvanta.com> <52774044.9030702@snarc.org> Message-ID: agreed, would likely be a portability nightmare, and the cabal devs have enough on their plate as is! On Mon, Nov 4, 2013 at 1:35 AM, Vincent Hanquez wrote: > On 2013-11-04 01:02, Donn Cave wrote: > >> How strongly do you feel about the cross platform and dependency issues? >> > Quite ? I think that would be rather bad to have cabal have ssl on unix, > but > not on MacOSX and Windows. > > > When I needed SSL encryption, I whipped up a little module with foreign >> calls to OpenSSL. For an ordinary client, which is all I use it for any >> more, it's a simple interface -- init, connect, read, write, a couple >> error functions. I have to link -lssl -lcrypto. The great thing about >> this is, not only do I have a high degree of confidence in the >> implementation, >> I don't expect it to _ever_ change in a way that will inconvenience me. >> If my application ever needs to work on a platform with a different SSL, >> just need a new module with init/connect/write etc. >> >> Does that seem like a possibility, just write minimal interfaces to >> existing platform standard SSL implementations, and move on to more >> interesting problems? Or is this really an area with interesting problems >> of its own that I'm missing? >> >> I think that's the best alternative (provided wide spread non support > for tls), > except there's no platform standards (think about chromium, and mozilla > cases for a very similar problem), and it's probably going to be > "interesting" > to maintain (as in it take probably quite a bit of resource for browsers > to keep on top). > > -- > Vincent > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tab at snarc.org Mon Nov 4 06:57:55 2013 From: tab at snarc.org (Vincent Hanquez) Date: Mon, 04 Nov 2013 14:57:55 +0800 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: <52769D5D.50408@gmail.com> References: <20131103170206.6B020F393A@mail.avvanta.com> <527693C5.6060201@nh2.me> <52769D5D.50408@gmail.com> Message-ID: <52774573.8000204@snarc.org> On 2013-11-04 03:00, Gershom Bazerman wrote: > On various topics: > > Security is a multifaceted beast with many related issues, depending > on which attack vectors we're concerned about, with what degree of > assurance. > > Ultimately, we rely on trusted parties, and so of course don't have a > defense (other than 'many eyes') if someone were to hand e.g. SPJ or > Austin or the maintainer of a key package in the Platform a swiss bank > account with some quantity of gold sufficient to induce them to put in > a backdoor, or perhaps just steal their computers, passwords, and keys > to put in a backdoor themselves. > > That said, even if we consider that we 'trust' key individuals > involved, as well as the security of their keys and identity, we still > have other vectors to prevent. Here's my summary of what I understand > (thanks to Duncan for helping me sort this out on IRC. Most insights > his, all omissions mine). > > 1) Only those individuals who own packages should be able to upload > their packages. > A) This is solvable soon and directly by adding SSL to hackage, so > that they can upload (via the web interface) in a secure manner. > B) To upload securely via "cabal upload" we'll need cabal to have > access to the right secure protocols. > C) The "easy" answer here is to shell out to curl or the like, and > place the obligation on the end user to have the right > security-enabled binaries on their system. > D) Other than that, we need to use e.g. "tls" and "tls-extras" > E) To trust those, we should encourage outreach to the security > community as a whole to examine, harden, etc. the code. It is in the > interests of many, not just in the haskell world, to have more, > different, and reliable open-source implementations of our open > protocols for secure communication. > F) Even if we don't 'trust' tls sufficiently to bless it for the > platform, we can still bake it into platform-distributed cabal-install > binaries, as better than nothing. > > 2) When I download a package, I should be able to trust that the > package I download is one uploaded by a verified uploader. > A) This is about signing and verification, not a secure protocol > as such. > B) It requires a different design. The library support is easier > than that for SSL. However, there are more options for "how verified" > we want the chain of trust to be -- is it sufficient for hackage to > sign the tarballs, or do we want to let users sign their own tarballs > and allow verification of that, etc. This is a very good list. 1) c) I think "shelling out" is probably the best idea: * it doesn't cost much on cabal infrastructure and its maintenance * it doesn't add any dependencies * it allow user to replace their binaries by custom solutions if needed. With this in place, even tls doesn't necessary have to be favorited. 2) b) similar to the uploading/downloading, if you have a special binary somewhere, it would use it to automatically insert signatures (at sdist time), and verify packages when needed. -- Vincent From michael at snoyman.com Mon Nov 4 06:55:42 2013 From: michael at snoyman.com (Michael Snoyman) Date: Mon, 4 Nov 2013 08:55:42 +0200 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: <20131103170206.6B020F393A@mail.avvanta.com> <52774044.9030702@snarc.org> Message-ID: FWIW, I went through this exact decision making process about 2 years ago when working on TLS support in http-conduit[1] and came to the conclusion that the best choice by far was using Vincent's tls package. I've been very happy with the results. Not only is Yesod used on a number of platforms, but I've shipped commercial software to both Windows and Mac, and having one less system library to worry about saved me lots of pain[2]. [1] Actually, the only reason I ever wrote http-conduit instead of just using HTTP was that I needed TLS support for OpenID, and I could never get the existing TLS-in-HTTP-package solutions to work. [2] An example to the contrary to text-icu, which to this day I cannot reliably get installed on a Windows system. On Mon, Nov 4, 2013 at 8:39 AM, Carter Schonwald wrote: > agreed, would likely be a portability nightmare, and the cabal devs have > enough on their plate as is! > > > On Mon, Nov 4, 2013 at 1:35 AM, Vincent Hanquez wrote: > >> On 2013-11-04 01:02, Donn Cave wrote: >> >>> How strongly do you feel about the cross platform and dependency issues? >>> >> Quite ? I think that would be rather bad to have cabal have ssl on unix, >> but >> not on MacOSX and Windows. >> >> >> When I needed SSL encryption, I whipped up a little module with foreign >>> calls to OpenSSL. For an ordinary client, which is all I use it for any >>> more, it's a simple interface -- init, connect, read, write, a couple >>> error functions. I have to link -lssl -lcrypto. The great thing about >>> this is, not only do I have a high degree of confidence in the >>> implementation, >>> I don't expect it to _ever_ change in a way that will inconvenience me. >>> If my application ever needs to work on a platform with a different SSL, >>> just need a new module with init/connect/write etc. >>> >>> Does that seem like a possibility, just write minimal interfaces to >>> existing platform standard SSL implementations, and move on to more >>> interesting problems? Or is this really an area with interesting >>> problems >>> of its own that I'm missing? >>> >>> I think that's the best alternative (provided wide spread non support >> for tls), >> except there's no platform standards (think about chromium, and mozilla >> cases for a very similar problem), and it's probably going to be >> "interesting" >> to maintain (as in it take probably quite a bit of resource for browsers >> to keep on top). >> >> -- >> Vincent >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tab at snarc.org Mon Nov 4 07:13:30 2013 From: tab at snarc.org (Vincent Hanquez) Date: Mon, 04 Nov 2013 15:13:30 +0800 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: References: <52773D95.6050509@snarc.org> Message-ID: <5277491A.6000300@snarc.org> On 2013-11-04 14:37, Carter Schonwald wrote: > broadly speaking, believing that a communication is secure/valid > changes the behavior of communicating participants vs if communication > is not secure. this is how most social engineering security issues > come to pass. > > for matters of security, being conversative about possible risks is a > responsible strategy. > I agree. But security is not a boolean value. People using openssl shouldn't necessarily think they have nothing to worry about because "it's the most widely used SSL implementation" or because "it's widely audited". So it's rather a good idea to be conversative beyond just your choice of implementation, and always looks at the social side and the wide context (what i'm protecting against, and what are the risks) For all you know, the could already be in possession of the RSA key of the server you're communicating with, rendering which implementation you're using moot. In the context of hackage, this is why i think it's important to also get package signing (multi layered security). SSL/TLS is just one facet of the problem. > That said, if some folks comfortable with security and the like could > do some white hat auditing/hammering on hs-tls, I think that would be > the *ideal* way to help get buy in to that proposed approach. (not > sure if such volunteers exist, but that would be the ideal scenario). > I could ask 1-2 folks i know if they have any suggestions. > I would be extremely happy to see more of this happening. In a near future, and related to my haskell crypto platform (HCP) effort, I want to add notes/comment/warnings to places where some constructions are probably not ideal, until I got time to actually fix them. I'm hoping that could help with, where to look at issues first. -- Vincent From chris at chrisdornan.com Mon Nov 4 07:10:51 2013 From: chris at chrisdornan.com (Chris Dornan) Date: Mon, 04 Nov 2013 07:10:51 +0000 Subject: [Haskell-cafe] SSL support for hackage and cabal In-Reply-To: Message-ID: And some of us have been relying on Vincent's tis package for our production code and would very much like to see it in the platform. And surely we do need a cross-platform solution. Chris From: Michael Snoyman Date: Monday, 4 November 2013 06:55 To: Carter Schonwald Cc: Haskell-Cafe Subject: Re: [Haskell-cafe] SSL support for hackage and cabal FWIW, I went through this exact decision making process about 2 years ago when working on TLS support in http-conduit[1] and came to the conclusion that the best choice by far was using Vincent's tls package. I've been very happy with the results. Not only is Yesod used on a number of platforms, but I've shipped commercial software to both Windows and Mac, and having one less system library to worry about saved me lots of pain[2]. [1] Actually, the only reason I ever wrote http-conduit instead of just using HTTP was that I needed TLS support for OpenID, and I could never get the existing TLS-in-HTTP-package solutions to work. [2] An example to the contrary to text-icu, which to this day I cannot reliably get installed on a Windows system. On Mon, Nov 4, 2013 at 8:39 AM, Carter Schonwald wrote: > agreed, would likely be a portability nightmare, and the cabal devs have > enough on their plate as is! > > > On Mon, Nov 4, 2013 at 1:35 AM, Vincent Hanquez wrote: >> On 2013-11-04 01:02, Donn Cave wrote: >>> How strongly do you feel about the cross platform and dependency issues? >> Quite ? I think that would be rather bad to have cabal have ssl on unix, but >> not on MacOSX and Windows. >> >> >>> When I needed SSL encryption, I whipped up a little module with foreign >>> calls to OpenSSL. For an ordinary client, which is all I use it for any >>> more, it's a simple interface -- init, connect, read, write, a couple >>> error functions. I have to link -lssl -lcrypto. The great thing about >>> this is, not only do I have a high degree of confidence in the >>> implementation, >>> I don't expect it to _ever_ change in a way that will inconvenience me. >>> If my application ever needs to work on a platform with a different SSL, >>> just need a new module with init/connect/write etc. >>> >>> Does that seem like a possibility, just write minimal interfaces to >>> existing platform standard SSL implementations, and move on to more >>> interesting problems? Or is this really an area with interesting problems >>> of its own that I'm missing? >>> >> I think that's the best alternative (provided wide spread non support for >> tls), >> except there's no platform standards (think about chromium, and mozilla >> cases for a very similar problem), and it's probably going to be >> "interesting" >> to maintain (as in it take probably quite a bit of resource for browsers to >> keep on top). >> >> -- >> Vincent >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe at haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From omeragacan at gmail.com Mon Nov 4 17:17:07 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Mon, 4 Nov 2013 19:17:07 +0200 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage Message-ID: Hi all, The following is happening to me very often: - I decide to do some work in Haskell and decide to do it using a library. - I go to hackage and search for some keywords, find 10 different packages that does similar things. - In that moment, I need to apply some heuristics to decide which package to use. When my heuristics don't end up with only one package, I go to Haskell IRC channel and ask people there to which library to use. My heuristic is something like: - Look if author/maintainer is well-known people in Haskell community that are already produced very high-quality libraries. - Make sure it's currently maintained(updated at least in past few months) - Make sure it has Github repository. - some other stuff like that. These heuristics are not working great, most of the time I'm ending up with IRC channel. So my proposal is this: Why not have a rating/comment system for packages in hackage, so that when I need to find a library for something I can just look to comments or ratings to see how complete/well-implemented or what does it good for etc. (for example, we have several high quality xml parsers, some of them are for performance while some of them aiming for being easy to use) Any comments would be appreciated. --- ?mer Sinan A?acan http://osa1.net From vogt.adam at gmail.com Mon Nov 4 17:56:38 2013 From: vogt.adam at gmail.com (adam vogt) Date: Mon, 4 Nov 2013 12:56:38 -0500 Subject: [Haskell-cafe] ANNOUNCE: Rlang-QQ 0.1 Message-ID: Greetings, I'm pleased to announce a new version of Rlang-QQ. It is a way to get R code inline in you .hs files. The main highlight for this release is that correctly named variables assigned to in R are available to haskell. Many data types can be converted. You can get this package by cabal update && cabal install Rlang-QQ Please refer to the documentation here or in the examples/* that you can get at with a: cabal unpack Rlang-QQ Regards, Adam Vogt From charlieap at gmail.com Mon Nov 4 19:34:31 2013 From: charlieap at gmail.com (Charlie Paul) Date: Mon, 4 Nov 2013 11:34:31 -0800 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: Message-ID: This has been proposed many times before, and each time everyone agrees that something like this is a good idea. However, like many good proposals, no one has put up code. Also in this particular case, the devil is in the details. How do ratings transfer between versions? How do you account for the effects of bitrot? On Monday, November 4, 2013, ?mer Sinan A?acan wrote: > Hi all, > > The following is happening to me very often: > > - I decide to do some work in Haskell and decide to do it using a library. > - I go to hackage and search for some keywords, find 10 different > packages that does similar things. > - In that moment, I need to apply some heuristics to decide which > package to use. When my heuristics don't end up with only one package, > I go to Haskell IRC channel and ask people there to which library to > use. > > > My heuristic is something like: > > - Look if author/maintainer is well-known people in Haskell community > that are already produced very high-quality libraries. > - Make sure it's currently maintained(updated at least in past few months) > - Make sure it has Github repository. > - some other stuff like that. > > These heuristics are not working great, most of the time I'm ending up > with IRC channel. So my proposal is this: > > Why not have a rating/comment system for packages in hackage, so that > when I need to find a library for something I can just look to > comments or ratings to see how complete/well-implemented or what does > it good for etc. (for example, we have several high quality xml > parsers, some of them are for performance while some of them aiming > for being easy to use) > > Any comments would be appreciated. > > > --- > ?mer Sinan A?acan > http://osa1.net > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vogt.adam at gmail.com Mon Nov 4 20:14:06 2013 From: vogt.adam at gmail.com (adam vogt) Date: Mon, 4 Nov 2013 15:14:06 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: Message-ID: Hi Omer, There is such content in the haskell wiki. For example there is something here or . Perhaps there is (or should be) category in the haskell wiki similar to -- Adam On Mon, Nov 4, 2013 at 2:34 PM, Charlie Paul wrote: > This has been proposed many times before, and each time everyone agrees that > something like this is a good idea. However, like many good proposals, no > one has put up code. > > Also in this particular case, the devil is in the details. How do ratings > transfer between versions? How do you account for the effects of bitrot? > > > On Monday, November 4, 2013, ?mer Sinan A?acan wrote: >> Hi all, >> >> The following is happening to me very often: >> >> - I decide to do some work in Haskell and decide to do it using a library. >> - I go to hackage and search for some keywords, find 10 different >> packages that does similar things. >> - In that moment, I need to apply some heuristics to decide which >> package to use. When my heuristics don't end up with only one package, >> I go to Haskell IRC channel and ask people there to which library to >> use. >> >> >> My heuristic is something like: >> >> - Look if author/maintainer is well-known people in Haskell community >> that are already produced very high-quality libraries. >> - Make sure it's currently maintained(updated at least in past few months) >> - Make sure it has Github repository. >> - some other stuff like that. >> >> These heuristics are not working great, most of the time I'm ending up >> with IRC channel. So my proposal is this: >> >> Why not have a rating/comment system for packages in hackage, so that >> when I need to find a library for something I can just look to >> comments or ratings to see how complete/well-implemented or what does >> it good for etc. (for example, we have several high quality xml >> parsers, some of them are for performance while some of them aiming >> for being easy to use) >> >> Any comments would be appreciated. >> >> >> --- >> ?mer Sinan A?acan >> http://osa1.net >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From bgamari.foss at gmail.com Mon Nov 4 20:25:32 2013 From: bgamari.foss at gmail.com (Ben Gamari) Date: Mon, 04 Nov 2013 15:25:32 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: Message-ID: <87wqknoqwz.fsf@gmail.com> Charlie Paul writes: > This has been proposed many times before, and each time everyone agrees > that something like this is a good idea. However, like many good proposals, > no one has put up code. > I also think that many Hackage improvements like this one were blocked on Hackage 2. Now since this is finally in the wild it should be a bit easier for people to pick up this sort of project. > Also in this particular case, the devil is in the details. How do ratings > transfer between versions? How do you account for the effects of bitrot? > Certainly there are tricky details to work out but I think a lot of the work will be simply getting to the point where we can collect ratings and stuff them into a database. After this there would need to be some experimentation to work out the finer points you mention. In my mind a rating would consist of some numeric rating (1-5, for instance, perhaps along multiple dimensions, e.g.: quality of documentation, type-safety of interface, performance) for a particular package. The user, date, and current version number should also be recorded. A zeroth-order approach for accounting for bit-rot might be to use a simple temporally-weighted average. This would be simple to implement and might even produce marginally useful results. Even if not, it's a place to start. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From carter.schonwald at gmail.com Mon Nov 4 21:39:52 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 4 Nov 2013 16:39:52 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <87wqknoqwz.fsf@gmail.com> References: <87wqknoqwz.fsf@gmail.com> Message-ID: Honestly the first step is making it easier (and efficient) to look at reverse dependency information plus download count. Those numbers are both manipulable, but can still yield some informative basic info. On Monday, November 4, 2013, Ben Gamari wrote: > Charlie Paul > writes: > > > This has been proposed many times before, and each time everyone agrees > > that something like this is a good idea. However, like many good > proposals, > > no one has put up code. > > > I also think that many Hackage improvements like this one were blocked on > Hackage 2. Now since this is finally in the wild it should be a bit > easier for people to pick up this sort of project. > > > Also in this particular case, the devil is in the details. How do ratings > > transfer between versions? How do you account for the effects of bitrot? > > > Certainly there are tricky details to work out but I think a lot of the > work will be simply getting to the point where we can collect ratings > and stuff them into a database. After this there would need to be some > experimentation to work out the finer points you mention. > > In my mind a rating would consist of some numeric rating (1-5, for > instance, > perhaps along multiple dimensions, e.g.: quality of documentation, > type-safety > of interface, performance) for a particular package. The user, date, and > current version number should also be recorded. > > A zeroth-order approach for accounting for bit-rot might be to use a > simple temporally-weighted average. This would be simple to implement > and might even produce marginally useful results. Even if not, it's a > place to start. > > Cheers, > > - Ben > -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Mon Nov 4 22:04:39 2013 From: danburton.email at gmail.com (Dan Burton) Date: Mon, 4 Nov 2013 14:04:39 -0800 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> Message-ID: And these steps are done! * Download count is already there on Hackage, though it's relatively new so it may take some more time for these numbers to have real weight. * Revdeps are calculated and provided here: http://packdeps.haskellers.com/reverse -- Dan Burton On Mon, Nov 4, 2013 at 1:39 PM, Carter Schonwald wrote: > Honestly the first step is making it easier (and efficient) to look at > reverse dependency information plus download count. Those numbers are both > manipulable, but can still yield some informative basic info. > > > On Monday, November 4, 2013, Ben Gamari wrote: > >> Charlie Paul writes: >> >> > This has been proposed many times before, and each time everyone agrees >> > that something like this is a good idea. However, like many good >> proposals, >> > no one has put up code. >> > >> I also think that many Hackage improvements like this one were blocked on >> Hackage 2. Now since this is finally in the wild it should be a bit >> easier for people to pick up this sort of project. >> >> > Also in this particular case, the devil is in the details. How do >> ratings >> > transfer between versions? How do you account for the effects of bitrot? >> > >> Certainly there are tricky details to work out but I think a lot of the >> work will be simply getting to the point where we can collect ratings >> and stuff them into a database. After this there would need to be some >> experimentation to work out the finer points you mention. >> >> In my mind a rating would consist of some numeric rating (1-5, for >> instance, >> perhaps along multiple dimensions, e.g.: quality of documentation, >> type-safety >> of interface, performance) for a particular package. The user, date, and >> current version number should also be recorded. >> >> A zeroth-order approach for accounting for bit-rot might be to use a >> simple temporally-weighted average. This would be simple to implement >> and might even produce marginally useful results. Even if not, it's a >> place to start. >> >> Cheers, >> >> - Ben >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Mon Nov 4 22:11:41 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 4 Nov 2013 17:11:41 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> Message-ID: indeed! Now having those latter tabulations on hackage-server (or a hint for new haskellers about where to look) would be dandy i'm happilly over the "who does/likes what" hump myself, but it is valuable breadcrumbs for folks getting started. That said, asking via cafe / reddit / irc is also valuable because you can get peoples *opinions* about when two libraries are better in what use case. Not all problems can have a "canonically best tool" (as much as we'd like to strive for such tools) On Mon, Nov 4, 2013 at 5:04 PM, Dan Burton wrote: > And these steps are done! > > * Download count is already there on Hackage, though it's relatively new > so it may take some more time for these numbers to have real weight. > * Revdeps are calculated and provided here: > http://packdeps.haskellers.com/reverse > > -- Dan Burton > > > On Mon, Nov 4, 2013 at 1:39 PM, Carter Schonwald < > carter.schonwald at gmail.com> wrote: > >> Honestly the first step is making it easier (and efficient) to look at >> reverse dependency information plus download count. Those numbers are both >> manipulable, but can still yield some informative basic info. >> >> >> On Monday, November 4, 2013, Ben Gamari wrote: >> >>> Charlie Paul writes: >>> >>> > This has been proposed many times before, and each time everyone agrees >>> > that something like this is a good idea. However, like many good >>> proposals, >>> > no one has put up code. >>> > >>> I also think that many Hackage improvements like this one were blocked on >>> Hackage 2. Now since this is finally in the wild it should be a bit >>> easier for people to pick up this sort of project. >>> >>> > Also in this particular case, the devil is in the details. How do >>> ratings >>> > transfer between versions? How do you account for the effects of >>> bitrot? >>> > >>> Certainly there are tricky details to work out but I think a lot of the >>> work will be simply getting to the point where we can collect ratings >>> and stuff them into a database. After this there would need to be some >>> experimentation to work out the finer points you mention. >>> >>> In my mind a rating would consist of some numeric rating (1-5, for >>> instance, >>> perhaps along multiple dimensions, e.g.: quality of documentation, >>> type-safety >>> of interface, performance) for a particular package. The user, date, and >>> current version number should also be recorded. >>> >>> A zeroth-order approach for accounting for bit-rot might be to use a >>> simple temporally-weighted average. This would be simple to implement >>> and might even produce marginally useful results. Even if not, it's a >>> place to start. >>> >>> Cheers, >>> >>> - Ben >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sol at typeful.net Mon Nov 4 22:45:36 2013 From: sol at typeful.net (Simon Hengel) Date: Mon, 4 Nov 2013 23:45:36 +0100 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <87wqknoqwz.fsf@gmail.com> References: <87wqknoqwz.fsf@gmail.com> Message-ID: <20131104224536.GC3424@x200> > In my mind a rating would consist of some numeric rating (1-5, for instance, > perhaps along multiple dimensions, e.g.: quality of documentation, type-safety > of interface, performance) for a particular package. The user, date, and > current version number should also be recorded. I think a simple like/star mechanism is better than 5-star rating. Otherwise I, as a package author, feel tempted to make every user happy in fear of bad reviews (which may not necessarily lead to the most consistent or future proof API). Writing high-quality packages is not a popularity contest! Or maybe just integrating GitHub stars is the way to go? If this leads to more stars for Haskell projects on GitHub, this would also help to promote Haskell in the large open source community! Cheers, Simon From gagliardi.curtis at gmail.com Mon Nov 4 22:50:32 2013 From: gagliardi.curtis at gmail.com (Curtis Gagliardi) Date: Mon, 4 Nov 2013 14:50:32 -0800 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <20131104224536.GC3424@x200> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> Message-ID: Integrating with github stars was what I imagined. I was thinking of maybe forking http://www.clojuresphere.com/ and trying to get it to work with haskell projects. It looks pretty viable since hackage appears to have downloads and haskellers.com looks like it has the dependency graph stuff already done. On Mon, Nov 4, 2013 at 2:45 PM, Simon Hengel wrote: > > In my mind a rating would consist of some numeric rating (1-5, for > instance, > > perhaps along multiple dimensions, e.g.: quality of documentation, > type-safety > > of interface, performance) for a particular package. The user, date, and > > current version number should also be recorded. > > I think a simple like/star mechanism is better than 5-star rating. > Otherwise I, as a package author, feel tempted to make every user happy > in fear of bad reviews (which may not necessarily lead to the most > consistent or future proof API). Writing high-quality packages is not a > popularity contest! > > Or maybe just integrating GitHub stars is the way to go? If this leads > to more stars for Haskell projects on GitHub, this would also help to > promote Haskell in the large open source community! > > Cheers, > Simon > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tifonzafel at gmail.com Mon Nov 4 22:51:04 2013 From: tifonzafel at gmail.com (felipe zapata) Date: Mon, 4 Nov 2013 23:51:04 +0100 Subject: [Haskell-cafe] updating multiple fields of a record with lenses Message-ID: Dear Haskellers, let's suppose I have the following lenses data Foo = Foo { _a :: String _b :: [Double] _c :: Vector Double _d :: Int .............. (more fields) _z :: Double } Now, I want to update fields a,b,c and d without changing the rest. What is the functional way of doing it ? Surely there a function smarter than set a "String" . set b [1,2,3] . set c <1,2,3> . set d 4 $ foo can some please help me with it? Thanks in advance, Felipe Z. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danburton.email at gmail.com Mon Nov 4 23:04:15 2013 From: danburton.email at gmail.com (Dan Burton) Date: Mon, 4 Nov 2013 15:04:15 -0800 Subject: [Haskell-cafe] updating multiple fields of a record with lenses In-Reply-To: References: Message-ID: There's not really a "smarter" way to do it, but there is a "prettier" way: foo & a .~ "String" & b .~ [1,2,3] & c .~ 'c' & d .~ 4 -- Dan Burton On Mon, Nov 4, 2013 at 2:51 PM, felipe zapata wrote: > Dear Haskellers, > > let's suppose I have the following lenses > > data Foo = Foo { _a :: String > _b :: [Double] > _c :: Vector Double > _d :: Int > .............. (more fields) > _z :: Double > } > > Now, I want to update fields a,b,c and d without changing the rest. > What is the functional way of doing it ? > > Surely there a function smarter than > > set a "String" . set b [1,2,3] . set c <1,2,3> . set d 4 $ foo > > can some please help me with it? > > Thanks in advance, > > Felipe Z. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From charlieap at gmail.com Mon Nov 4 23:09:42 2013 From: charlieap at gmail.com (Charlie Paul) Date: Mon, 4 Nov 2013 15:09:42 -0800 Subject: [Haskell-cafe] updating multiple fields of a record with lenses In-Reply-To: References: Message-ID: I had a similar question a while back, and I've been wondering why there isn't a nicer way to combine fine grained lenses. It could be used to create law-breaking lenses, but it instead gets implemented manually each time. Perhaps some sort of typeclass or GADT arrangement could be used to define a 'basis' of an object consiting of lenses which are independent, so setting twice works fine. Actually, I think an Iso' with a tuple would be sufficient to define this. On Mon, Nov 4, 2013 at 3:04 PM, Dan Burton wrote: > There's not really a "smarter" way to do it, but there is a "prettier" way: > > foo > & a .~ "String" > & b .~ [1,2,3] > & c .~ 'c' > & d .~ 4 > > > -- Dan Burton > > > On Mon, Nov 4, 2013 at 2:51 PM, felipe zapata wrote: > >> Dear Haskellers, >> >> let's suppose I have the following lenses >> >> data Foo = Foo { _a :: String >> _b :: [Double] >> _c :: Vector Double >> _d :: Int >> .............. (more fields) >> _z :: Double >> } >> >> Now, I want to update fields a,b,c and d without changing the rest. >> What is the functional way of doing it ? >> >> Surely there a function smarter than >> >> set a "String" . set b [1,2,3] . set c <1,2,3> . set d 4 $ foo >> >> can some please help me with it? >> >> Thanks in advance, >> >> Felipe Z. >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhiwudazhanjiangshi at gmail.com Tue Nov 5 01:48:07 2013 From: zhiwudazhanjiangshi at gmail.com (yi lu) Date: Tue, 5 Nov 2013 09:48:07 +0800 Subject: [Haskell-cafe] When will next release of haskell-platform come? Message-ID: Hi, As the subject goes, when will it come? http://trac.haskell.org/haskell-platform/wiki/ReleaseTimetable Even though I hope for a `good` release to use, I hope to use it earlier. BTW, what are you expecting for this release? Best Regards, Yi -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Nov 5 02:06:44 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 4 Nov 2013 21:06:44 -0500 Subject: [Haskell-cafe] When will next release of haskell-platform come? In-Reply-To: References: Message-ID: soon. Mark is currently actively working on this. he's been working out a way to support some OS X related issues in a way he's happy supporting, and i imagine theres some other bits underway. point being, soon! installing On Mon, Nov 4, 2013 at 8:48 PM, yi lu wrote: > Hi, > > As the subject goes, when will it come? > http://trac.haskell.org/haskell-platform/wiki/ReleaseTimetable > Even though I hope for a `good` release to use, I hope to use it earlier. > > BTW, what are you expecting for this release? > > Best Regards, > Yi > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roma at ro-che.info Tue Nov 5 05:35:02 2013 From: roma at ro-che.info (Roman Cheplyaka) Date: Tue, 5 Nov 2013 07:35:02 +0200 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <20131104224536.GC3424@x200> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> Message-ID: <20131105053502.GA26966@sniper> * Simon Hengel [2013-11-04 23:45:36+0100] > Or maybe just integrating GitHub stars is the way to go? If this leads > to more stars for Haskell projects on GitHub, this would also help to > promote Haskell in the large open source community! That's a great idea! The github url can be derived by checking the homepage url and the source repository location for the right pattern. (At least one of these should point to github.) Then we just need to send a GET request at http://api.github.com/repos/:owner/:repo/stargazers and parse the JSON response. To avoid the delay while loading the page, I guess it's better to do this asynchronously on the client side. Anyone cares to write this piece of javascript? Roman -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From carter.schonwald at gmail.com Tue Nov 5 05:49:28 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 5 Nov 2013 00:49:28 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <20131105053502.GA26966@sniper> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> Message-ID: would we also want to integrate bitbucket and darcsden analogues as well? On Tue, Nov 5, 2013 at 12:35 AM, Roman Cheplyaka wrote: > * Simon Hengel [2013-11-04 23:45:36+0100] > > Or maybe just integrating GitHub stars is the way to go? If this leads > > to more stars for Haskell projects on GitHub, this would also help to > > promote Haskell in the large open source community! > > That's a great idea! > > The github url can be derived by checking the homepage url and the > source repository location for the right pattern. (At least one of these > should point to github.) > > Then we just need to send a GET request at > > http://api.github.com/repos/:owner/:repo/stargazers > > and parse the JSON response. > > To avoid the delay while loading the page, I guess it's better to do > this asynchronously on the client side. > > Anyone cares to write this piece of javascript? > > Roman > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Tue Nov 5 05:53:40 2013 From: magnus at therning.org (Magnus Therning) Date: Tue, 5 Nov 2013 06:53:40 +0100 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: <5276C8B4.80108@vex.net> References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> <20131103054604.GB2047@mteis> <5276C8B4.80108@vex.net> Message-ID: <20131105055340.GA1018@mteis.lan> On Sun, Nov 03, 2013 at 05:05:40PM -0500, Albert Y. C. Lai wrote: > On 13-11-03 01:46 AM, Magnus Therning wrote: >>Is there already a way to get Cabal to put in an RPATH such that an >>*installed* executable works correctly, or is this a fairly serious >>bug in Cabal? > > It is usually desirable to set RPATH to libs' installation locations > rather than libs' build trees, and I think I prefer it too. But the > exception is during "cabal test", when you should test against libs > in the build tree. It is somewhat a dilemma. Indeed, that is a bit of a problem. However, I'd argue that /installation/ of a package is the scenario to make as simple as possible. Forcing the use of LD_LIBRARY_PATH in order to run `cabal test` is much more acceptable to me than forcing its use to run an installed executable. > It is, in fact, sad that we have to set RPATH at all, and we have to > because Haskell libs are not common, and they are not dumped > directly into /usr/lib and /usr/local/lib. (They are, instead, > scattered over /usr/local/lib/p-n/ghc-m, for wide ranges of values > of p, n, and m.) If not for this, we would set no RPATH, we would do > nothing special for installations, and we just had to play with > LD_LIBRARY_PATH or LD_RUN_PATH or something during testing. > > (I would, in fact, not mind that organization, if symlinks were set > up directly in /usr/local/lib. Note: the filename is already > libHSp-n-ghcm.so, it already records p, n, and m, there is no clash > putting that name right into /usr/local/lib alongside siblings and > cousins --- well, no more clash than the /usr/local/lib/p-n/ghc-m > scheme.) We have have been considering a scheme like this when packaging for Arch Haskell (inofficial packages for Arch Linux). Something along the lines of putting symlinks in /usr/lib/ghc-7.6.3/ and then drop a file in /etc/ld.so.conf.d/ that adds it to the runtime linker's search path. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus The day after tomorrow is the third day of the rest of your life. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From charlieap at gmail.com Tue Nov 5 06:01:04 2013 From: charlieap at gmail.com (Charlie Paul) Date: Mon, 4 Nov 2013 22:01:04 -0800 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> Message-ID: If we go with the star-based option, I don't see a serious reason not to add other sites as well. Though, if our goal is to get a rating of sorts from it, we would need to have factors for each hosting site, to account for varying user bases. On Mon, Nov 4, 2013 at 9:49 PM, Carter Schonwald wrote: > would we also want to integrate bitbucket and darcsden analogues as well? > > > On Tue, Nov 5, 2013 at 12:35 AM, Roman Cheplyaka wrote: > >> * Simon Hengel [2013-11-04 23:45:36+0100] >> > Or maybe just integrating GitHub stars is the way to go? If this leads >> > to more stars for Haskell projects on GitHub, this would also help to >> > promote Haskell in the large open source community! >> >> That's a great idea! >> >> The github url can be derived by checking the homepage url and the >> source repository location for the right pattern. (At least one of these >> should point to github.) >> >> Then we just need to send a GET request at >> >> http://api.github.com/repos/:owner/:repo/stargazers >> >> and parse the JSON response. >> >> To avoid the delay while loading the page, I guess it's better to do >> this asynchronously on the client side. >> >> Anyone cares to write this piece of javascript? >> >> Roman >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ozgun.ataman at soostone.com Tue Nov 5 06:22:02 2013 From: ozgun.ataman at soostone.com (Ozgun Ataman) Date: Tue, 5 Nov 2013 01:22:02 -0500 Subject: [Haskell-cafe] Soostone Hiring In Turkey Message-ID: Dear Haskellers, Soostone is hiring Haskell programmers for its Turkey R&D group located in METU research park in Ankara. These position(s) are only available for local candidates with no possibility for remote work at this point in time. Interested fellow Haskellers may respond directly to me or to jobs at soostone.com. Soostone is an enterprise analytics company with a technology stack built entirely on Haskell. We work on interesting engineering challenges that span a multitude of topics in our area of expertise, including big-data crunching, predictive models, machine learning, data visualization and web-app development - all predominantly using Haskell. As a full-time member of our team in Ankara, you will work collaboratively with our HQ team in New York and get a chance to put your Haskell skills to use in real-world research, products and services. Soostone is also very involved with the open source community. Our team members maintain several packages on Hackage, contribute significantly to the Snap Web Framework, co-organize the New York Haskell Meetup and frequently participate in various community debates. We encourage all our team members to play an active role in the community in ways they find interesting and rewarding. Ideal candidates for this position will have: - A solid grasp of the Haskell language with an ability to produce working code from from day one (monad transformers, concurrency, streaming IO, dealing with space leaks, etc.) - Significant experience crafting software products, in academia and/or the industry - Strong presence in the OSS community with released packages in Hackage considered a big plus - Good communication skills and comfort in working as part of a team - Significant experience in a relevant application area such as compilers, distributed computing, numerics, machine learning, simulations or graphics - Experience in web application development and familiarity with web technologies - Willingness and enthusiasm to learn quickly and extend capabilities in new directions as necessary We look forward to hearing from interested candidates. The Soostone Team -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Nov 5 07:00:31 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 5 Nov 2013 02:00:31 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> Message-ID: honestly this is getting a bit over complex and silly! Should we also have google +1s and fb likes? What about # of blog posts? number of upvotes on on reddit? These are all great marketing metrics, but they dont help an end user understand which libs are *used*. github stars are not a measure of quality, but more of wow/coolness factor. lets try to stick to metrics that correspond to library usage and volume of developer activity On Tue, Nov 5, 2013 at 1:01 AM, Charlie Paul wrote: > If we go with the star-based option, I don't see a serious reason not to > add other sites as well. Though, if our goal is to get a rating of sorts > from it, we would need to have factors for each hosting site, to account > for varying user bases. > > > On Mon, Nov 4, 2013 at 9:49 PM, Carter Schonwald < > carter.schonwald at gmail.com> wrote: > >> would we also want to integrate bitbucket and darcsden analogues as well? >> >> >> On Tue, Nov 5, 2013 at 12:35 AM, Roman Cheplyaka wrote: >> >>> * Simon Hengel [2013-11-04 23:45:36+0100] >>> > Or maybe just integrating GitHub stars is the way to go? If this leads >>> > to more stars for Haskell projects on GitHub, this would also help to >>> > promote Haskell in the large open source community! >>> >>> That's a great idea! >>> >>> The github url can be derived by checking the homepage url and the >>> source repository location for the right pattern. (At least one of these >>> should point to github.) >>> >>> Then we just need to send a GET request at >>> >>> http://api.github.com/repos/:owner/:repo/stargazers >>> >>> and parse the JSON response. >>> >>> To avoid the delay while loading the page, I guess it's better to do >>> this asynchronously on the client side. >>> >>> Anyone cares to write this piece of javascript? >>> >>> Roman >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From christiaan.baaij at gmail.com Tue Nov 5 08:42:28 2013 From: christiaan.baaij at gmail.com (Christiaan Baaij) Date: Tue, 5 Nov 2013 09:42:28 +0100 Subject: [Haskell-cafe] Cabal bug? (was Re: Cabal: --enable-shared and executables) In-Reply-To: References: <20131031202627.GB1004@mteis.lan> <5272C89B.3070302@vex.net> <20131103054604.GB2047@mteis> <5276C8B4.80108@vex.net> Message-ID: <7896A195-B546-469F-BEA0-6087CD399207@gmail.com> Indeed I want to point out that dynamic library locations are already handled differently between OS X and Linux in GHC(-head), not just Cabal: http://ghc.haskell.org/trac/ghc/ticket/8266#comment:14 So perhaps there should be a 'proper' fix/design on how to deal with dynamic library location in both GHC and Cabal. -- Christiaan On Nov 4, 2013, at 12:13 AM, Brandon Allbery wrote: > On Sun, Nov 3, 2013 at 5:05 PM, Albert Y. C. Lai wrote: > It is usually desirable to set RPATH to libs' installation locations rather than libs' build trees > > May I note that this is system dependent? OS X compiles in full paths (and DYLD_LIBRARY_PATH overrides these, which is part of why it's much more dangerous than Linux's LD_LIBRARY_PATH). On the other end, I don't think Windows has much of an RPATH mechanism at all. > > -- > brandon s allbery kf8nh sine nomine associates > allbery.b at gmail.com ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From omeragacan at gmail.com Tue Nov 5 14:07:40 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Tue, 5 Nov 2013 16:07:40 +0200 Subject: [Haskell-cafe] Soostone Hiring In Turkey In-Reply-To: References: Message-ID: This is great, thanks for sharing. --- ?mer Sinan A?acan http://osa1.net 2013/11/5 Ozgun Ataman : > Dear Haskellers, > > Soostone is hiring Haskell programmers for its Turkey R&D group located in > METU research park in Ankara. These position(s) are only available for local > candidates with no possibility for remote work at this point in time. > Interested fellow Haskellers may respond directly to me or to > jobs at soostone.com. > > Soostone is an enterprise analytics company with a technology stack built > entirely on Haskell. We work on interesting engineering challenges that span > a multitude of topics in our area of expertise, including big-data > crunching, predictive models, machine learning, data visualization and > web-app development - all predominantly using Haskell. As a full-time member > of our team in Ankara, you will work collaboratively with our HQ team in New > York and get a chance to put your Haskell skills to use in real-world > research, products and services. > > Soostone is also very involved with the open source community. Our team > members maintain several packages on Hackage, contribute significantly to > the Snap Web Framework, co-organize the New York Haskell Meetup and > frequently participate in various community debates. We encourage all our > team members to play an active role in the community in ways they find > interesting and rewarding. > > Ideal candidates for this position will have: > > A solid grasp of the Haskell language with an ability to produce working > code from from day one (monad transformers, concurrency, streaming IO, > dealing with space leaks, etc.) > Significant experience crafting software products, in academia and/or the > industry > Strong presence in the OSS community with released packages in Hackage > considered a big plus > Good communication skills and comfort in working as part of a team > Significant experience in a relevant application area such as compilers, > distributed computing, numerics, machine learning, simulations or graphics > Experience in web application development and familiarity with web > technologies > Willingness and enthusiasm to learn quickly and extend capabilities in new > directions as necessary > > > We look forward to hearing from interested candidates. > > > The Soostone Team > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From allbery.b at gmail.com Tue Nov 5 14:14:42 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 5 Nov 2013 09:14:42 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> Message-ID: On Tue, Nov 5, 2013 at 2:00 AM, Carter Schonwald wrote: > honestly this is getting a bit over complex and silly! Should we also have > google +1s and fb likes? What about # of blog posts? number of upvotes on > on reddit? These are all great marketing metrics, but they dont help an end > user understand which libs are *used*. > > github stars are not a measure of quality, but more of wow/coolness > factor. > > lets try to stick to metrics that correspond to library usage and volume > of developer activity > +1 -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From bgamari.foss at gmail.com Tue Nov 5 17:39:46 2013 From: bgamari.foss at gmail.com (Ben Gamari) Date: Tue, 05 Nov 2013 12:39:46 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> Message-ID: <87ppqeoihp.fsf@gmail.com> Curtis Gagliardi writes: > Integrating with github stars was what I imagined. I was thinking of maybe > forking http://www.clojuresphere.com/ and trying to get it to work with > haskell projects. It looks pretty viable since hackage appears to have > downloads and haskellers.com looks like it has the dependency graph stuff > already done. > I'm not sure about this. It seems like a rather indirect metric. I, for one, often use Github's star feature as more of a bookmark facility than anything else; a reminder to have a look at a project when there are free cycles. In my experience stars are rarely removed so there is really no way to account for stagnation. Instead, the metric turns into more of an indicator of project age than quality. I'll admit that I may have been overcomplicating things in suggesting a multidimensional rating space, however. Cheers, - Ben -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 489 bytes Desc: not available URL: From dhelta.diaz at gmail.com Tue Nov 5 17:51:02 2013 From: dhelta.diaz at gmail.com (=?UTF-8?Q?Daniel_D=C3=ADaz_Casanueva?=) Date: Tue, 5 Nov 2013 18:51:02 +0100 Subject: [Haskell-cafe] Stackage Package List Message-ID: Hello Haskellers. I was looking for a complete list of the packages included in Stackage, the vetted (sub)set of packages from Hackage. I couldn't find one (except by looking at the source code of Stackage [1] directly) so I made one. http://daniel-diaz.github.io/stackagelist It is automatically updated regularly, based on the GitHub repo of Stackage. As a next step, I will include also the list of packages that are not included directly on Stackage, but as a dependency of an included package. This way, it will be possible to check easily which libraries will be available after building Stackage, also having access to their documentation via links to Hackage. I was doing this for me, but I thought it could be useful for someone else, so I share it. Best regards, Daniel D?az. -- References [1] https://github.com/fpco/stackage/blob/master/Stackage/Config.hs -------------- next part -------------- An HTML attachment was scrubbed... URL: From omeragacan at gmail.com Tue Nov 5 18:36:55 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Tue, 5 Nov 2013 20:36:55 +0200 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <87ppqeoihp.fsf@gmail.com> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <87ppqeoihp.fsf@gmail.com> Message-ID: Hi all, I must admit that I didn't read all responses in detail, but what I figured is that we just can't make everyone happy. I think what's need to be done is someone create a webpage that uses hackage pages, but adds ratings/comments/whatever to the same page so that we can at least discuss and rate packages and then wait for users to contribute. Of course the obvious question is why not do it myself? This is because I'm currently very busy and I can't spare my time for this. (also, I'm not very experienced in web stuff so it costs me more time than it costs someone more experienced in this stuff) --- ?mer Sinan A?acan http://osa1.net 2013/11/5 Ben Gamari : > Curtis Gagliardi writes: > >> Integrating with github stars was what I imagined. I was thinking of maybe >> forking http://www.clojuresphere.com/ and trying to get it to work with >> haskell projects. It looks pretty viable since hackage appears to have >> downloads and haskellers.com looks like it has the dependency graph stuff >> already done. >> > I'm not sure about this. It seems like a rather indirect metric. I, for > one, often use Github's star feature as more of a bookmark facility than > anything else; a reminder to have a look at a project when there are > free cycles. In my experience stars are rarely removed so there is really > no way to account for stagnation. Instead, the metric turns into more of > an indicator of project age than quality. > > I'll admit that I may have been overcomplicating things in suggesting a > multidimensional rating space, however. > > Cheers, > > - Ben > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From haskellcafe at gmail.com Wed Nov 6 01:05:46 2013 From: haskellcafe at gmail.com (haskell cafe) Date: Tue, 5 Nov 2013 17:05:46 -0800 Subject: [Haskell-cafe] Better integration with Xcode Message-ID: I'm pretty new to Haskell, but have been having fun learning it. Being a Mac and Windows programmer most of my life, I'm used to using GUIs and IDEs to program and don't really care for using command-line tools. As such, I've been working on getting Xcode to build Haskell files directly and I have something working that I thought others might be interested in. Looking through the "Building/Cross-Compiling/iOS" instructions, it looks like the standard way of building Haskell files is to build them on the command line into a library and then link your C/C++/Objective-C sources against the library. But you don't need to do this. You can directly edit Haskell in Xcode (with very basic syntax highlighting), and build it from Xcode all without ever going to the command-line. Would people be interested in working this way? If so, I'll be happy to post steps to do it. -DC -------------- next part -------------- An HTML attachment was scrubbed... URL: From coreyoconnor at gmail.com Wed Nov 6 02:10:27 2013 From: coreyoconnor at gmail.com (Corey O'Connor) Date: Tue, 5 Nov 2013 18:10:27 -0800 Subject: [Haskell-cafe] a tiny HTTP server.. that doesn't work In-Reply-To: References: Message-ID: I've updated the code to handle persistent connections. As best I can figure anyways.. Unfortunately this does not resolve the issue. The server still reports the connection being closed before the full response is read. The test is done via JMeter. See the perf_test.jmx file. I've confirmed JMeter is include "connection: close" headers in all requests. Which means the persistent connection code is not even being exercised. From instrumenting the code I can confirm this is the case: All requests include "connection: close" and the client never performs a second request using the same stream. An additional data point: The same test when run with 1 capability (EG: +RTS -N1) does *not* fail. There are no connection close errors. Only when running with multiple capabilities does the test fail. Cheers, Corey -Corey O'Connor coreyoconnor at gmail.com http://corebotllc.com/ On Tue, Oct 22, 2013 at 4:54 PM, Corey O'Connor wrote: > On Mon, Oct 21, 2013 at 7:28 PM, Joey Adams wrote: > >> On Mon, Oct 21, 2013 at 5:15 PM, Corey O'Connor wrote: >> >>> Curiously: If the Network.HTTP.close is removed the server does not >>> fail, but some requests takes several seconds to process. I presume the >>> ordering of effects is then correct, but without the explicit close the >>> close occurs only a GC time. >>> >> >> The client may be trying to reuse the connection; see >> http://en.wikipedia.org/wiki/HTTP_persistent_connection. This seems >> consistent with your results: >> >> * With the close call: connection is closed right after client sends a >> second request, so client whines. >> * Without the close call: client waits around for a response, then gives >> up and establishes another connection. >> >> To confirm, add another receiveHTTP call client_interact and see if it >> returns another Request. >> > > ?Thanks!? I'll try your test and see if anything changes. > > Though I thought the code accounted for this: A connection close header is > added to each response. Which I thought would cause the client to close the > connection.?? I could be totally wrong tho. There could be some additional > aspect of HTTP connections I do not understand. > > Properly supporting persistent connections should be pretty easy. There is > another Network.HTTP server package that does this: > http://hackage.haskell.org/package/http-server-1/docs/Network-HTTP-Server.html > > So I'll give that a shot and report back. > > Thanks! > Corey > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Nov 6 04:02:46 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 5 Nov 2013 23:02:46 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <87ppqeoihp.fsf@gmail.com> Message-ID: The beauty of open source is everyone is busy, so people only work on things they truly care about! On Tuesday, November 5, 2013, ?mer Sinan A?acan wrote: > Hi all, > > I must admit that I didn't read all responses in detail, but what I > figured is that we just can't make everyone happy. I think what's need > to be done is someone create a webpage that uses hackage pages, but > adds ratings/comments/whatever to the same page so that we can at > least discuss and rate packages and then wait for users to contribute. > > Of course the obvious question is why not do it myself? This is > because I'm currently very busy and I can't spare my time for this. > (also, I'm not very experienced in web stuff so it costs me more time > than it costs someone more experienced in this stuff) > > --- > ?mer Sinan A?acan > http://osa1.net > > > 2013/11/5 Ben Gamari >: > > Curtis Gagliardi > writes: > > > >> Integrating with github stars was what I imagined. I was thinking of > maybe > >> forking http://www.clojuresphere.com/ and trying to get it to work with > >> haskell projects. It looks pretty viable since hackage appears to have > >> downloads and haskellers.com looks like it has the dependency graph > stuff > >> already done. > >> > > I'm not sure about this. It seems like a rather indirect metric. I, for > > one, often use Github's star feature as more of a bookmark facility than > > anything else; a reminder to have a look at a project when there are > > free cycles. In my experience stars are rarely removed so there is really > > no way to account for stagnation. Instead, the metric turns into more of > > an indicator of project age than quality. > > > > I'll admit that I may have been overcomplicating things in suggesting a > > multidimensional rating space, however. > > > > Cheers, > > > > - Ben > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ketil at malde.org Wed Nov 6 08:34:45 2013 From: ketil at malde.org (Ketil Malde) Date: Wed, 06 Nov 2013 09:34:45 +0100 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> Message-ID: <87wqkm0vyy.fsf@wespe.malde.org> > lets try to stick to metrics that correspond to library usage and volume of > developer activity How about comments? Using e.g. disqus, it's a minimal administrative overhead, and provide user-contributed information without any artificial limitations or ambiguity. For instance, I recently updated a library to work with newer compilers, and sent the patches to the previous maintainer. He suggested I just upload it to Hackage, but this is not allowed anymore, and I haven't heard from him since. If I could add a comment, I could at least point to my repository with an updated library version until this can be resolved. -k -- If I haven't seen further, it is by standing in the footprints of giants From carter.schonwald at gmail.com Wed Nov 6 08:38:47 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 6 Nov 2013 03:38:47 -0500 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <87wqkm0vyy.fsf@wespe.malde.org> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> <87wqkm0vyy.fsf@wespe.malde.org> Message-ID: 1) comments have spam 2) the new process for getting the ACLs to a package where you're taking over is to email the libraries list and have the prior maintainer say "yes, Ketil is now maintainer" and/or you tell the libraries list "i couldn't reach the maintainer and its been X time period" and they'll giveyou push powers. email the libraries list and someone can help. or go on #hackage on IRC and ask On Wed, Nov 6, 2013 at 3:34 AM, Ketil Malde wrote: > > > lets try to stick to metrics that correspond to library usage and volume > of > > developer activity > > How about comments? Using e.g. disqus, it's a minimal administrative > overhead, and provide user-contributed information without any > artificial limitations or ambiguity. > > For instance, I recently updated a library to work with newer > compilers, and sent the patches to the previous maintainer. He > suggested I just upload it to Hackage, but this is not allowed anymore, > and I haven't heard from him since. If I could add a comment, I could > at least point to my repository with an updated library version until > this can be resolved. > > -k > -- > If I haven't seen further, it is by standing in the footprints of giants > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Nov 6 14:17:48 2013 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 6 Nov 2013 14:17:48 +0000 Subject: [Haskell-cafe] Unused Arrow commands do not give warning Message-ID: <20131106141748.GA26474@weber> GHC can give you a warning when you fail to use the result of a monadic action in a do block. The same does not hold for arrow commands in arrow notation. (See demonstration below signature). What would it take to add a warning for this? I am writing arrow-heavy code at the moment and I think such a warning would be a nice feature. Tom % cat Test.hs {-# LANGUAGE Arrows #-} module Test where import Control.Arrow (returnA, arr) import Control.Monad.Identity (Identity(..)) foo :: Identity () foo = do Identity True return () bar :: () -> () bar = proc () -> do arr (const True) -< () returnA -< () % ghc -fforce-recomp -Wall Test.hs [1 of 1] Compiling Test ( Test.hs, Test.o ) Test.hs:10:5: Warning: A do-notation statement discarded a result of type Bool. Suppress this warning by saying "_ <- Data.Functor.Identity.Identity GHC.Types.True", or by using the flag -fno-warn-unused-do-bind From ariep at xs4all.nl Wed Nov 6 14:45:01 2013 From: ariep at xs4all.nl (Arie Peterson) Date: Wed, 06 Nov 2013 15:45:01 +0100 Subject: [Haskell-cafe] Deprecation of MonadCatchIO-transformers Message-ID: <1864368.APlfMav6Fz@a4> Hi all, As discussed before , the interface of the MonadCatchIO packages is effectively deprecated by the removal of the 'block' and 'unblock' functions in base-4.7. I would like to deprecate MonadCatchIO-transformers now. As there are quite a few reverse dependencies, and as there is at least one use case that apparently cannot be migrated easily , I will try to keep the package functioning, for now. In order to do this, I followed Edward Z. Yang's suggestion, and re- implemented the IO instances of block and unblock, in terms of GHC primitives. The instance now reads > import qualified Control.Exception.Extensible as E > import GHC.Base (maskAsyncExceptions#) > import GHC.IO (unsafeUnmask,IO(IO)) > > instance MonadCatchIO IO where > catch = E.catch > block = \ (IO io) -> IO $ maskAsyncExceptions# io > unblock = unsafeUnmask You can get a release candidate for a new version 0.3.1.0, by darcs get http://patch-tag.com/r/AriePeterson/MonadCatchIO-transformers I would be most grateful if someone could review and/or test this under GHC 7.8! Regards, Arie From ozgurakgun at gmail.com Wed Nov 6 15:01:52 2013 From: ozgurakgun at gmail.com (Ozgur Akgun) Date: Wed, 6 Nov 2013 15:01:52 +0000 Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: <87wqkm0vyy.fsf@wespe.malde.org> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> <87wqkm0vyy.fsf@wespe.malde.org> Message-ID: Hi. On 6 November 2013 08:34, Ketil Malde wrote: > > lets try to stick to metrics that correspond to library usage and volume > of > > developer activity > > How about comments? Using e.g. disqus, it's a minimal administrative > overhead, and provide user-contributed information without any > artificial limitations or ambiguity. Does anyone remember this ? I had enabled the user script back then, and I still see disqus comments on hackage. The comments are not useful at all though, because they practically do not exist. (Very few people used the user script anyway.) -- Ozgur Akgun -------------- next part -------------- An HTML attachment was scrubbed... URL: From noteed at gmail.com Wed Nov 6 15:19:57 2013 From: noteed at gmail.com (Vo Minh Thu) Date: Wed, 6 Nov 2013 16:19:57 +0100 Subject: [Haskell-cafe] Stackage Package List In-Reply-To: References: Message-ID: 2013/11/5 Daniel D?az Casanueva : > Hello Haskellers. > > I was looking for a complete list of the packages included in Stackage, the > vetted (sub)set of packages from Hackage. I couldn't find one (except by > looking at the source code of Stackage [1] directly) so I made one. > > http://daniel-diaz.github.io/stackagelist > > It is automatically updated regularly, based on the GitHub repo of Stackage. > As a next step, I will include also the list of packages that are not > included directly on Stackage, but as a dependency of an included package. > This way, it will be possible to check easily which libraries will be > available after building Stackage, also having access to their documentation > via links to Hackage. > > I was doing this for me, but I thought it could be useful for someone else, > so I share it. Hi, Thanks for the list. By the way, there is nothing related to Snap on Stackage, why is it so ? Should someone add it ? Or should someone create a Snackage ? Cheers, Thu From coreyoconnor at gmail.com Wed Nov 6 19:55:29 2013 From: coreyoconnor at gmail.com (Corey O'Connor) Date: Wed, 6 Nov 2013 11:55:29 -0800 Subject: [Haskell-cafe] a tiny HTTP server.. that doesn't work In-Reply-To: References: Message-ID: My current guess: This is a bug in how the socket is set up or one of the underlying libraries. Using the stream debug hooks indicates the failure is due to "readLine" returning an empty line when parsing the request header. I cannot tell if an empty line is returned due to an actual 0 byte return from read/recv or some processing of the read data. Still, this would indicate the HTTP library considers the request to be malformed. The question is then: Are the requests from JMeter malformed? A wireshark capture was performed of the JMeter test traffic. This wireshark data indicated 5000 HTTP requests were made. Which is what JMeter produced. All 5000 of these requests were byte identical. This capture did not affect the test results: A similar number of requests failed. I tried to instrument the read/recv calls using dtrace. This indicated read, and not recv, was used when reading from teh socket. I was unable to determine anything else tho. Probably a better idea to instrument HTTP library a bit more. Cheers, Corey -Corey O'Connor coreyoconnor at gmail.com http://corebotllc.com/ On Tue, Nov 5, 2013 at 6:10 PM, Corey O'Connor wrote: > I've updated the code to handle persistent connections. As best I can > figure anyways.. > Unfortunately this does not resolve the issue. The server still reports > the connection being closed before the full response is read. > > The test is done via JMeter. See the perf_test.jmx file. I've confirmed > JMeter is include "connection: close" headers in all requests. Which means > the persistent connection code is not even being exercised. From > instrumenting the code I can confirm this is the case: All requests include > "connection: close" and the client never performs a second request using > the same stream. > > An additional data point: The same test when run with 1 capability (EG: > +RTS -N1) does *not* fail. There are no connection close errors. Only when > running with multiple capabilities does the test fail. > > Cheers, > Corey > > > -Corey O'Connor > coreyoconnor at gmail.com > http://corebotllc.com/ > > > On Tue, Oct 22, 2013 at 4:54 PM, Corey O'Connor wrote: > >> On Mon, Oct 21, 2013 at 7:28 PM, Joey Adams wrote: >> >>> On Mon, Oct 21, 2013 at 5:15 PM, Corey O'Connor >> > wrote: >>> >>>> Curiously: If the Network.HTTP.close is removed the server does not >>>> fail, but some requests takes several seconds to process. I presume the >>>> ordering of effects is then correct, but without the explicit close the >>>> close occurs only a GC time. >>>> >>> >>> The client may be trying to reuse the connection; see >>> http://en.wikipedia.org/wiki/HTTP_persistent_connection. This seems >>> consistent with your results: >>> >>> * With the close call: connection is closed right after client sends a >>> second request, so client whines. >>> * Without the close call: client waits around for a response, then >>> gives up and establishes another connection. >>> >>> To confirm, add another receiveHTTP call client_interact and see if it >>> returns another Request. >>> >> >> ?Thanks!? I'll try your test and see if anything changes. >> >> Though I thought the code accounted for this: A connection close header >> is added to each response. Which I thought would cause the client to close >> the connection.?? I could be totally wrong tho. There could be some >> additional aspect of HTTP connections I do not understand. >> >> Properly supporting persistent connections should be pretty easy. There >> is another Network.HTTP server package that does this: >> http://hackage.haskell.org/package/http-server-1/docs/Network-HTTP-Server.html >> >> So I'll give that a shot and report back. >> >> Thanks! >> Corey >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dhelta.diaz at gmail.com Wed Nov 6 20:23:33 2013 From: dhelta.diaz at gmail.com (=?UTF-8?Q?Daniel_D=C3=ADaz_Casanueva?=) Date: Wed, 6 Nov 2013 21:23:33 +0100 Subject: [Haskell-cafe] Stackage Package List In-Reply-To: References: Message-ID: Hi! As I promised, now it includes the list of direct and indirect dependencies. http://daniel-diaz.github.io/stackagelist To Vo Minh Thu: a pull request to the Stackage repo [1] that includes any desired package to the Stackage.Config module should be enough to get it included. Also, read this: https://github.com/fpco/stackage/wiki/Maintainers-Agreement Best regards, Daniel D?az. -- Refs [1] Stackage GitHub repo - https://github.com/fpco/stackage On Wed, Nov 6, 2013 at 4:19 PM, Vo Minh Thu wrote: > 2013/11/5 Daniel D?az Casanueva : > > Hello Haskellers. > > > > I was looking for a complete list of the packages included in Stackage, > the > > vetted (sub)set of packages from Hackage. I couldn't find one (except by > > looking at the source code of Stackage [1] directly) so I made one. > > > > http://daniel-diaz.github.io/stackagelist > > > > It is automatically updated regularly, based on the GitHub repo of > Stackage. > > As a next step, I will include also the list of packages that are not > > included directly on Stackage, but as a dependency of an included > package. > > This way, it will be possible to check easily which libraries will be > > available after building Stackage, also having access to their > documentation > > via links to Hackage. > > > > I was doing this for me, but I thought it could be useful for someone > else, > > so I share it. > > Hi, > > Thanks for the list. By the way, there is nothing related to Snap on > Stackage, why is it so ? Should someone add it ? Or should someone > create a Snackage ? > > Cheers, > Thu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From haskellcafe at gmail.com Wed Nov 6 23:47:44 2013 From: haskellcafe at gmail.com (haskell cafe) Date: Wed, 6 Nov 2013 15:47:44 -0800 Subject: [Haskell-cafe] Better integration with Xcode In-Reply-To: References: Message-ID: On Tue, Nov 5, 2013 at 5:05 PM, haskell cafe wrote: > I'm pretty new to Haskell, but have been having fun learning it. Being a > Mac and Windows programmer most of my life, I'm used to using GUIs and IDEs > to program and don't really care for using command-line tools. As such, > I've been working on getting Xcode to build Haskell files directly and I > have something working that I thought others might be interested in. > > Looking through the "Building/Cross-Compiling/iOS" instructions, it looks > like the standard way of building Haskell files is to build them on the > command line into a library and then link your C/C++/Objective-C sources > against the library. But you don't need to do this. You can directly edit > Haskell in Xcode (with very basic syntax highlighting), and build it from > Xcode all without ever going to the command-line. > > Would people be interested in working this way? If so, I'll be happy to > post steps to do it. > A couple people indicated off-list that they would be interested in this, so here are the details. I'll send information about getting Xcode to do syntax coloring in a separate email. You can get Xcode to compile source files from any language and link them into your C/C++/Objective-C/Objective-C++ program by using Build Rules. Note that this is different from adding a Run Script Build Phase. This is a Build Rule, not a Build Phase. In Xcode 5: 1) Click on your Project in the Project Navigator 2) Click on the Target in the Project editor 3) Click on the "Build Rules" tab (Note: *Not* "Build Settings" or "Build Phases"). 4) From the "Editor" menu, choose "Add Build Rule" This will create a new build rule in your project. It should look like this: [image: Inline image 1] 5) From the "Process" popup menu (in the new build rule), select "Source Files With Names Matching:" and enter "*.hs" into the text field next to it (leaving out the quotation marks). (Being new to Haskell, I'm unclear on the difference between ".hs" and ".lhs" files. But if ".lhs" files are compiled by ghc, you can do these steps a second time and replace "*.hs" with "*.lhs".) 6) From the "Using" popup menu, choose "Custom Script:" 7) Enter the following for the script: #!/bin/sh ghc -c -odir ${DERIVED_FILE_DIR} ${SCRIPT_INPUT_FILE} The above runs a bourne shell script that simply invokes ghc, tells it to compile the next Haskell source file, and put the .o into Xcode's derived sources folder with all the other .o files that your Xcode project produces. Feel free to add whatever other ghc options you need to compile your files. 8) In the "Output Files" section, click the "+" button. You'll be prompted to enter a filename. Enter this: $(DERIVED_FILE_DIR)/$(INPUT_FILE_BASE).o That says that the output files from the build rule will be in the Derived Files directory, and they will have a name that's the same as the input file, but instead of ending in ".hs" it will end in ".o" as object files should. This is what allows Xcode to understand dependencies in Haskell. (It's not perfect - it won't recognize when you update a module used by Haskell source file, but it's good enough to recognize that you changed the source file which produces a given object file and will rebuild that object file as appropriate.) 9) Add your Haskell source files to your Xcode project. 10) Be sure to call "hs_init()" and "hs_exit()" in your C/C++/Objective-C/Objective-C++ source so that you can safely call and use Haskell code in your project. 11) Add any libraries that are required to link against the Haskell source. In my simple example, I had to link against libiconv.2.dylib, libHSinteger-gmp-0.5.0.0.a, libHSghc-prim-0.3.0.0.a, libHSbase-4.6.0.1.a, and libHSrts.a. You may need a different set of libraries for your project depending on what your Haskell source does. The description at < http://www.haskell.org/haskellwiki/Using_Haskell_in_an_Xcode_Cocoa_project#Add_Haskell_libraries.2C_compile_and_run> has a pretty good description of how to figure out which ones you need. That's it! Let me know if you need any clarification on any parts of this. -DC -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: HaskellInXcode.png Type: image/png Size: 239795 bytes Desc: not available URL: From haskellcafe at gmail.com Wed Nov 6 23:55:45 2013 From: haskellcafe at gmail.com (haskell cafe) Date: Wed, 6 Nov 2013 15:55:45 -0800 Subject: [Haskell-cafe] Better integration with Xcode In-Reply-To: References: Message-ID: On Tue, Nov 5, 2013 at 5:05 PM, haskell cafe wrote: > You can directly edit Haskell in Xcode (with very basic syntax > highlighting) > Here's how I got (basic) syntax highlighting for Haskell in Xcode: I should start by saying that unlike my other post, this is totally unsupported and that this involves modifying Xcode's bundle. While it mainly just involves adding a plist file to the bundle and modifying an existing plist, it is still potentially dangerous and you will likely have to re-do it every time you update Xcode. You have been warned. Also, this only adds syntax coloring for keywords, strings, characters, and numbers. Unfortunately, it doesn't do coloring of variables, types, and other identifiers. Xcode doesn't generally color operators, though you could add the built-in ones to the list of keywords if you want it to also color them. Given all that, if you still want to proceed, here's what you need to do: 1) Copy Haskell.xclangspec (included at the bottom of this email) into /Applications/Xcode/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/. (Assuming you've installed Xcode into /Applications/.) This will require admin privileges on the machine you're running Xcode on. 2) Save the following as "~/Desktop/Haskell.plist" (or wherever is convenient for you) : Xcode.SourceCodeLanguage.Haskell languageSpecification xcode.lang.haskell fileDataType identifier public.haskell-source id Xcode.SourceCodeLanguage.Haskell point Xcode.SourceCodeLanguage languageName Haskell version 1.0 conformsTo identifier Xcode.SourceCodeLanguage.Generic name Haskell Language documentationAbbreviation hs 3) Make a copy of the file: /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/DVTFoundation.xcplugindata and put it somewhere safe in case you mess it up in the next step. 4) Using PlistBuddy, add the above into DVTFoundation.xcplugindata (in the same directory as the stuff in step 1), by doing the following on the command-line (this should all be one line) : /usr/libexec/PlistBuddy /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/DVTFoundation.xcplugindata -c 'Merge ~/Desktop/Haskell.plist plug-in:extensions' You may need to use "sudo" to run the above command. (In other words type "sudo /usr/libexec/PlistBuddy ??") Note that if you saved the above file somewhere other than your desktop, you'll need to change the path in the "Merge" command to match wherever you put it. If you somehow messed it up and need to undo it, you can use the following command to remove what you just added: /usr/libexec/PlistBuddy /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/DVTFoundation.xcplugindata -c 'Delete :plug-in:extensions:Xcode.SourceCodeLanguage.Haskell' Again, you'll probably need to use 'sudo' to run that command, too. 5) Once you've done the above, you'll notice Xcode's "Editor" > "Syntax Coloring" menu now includes "Haskell" as an option. Simply open your Haskell source file and choose "Haskell" from the "Syntax Coloring" submenu! Here is the Haskell.xclangspec. It's probably not perfect. I created it by looking at the C and Fortran .xclangspec files and copying their format. I used the information from the Haskell Language Spec < http://www.haskell.org/haskellwiki/Language_and_library_specification>. If you have suggestions for changes, let me know, or just post them: // Haskell ( /****************************************************************************/ // MARK: Haskell Keywords /****************************************************************************/ { Identifier = "xcode.lang.haskell.keyword"; Syntax = { StartChars = "abcdefghijklmnopqrstuvwxyz"; Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'"; Words = ( "case", "class", "data", "default", "deriving", "do", "else", "foreign", "import", "if", "in", "infix", "infixl", "infixr", "instance", "let", "module", "newtype", "of", "then", "type", "where", "_", ); Type = "xcode.syntax.keyword"; AltType = "xcode.syntax.identifier"; // non-keywords are identifiers }; }, /****************************************************************************/ // MARK: Haskell Coloring /****************************************************************************/ { Identifier = "xcode.lang.haskell"; Description = "Haskell Coloring"; BasedOn = "xcode.lang.simpleColoring"; IncludeInMenu = YES; Name = "Haskell"; Syntax = { IncludeRules = ( // processed in order "xcode.lang.haskell.comment.singleline", "xcode.lang.haskell.comment", "xcode.lang.string", "xcode.lang.character", "xcode.lang.number", "xcode.lang.haskell.keyword", ); Type = "xcode.syntax.plain"; }; }, { Identifier = "xcode.lang.haskell.comment.singleline"; Syntax = { Start = "--"; End = "\n"; IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" ); Type = "xcode.syntax.comment"; }; }, { Identifier = "xcode.lang.haskell.comment"; Syntax = { Start = "{-"; End = "-}"; IncludeRules = ( "xcode.lang.url", "xcode.lang.url.mail", "xcode.lang.comment.mark" ); Type = "xcode.syntax.comment"; }; }, ) -------------- next part -------------- An HTML attachment was scrubbed... URL: From joeyadams3.14159 at gmail.com Thu Nov 7 00:37:44 2013 From: joeyadams3.14159 at gmail.com (Joey Adams) Date: Wed, 6 Nov 2013 19:37:44 -0500 Subject: [Haskell-cafe] a tiny HTTP server.. that doesn't work In-Reply-To: References: Message-ID: On Tue, Nov 5, 2013 at 9:10 PM, Corey O'Connor wrote: > I've updated the code to handle persistent connections. As best I can > figure anyways.. > Unfortunately this does not resolve the issue. The server still reports > the connection being closed before the full response is read. > What OS are you testing on? -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstcruz at gmail.com Thu Nov 7 03:26:51 2013 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Wed, 6 Nov 2013 22:26:51 -0500 Subject: [Haskell-cafe] Haskell Weekly News: Issue 285 Message-ID: Welcome to issue 285 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the weeks of October 20 to November 02, 2013. Quotes of the Week * roconnor: edwardk: is comonad Haskell 1.4? I liked Haskell 1.4. * Peaker: Don't trust the @src, luke * dmwit: If it fits in a tweet, you haven't included enough information to debug it yet. Top Reddit Stories * The Haskell Cast #3 - Simon Peyton Jones on GHC Domain: haskellcast.com, Score: 88, Comments: 11 On Reddit: [1] http://goo.gl/0sGzlg Original: [2] http://goo.gl/wQ4FKi * Elm 0.10 released: faster strings, nice colors, bug fixes, and searchable documentation Domain: elm-lang.org, Score: 74, Comments: 9 On Reddit: [3] http://goo.gl/HJ2fc7 Original: [4] http://goo.gl/xFJJMN * Procrustean Mathematics by Edward Kmett Domain: fpcomplete.com, Score: 71, Comments: 17 On Reddit: [5] http://goo.gl/AsB0CM Original: [6] http://goo.gl/E1iDNM * Haskell hurdle: uninteresting world Domain: gundersen.net, Score: 68, Comments: 58 On Reddit: [7] http://goo.gl/W8l3T1 Original: [8] http://goo.gl/uBVp1f * websockets-0.8 released: with browser shell example + bonus section on pipes vs. conduit vs. io-streams Domain: jaspervdj.be, Score: 65, Comments: 9 On Reddit: [9] http://goo.gl/0XvXZa Original: [10] http://goo.gl/eUDMn1 * IHaskell: Haskell for Interactive Computing Domain: gibiansky.github.io, Score: 61, Comments: 26 On Reddit: [11] http://goo.gl/ZpNpq8 Original: [12] http://goo.gl/A8iccI * ShellCheck ? static analysis and linting tool for sh/bash script Domain: shellcheck.net, Score: 55, Comments: 10 On Reddit: [13] http://goo.gl/z0giaP Original: [14] http://goo.gl/zF3DLB * Micro-tutorial: liftM by accident Domain: self.haskell, Score: 54, Comments: 29 On Reddit: [15] http://goo.gl/d6ReRs Original: [16] http://goo.gl/d6ReRs * Barclays are hiring: Haskell developers in London and Kiev Domain: self.haskell, Score: 52, Comments: 14 On Reddit: [17] http://goo.gl/Fq7JPE Original: [18] http://goo.gl/Fq7JPE * License monads Domain: joeyh.name, Score: 52, Comments: 18 On Reddit: [19] http://goo.gl/oZ9La1 Original: [20] http://goo.gl/9C1Stp * Show Reddit: My weekend project, PureScript Domain: functorial.com, Score: 49, Comments: 61 On Reddit: [21] http://goo.gl/sRx1Eh Original: [22] http://goo.gl/TJBCYN * Deamortized ST by Edward Kmett Domain: fpcomplete.com, Score: 49, Comments: 57 On Reddit: [23] http://goo.gl/Vck3Ij Original: [24] http://goo.gl/wtaueO * HaLVM 2.0 Developer's Release (trans: buggy but API-stable pre-release) now available for folks to try. GHC 7.8, threaded RTS, SMP HaLVM support, 0-copy networking, and more. Domain: community.galois.com, Score: 44, Comments: 13 On Reddit: [25] http://goo.gl/5Psg7B Original: [26] http://goo.gl/xQFUA2 * Could you explain why complexity of monadic IO is worth it? Domain: self.haskell, Score: 43, Comments: 128 On Reddit: [27] http://goo.gl/esFCc4 Original: [28] http://goo.gl/esFCc4 * London Haskell User Group 18/09/2013: Oliver Charles on pipes [video] Domain: ocharles.org.uk, Score: 42, Comments: 14 On Reddit: [29] http://goo.gl/8kDKnw Original: [30] http://goo.gl/hi3L3P * C-- as a project separate from GHC Domain: cminusminus.org, Score: 42, Comments: 14 On Reddit: [31] http://goo.gl/fvUjIk Original: [32] http://goo.gl/VueAA * How to start a new Haskell project Domain: jabberwocky.eu, Score: 42, Comments: 26 On Reddit: [33] http://goo.gl/6dRRXn Original: [34] http://goo.gl/btWJYS * The let-no-escape optimization Domain: lambda.jstolarek.com, Score: 41, Comments: 1 On Reddit: [35] http://goo.gl/l8xhuP Original: [36] http://goo.gl/J8uekI * Improving Applicative do-notation Domain: tmorris.net, Score: 40, Comments: 150 On Reddit: [37] http://goo.gl/MXoPdz Original: [38] http://goo.gl/y1I8Tx * Odersky: The Trouble with Types - Strange Loop 2013 [InfoQ] Domain: infoq.com, Score: 39, Comments: 55 On Reddit: [39] http://goo.gl/5QEJfz Original: [40] http://goo.gl/Ir4kwG Top StackOverflow Questions * Haskell Thrift library 300x slower than C++ in performance test votes: 34, answers: 5 Read on SO: [41] http://goo.gl/timvYf * Creating methods bound to records in Haskell votes: 10, answers: 1 Read on SO: [42] http://goo.gl/4E4Sgh * Installing & Building GHC with OSX Mavericks GHC votes: 10, answers: 1 Read on SO: [43] http://goo.gl/44PIaj * How to properly communicate compile-time information to Template Haskell functions? votes: 10, answers: 0 Read on SO: [44] http://goo.gl/YQkGbl * Data.Text vs String votes: 9, answers: 2 Read on SO: [45] http://goo.gl/ttjnJ1 * Why is matrix multiplication faster with Repa than with hmatrix? votes: 9, answers: 1 Read on SO: [46] http://goo.gl/e36toD * Efficient functional algorithm for computing closure under an operator votes: 8, answers: 1 Read on SO: [47] http://goo.gl/538Yyr * Why doesn't Haskell sequence these IO actions properly? votes: 8, answers: 2 Read on SO: [48] http://goo.gl/82PZYb * Is there a way to make my word counting program faster without using impure tricks? votes: 8, answers: 1 Read on SO: [49] http://goo.gl/F3OiUk * Is it better to define Functor in terms of Applicative in terms of Monad, or vice versa? votes: 8, answers: 3 Read on SO: [50] http://goo.gl/xEkVIf * Standard Haskell function :: (a -> Maybe b) -> [a] -> Maybe b votes: 8, answers: 3 Read on SO: [51] http://goo.gl/JdA5Xf * Why are cabal reinstalls ?always dangerous?? votes: 8, answers: 1 Read on SO: [52] http://goo.gl/kCdUsL * How to use the maybe monoid and combine values with a custom operation, easily? votes: 8, answers: 3 Read on SO: [53] http://goo.gl/BpL8NK Until next time, [54]+Daniel Santa Cruz References 1. http://www.haskellcast.com/episode/003-simon-peyton-jones-on-ghc/ 2. http://www.reddit.com/r/haskell/comments/1pe8tj/the_haskell_cast_3_simon_peyton_jones_on_ghc/ 3. http://elm-lang.org/blog/announce/0.10.elm 4. http://www.reddit.com/r/haskell/comments/1p43xx/elm_010_released_faster_strings_nice_colors_bug/ 5. https://www.fpcomplete.com/user/edwardk/editorial/procrustean-mathematics 6. http://www.reddit.com/r/haskell/comments/1p85al/procrustean_mathematics_by_edward_kmett/ 7. http://www.gundersen.net/functional-programming-hurdle-uninteresting-programs/ 8. http://www.reddit.com/r/haskell/comments/1oyy54/haskell_hurdle_uninteresting_world/ 9. http://jaspervdj.be/posts/2013-10-22-websockets-0.8.html 10. http://www.reddit.com/r/haskell/comments/1p0bey/websockets08_released_with_browser_shell_example/ 11. http://gibiansky.github.io/IHaskell/ 12. http://www.reddit.com/r/haskell/comments/1oxj6k/ihaskell_haskell_for_interactive_computing/ 13. http://www.shellcheck.net/about.html 14. http://www.reddit.com/r/haskell/comments/1pg7ym/shellcheck_static_analysis_and_linting_tool_for/ 15. http://www.reddit.com/r/haskell/comments/1pd1ep/microtutorial_liftm_by_accident/ 16. http://www.reddit.com/r/haskell/comments/1pd1ep/microtutorial_liftm_by_accident/ 17. http://www.reddit.com/r/haskell/comments/1p70l3/barclays_are_hiring_haskell_developers_in_london/ 18. http://www.reddit.com/r/haskell/comments/1p70l3/barclays_are_hiring_haskell_developers_in_london/ 19. http://joeyh.name/blog/entry/license_monads/ 20. http://www.reddit.com/r/haskell/comments/1plql7/license_monads/ 21. http://functorial.com/purescript/ 22. http://www.reddit.com/r/haskell/comments/1pkzd0/show_reddit_my_weekend_project_purescript/ 23. https://www.fpcomplete.com/user/edwardk/oblivious/deamortized-st 24. http://www.reddit.com/r/haskell/comments/1pnrqn/deamortized_st_by_edward_kmett/ 25. http://community.galois.com/pipermail/halvm-devel/2013-October/000041.html 26. http://www.reddit.com/r/haskell/comments/1ot4ep/halvm_20_developers_release_trans_buggy_but/ 27. http://www.reddit.com/r/haskell/comments/1owtvs/could_you_explain_why_complexity_of_monadic_io_is/ 28. http://www.reddit.com/r/haskell/comments/1owtvs/could_you_explain_why_complexity_of_monadic_io_is/ 29. http://ocharles.org.uk/blog/posts/2013-10-23-pipes-talk.html 30. http://www.reddit.com/r/haskell/comments/1p1wrt/london_haskell_user_group_18092013_oliver_charles/ 31. http://www.cminusminus.org/ 32. http://www.reddit.com/r/haskell/comments/1pbbon/c_as_a_project_separate_from_ghc/ 33. http://jabberwocky.eu/2013/10/24/how-to-start-a-new-haskell-project/ 34. http://www.reddit.com/r/haskell/comments/1pdxcr/how_to_start_a_new_haskell_project/ 35. http://lambda.jstolarek.com/2013/10/let-no-escape/ 36. http://www.reddit.com/r/haskell/comments/1pi6fz/the_letnoescape_optimization/ 37. http://tmorris.net/posts/applicative-do/index.html 38. http://www.reddit.com/r/haskell/comments/1ou06l/improving_applicative_donotation/ 39. http://www.infoq.com/presentations/data-types-issues 40. http://www.reddit.com/r/haskell/comments/1pjjy5/odersky_the_trouble_with_types_strange_loop_2013/ 41. http://stackoverflow.com/questions/19512952/haskell-thrift-library-300x-slower-than-c-in-performance-test 42. http://stackoverflow.com/questions/19484232/creating-methods-bound-to-records-in-haskell 43. http://stackoverflow.com/questions/19579577/installing-building-ghc-with-osx-mavericks-ghc 44. http://stackoverflow.com/questions/19679024/how-to-properly-communicate-compile-time-information-to-template-haskell-functio 45. http://stackoverflow.com/questions/19608745/data-text-vs-string 46. http://stackoverflow.com/questions/19733382/why-is-matrix-multiplication-faster-with-repa-than-with-hmatrix 47. http://stackoverflow.com/questions/19485082/efficient-functional-algorithm-for-computing-closure-under-an-operator 48. http://stackoverflow.com/questions/19513660/why-doesnt-haskell-sequence-these-io-actions-properly 49. http://stackoverflow.com/questions/19535688/is-there-a-way-to-make-my-word-counting-program-faster-without-using-impure-tric 50. http://stackoverflow.com/questions/19635265/is-it-better-to-define-functor-in-terms-of-applicative-in-terms-of-monad-or-vic 51. http://stackoverflow.com/questions/19643664/standard-haskell-function-a-maybe-b-a-maybe-b 52. http://stackoverflow.com/questions/19692644/why-are-cabal-reinstalls-always-dangerous 53. http://stackoverflow.com/questions/19706501/how-to-use-the-maybe-monoid-and-combine-values-with-a-custom-operation-easily 54. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From qdunkan at gmail.com Thu Nov 7 06:12:50 2013 From: qdunkan at gmail.com (Evan Laforge) Date: Wed, 6 Nov 2013 22:12:50 -0800 Subject: [Haskell-cafe] float show instances Message-ID: Ok, here's a bit of shameless bike-sheddery, so feel free to move on if you don't have time for that kind of thing. It seems silly, but this is something that's been bothering me for something like 5 years now, namely that ghc's float show instance is very aggressive about resorting to scientific notation for numbers below 1. If you get to 0.01 it writes it as 1.0e-2. Python and ruby, by comparison, have the cutoff at 1e-5. But it's only for <1, if you go higher you have to get all the way up to 1.0e7 before it goes exponential (python and ruby are even more reluctant: 1e16 and 1e14 respectively). This little detail has been a constant low-grade hassle for me because I don't read scientific notation fluently, and it's hard for me to see relative magnitudes in a big chunk of floats. In the past I've resorted to copy pasting a list into a python prompt or a separate pretty printer program, and in the present I have my own replacement for Show that is less aggressive with scientific notation, in addition to other things. So I was wondering, was this a considered design choice, or just the preference of the person who happened to write Show Float and Show Double way back when? Are there people who read scientific notation just as easily as positional (and if so, would they prefer to see 100 as 1e3)? Is there hope that if I look at it enough maybe someday it'll be clear to me too? I'm not actually expecting anyone will say "why didn't we think of that, let's change it right away", but I'm curious about how it came about, and whether other people have resorted to as drastic measures as I have. As an aside, I've noticed that when I'm debugging, the formatting of the output is very important. Surprisingly so. It's worth it for me to spend extra time making test and debugging output minimal and clear, otherwise my brain is already overtaxed trying to understand the problem, and just can't handle extra load like skipping irrelevant data, figuring out scientific notation, and even trying to figure out where the breaks are in un-spaced output. Maybe a personal quirk. From acowley at seas.upenn.edu Thu Nov 7 10:12:59 2013 From: acowley at seas.upenn.edu (Anthony Cowley) Date: Thu, 7 Nov 2013 19:12:59 +0900 Subject: [Haskell-cafe] float show instances In-Reply-To: References: Message-ID: <3A85D194-06D4-4625-983C-EEF1F63F08E2@seas.upenn.edu> > On Nov 7, 2013, at 3:12 PM, Evan Laforge wrote: > > Ok, here's a bit of shameless bike-sheddery, so feel free to move on > if you don't have time for that kind of thing. > > It seems silly, but this is something that's been bothering me for > something like 5 years now, namely that ghc's float show instance is > very aggressive about resorting to scientific notation for numbers > below 1. If you get to 0.01 it writes it as 1.0e-2. Python and ruby, > by comparison, have the cutoff at 1e-5. But it's only for <1, if you > go higher you have to get all the way up to 1.0e7 before it goes > exponential (python and ruby are even more reluctant: 1e16 and 1e14 > respectively). > > This little detail has been a constant low-grade hassle for me because > I don't read scientific notation fluently, and it's hard for me to see > relative magnitudes in a big chunk of floats. In the past I've > resorted to copy pasting a list into a python prompt or a separate > pretty printer program, and in the present I have my own replacement > for Show that is less aggressive with scientific notation, in addition > to other things. > > So I was wondering, was this a considered design choice, or just the > preference of the person who happened to write Show Float and Show > Double way back when? Are there people who read scientific notation > just as easily as positional (and if so, would they prefer to see 100 > as 1e3)? Is there hope that if I look at it enough maybe someday > it'll be clear to me too? > > I'm not actually expecting anyone will say "why didn't we think of > that, let's change it right away", but I'm curious about how it came > about, and whether other people have resorted to as drastic measures > as I have. > > As an aside, I've noticed that when I'm debugging, the formatting of > the output is very important. Surprisingly so. It's worth it for me > to spend extra time making test and debugging output minimal and > clear, otherwise my brain is already overtaxed trying to understand > the problem, and just can't handle extra load like skipping irrelevant > data, figuring out scientific notation, and even trying to figure out > where the breaks are in un-spaced output. Maybe a personal quirk. I, too, am not a fan of those default Show instances for readability reasons. The silver lining is that this causes me to reach for printf sooner rather than later, which lets me format things appropriately at an early stage. Anthony From capn.freako at gmail.com Thu Nov 7 14:55:19 2013 From: capn.freako at gmail.com (David Banas) Date: Thu, 7 Nov 2013 06:55:19 -0800 Subject: [Haskell-cafe] Better integration with Xcode Message-ID: Could the originator of this thread say something, as to what advantages his approach has over Leksah, please? Thanks, -db From carter.schonwald at gmail.com Thu Nov 7 17:32:01 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 7 Nov 2013 12:32:01 -0500 Subject: [Haskell-cafe] Better integration with Xcode In-Reply-To: References: Message-ID: Lek can't support iOS dev as easily. On Thursday, November 7, 2013, David Banas wrote: > Could the originator of this thread say something, as to what advantages > his approach has over Leksah, please? > > Thanks, > -db > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vitea3v at rambler.ru Thu Nov 7 18:16:33 2013 From: vitea3v at rambler.ru (Wvv) Date: Thu, 7 Nov 2013 10:16:33 -0800 (PST) Subject: [Haskell-cafe] idea: ratings (or maybe comments) for packages in hackage In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> <87wqkm0vyy.fsf@wespe.malde.org> Message-ID: <1383848192899-5739539.post@n5.nabble.com> Comments are the good idea. For example, at PHP online documentation we see a lot of comments which help to understand how to use features: http://www.php.net/manual/en/language.types.php http://www.php.net/manual/en/mcrypt.setup.php -- View this message in context: http://haskell.1045720.n5.nabble.com/idea-ratings-or-maybe-comments-for-packages-in-hackage-tp5739378p5739539.html Sent from the Haskell - Haskell-Cafe mailing list archive at Nabble.com. From troplin at bluewin.ch Thu Nov 7 19:18:33 2013 From: troplin at bluewin.ch (=?UTF-8?Q?Tobias=20M=C3=BCller?=) Date: Thu, 7 Nov 2013 19:18:33 +0000 (UTC) Subject: [Haskell-cafe] float show instances References: Message-ID: <1451723773405544495.999975troplin-bluewin.ch@news.gmane.org> Evan Laforge wrote: [...] > (and if so, would they prefer to see 100 as 1e3)? I hope not, because it's wrong. [...] Tobi From qdunkan at gmail.com Thu Nov 7 19:33:01 2013 From: qdunkan at gmail.com (Evan Laforge) Date: Thu, 7 Nov 2013 11:33:01 -0800 Subject: [Haskell-cafe] float show instances In-Reply-To: <3A85D194-06D4-4625-983C-EEF1F63F08E2@seas.upenn.edu> References: <3A85D194-06D4-4625-983C-EEF1F63F08E2@seas.upenn.edu> Message-ID: On Thu, Nov 7, 2013 at 2:12 AM, Anthony Cowley wrote: > I, too, am not a fan of those default Show instances for readability reasons. The silver lining is that this causes me to reach for printf sooner rather than later, which lets me format things appropriately at an early stage. True, that's basically the same approach (i.e. doing my own formatting) I wound up with. Though usually not with printf because the whole type unsafe thing. But I did waste a fair amount of time over a number of years before realizing that custom formatting is almost always worth it, even for one off Debug.traces, and I wound up with my own trace library for the same reason. On Thu, Nov 7, 2013 at 11:18 AM, Tobias M?ller wrote: >> (and if so, would they prefer to see 100 as 1e3)? > > I hope not, because it's wrong. See, I told you I'm no good at this scienterrific physical faddle! I can't even get it right when I'm writing it. From tonymorris at gmail.com Fri Nov 8 01:20:55 2013 From: tonymorris at gmail.com (Tony Morris) Date: Fri, 08 Nov 2013 11:20:55 +1000 Subject: [Haskell-cafe] QuickCheck Message-ID: <527C3C77.90305@gmail.com> Hello, I have implemented a function for QuickCheck: untilJust :: Gen a -> (a -> Maybe b) -> Gen b I based it on the code for suchThat[1] and suchThatMaybe[2]. I am wondering if I have potentially re-implemented an existing function in part or full. In other words, is there an easier way of achieving this function without pulling the generator apart as much as I have in this implementation: http://lpaste.net/95317 [1] suchThat :: Gen a -> (a -> Bool) -> Gen a http://hackage.haskell.org/package/QuickCheck-2.6/docs/src/Test-QuickCheck-Gen.html#suchThat [2] suchThatMaybe :: Gen a -> (a -> Bool) -> Gen (Maybe a) http://hackage.haskell.org/package/QuickCheck-2.6/docs/src/Test-QuickCheck-Gen.html#suchThatMaybe -- Tony Morris http://tmorris.net/ From asm198 at gmail.com Fri Nov 8 02:38:19 2013 From: asm198 at gmail.com (Andrew Myers) Date: Thu, 07 Nov 2013 21:38:19 -0500 Subject: [Haskell-cafe] Help using Groundhog Template Haskell. Message-ID: <527C4E9B.4070602@gmail.com> Hi Cafe, I'm trying to experiment with groundhog because I want something that I can map between arbitrary ADTs and arbitrary Schema. Groundhog looks like exactly what I want but I'm hung up on an error coming from the mkPersist TH function. When I compile the code below with ghc --make groundhog.hs I get this error: groundhog.hs:23:1: Function binding for `Database.Groundhog.Core.entityFieldChain' has no equations When splicing a TH declaration: I'm pretty sure it has something to do with the TransactionType not being made up of primitive types but I'm not sure what to do about it. Can someone familiar with the library point me in the right direction? Thanks, Andrew Myers {-# LANGUAGE TemplateHaskell, QuasiQuotes #-} module Checking.Database.Groundhog where import qualified Database.Groundhog.TH as TH import qualified Data.Text as T import qualified Data.Time as D import qualified Control.Lens as L data TransactionType = Deposit | Debt | Informational deriving (Show, Eq, Read) data Transaction = Transaction { _transactionDate :: D.UTCTime , _transactionAmount :: Double , _transactionDescription :: T.Text , _transactionBalanced :: Bool , _transactionCheckNumber :: Maybe Int , _transactionTransactionType :: TransactionType } deriving (Show, Read, Eq) TH.mkPersist TH.defaultCodegenConfig [TH.groundhog| - entity: Transaction constructors: - name: Transaction fields: - name: _transactionDate dbName: date exprName: DateField - name: _transactionAmount dbName: amount exprName: AmountField - name: _transactionDescription dbName: description exprName: DescriptionField - name: _transactionBalanced dbName: balanced exprName: BalancedField - name: _transactionCheckNumber dbName: check_number exprName: CheckNumberField - name: _transactionTransactionType dbName: transaction_type exprName: TransactionTypeField - entity: TransactionType |] From qdunkan at gmail.com Fri Nov 8 03:01:55 2013 From: qdunkan at gmail.com (Evan Laforge) Date: Thu, 7 Nov 2013 19:01:55 -0800 Subject: [Haskell-cafe] concatMap with state for Data.Vector? Message-ID: This is a Data.Vector question, hopefully here is a good place for those. Or would it be better to ask on stackoverflow? I want to generate a vector from another, where I interpolate between each point. So I need something like concatMap because the vector gets longer, but I need state because I need to remember the previous value (and I need to look at the next value to avoid overrunning, but that can be done with state and 'tails'). Stated imperatively, it would look like this: state = Nothing out = [] for (x, y) in signal: case state of Nothing -> out.append (x, y) Just (x0, y0) -> for (x, y) in interpolate ...: out.append (x, y) state = Just (x, y) The simplest option would be just doing the transformation on a list: `Vector.concat . snd . List.mapAccumL go Nothing . Vector.toList` But unless fusion is more powerful than I imagined, that builds a couple of lists and a bunch of intermediate vectors. I did try to read the core, but it's hard to follow when vector is involved. If they're large, it's probably no worse than a builder, but if they're small, well I'd want a builder to fill up each chunk efficiently... but there's no builder for Data.Vector (I did write one once, maybe I should pull it out and dust it off). unfoldr could also do it, but to emit multiple samples I'd need to make the state `Either ([a], state) state`, and some awkward plumbing, and constant tag checks. So it's looking like converting to a list and back is the most reasonable option... unless there's some way to express this that I'm missing? From nickolay.kudasov at gmail.com Fri Nov 8 08:40:10 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Fri, 8 Nov 2013 12:40:10 +0400 Subject: [Haskell-cafe] QuickCheck In-Reply-To: <527C3C77.90305@gmail.com> References: <527C3C77.90305@gmail.com> Message-ID: Hi Tony, ??Take a look at monad-loops package [1]. Seems like you reinvented a version of untilJust [2]. ?? Your version can be obtained by: yourUntilJust :: (Monad m) => m a -> (a -> Maybe b) -> m byourUntilJust m f = untilJust (liftM f m) Best, Nick [1] http://hackage.haskell.org/package/monad-loops [2] http://hackage.haskell.org/package/monad-loops-0.4.2/docs/Control-Monad-Loops.html#v:untilJust ? 2013/11/8 Tony Morris > Hello, > I have implemented a function for QuickCheck: > > untilJust :: Gen a -> (a -> Maybe b) -> Gen b > > I based it on the code for suchThat[1] and suchThatMaybe[2]. > > I am wondering if I have potentially re-implemented an existing function > in part or full. In other words, is there an easier way of achieving > this function without pulling the generator apart as much as I have in > this implementation: http://lpaste.net/95317 > > [1] > suchThat :: Gen a -> (a -> Bool) -> Gen a > > http://hackage.haskell.org/package/QuickCheck-2.6/docs/src/Test-QuickCheck-Gen.html#suchThat > > [2] > suchThatMaybe :: Gen a -> (a -> Bool) -> Gen (Maybe a) > > http://hackage.haskell.org/package/QuickCheck-2.6/docs/src/Test-QuickCheck-Gen.html#suchThatMaybe > > -- > Tony Morris > http://tmorris.net/ > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ben_moseley at mac.com Fri Nov 8 09:18:45 2013 From: ben_moseley at mac.com (Ben Moseley) Date: Fri, 08 Nov 2013 09:18:45 +0000 Subject: [Haskell-cafe] Job opportunities at Startup - London and Exeter Message-ID: <383DBEED-9A29-4C0E-AB47-0D83F91D928C@mac.com> If you are an experienced developer, have a keen interest in functional programming and would be interested in working at an ambitious, funded, consumer-focused UK startup, please get in touch with me. Our main server-side infra is Haskell-based but we also use Java and Objective-C for the mobile platforms we target. Beyond the obvious technical skills, successful candidates will need focus and determination to get the job done. In return we offer a hugely exciting and challenging working environment, competitive compensation, a great culture (we'll probably try and drag you away from your keyboard and onto a mountain bike) and an experienced management team with a proven track-record. We are looking for developers to be based in London and Exeter. -- Ben Moseley - Programmer ben at benmoseley.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From mail at nh2.me Fri Nov 8 14:00:31 2013 From: mail at nh2.me (=?UTF-8?B?TmlrbGFzIEhhbWLDvGNoZW4=?=) Date: Fri, 08 Nov 2013 14:00:31 +0000 Subject: [Haskell-cafe] float show instances In-Reply-To: References: Message-ID: <527CEE7F.7040906@nh2.me> On 07/11/13 06:12, Evan Laforge wrote: > Ok, here's a bit of shameless bike-sheddery, so feel free to move on > if you don't have time for that kind of thing. > > It seems silly, but this is something that's been bothering me for > something like 5 years now, namely that ghc's float show instance is > very aggressive about resorting to scientific notation Glad that somebody feels the same! From asm198 at gmail.com Fri Nov 8 14:09:25 2013 From: asm198 at gmail.com (Andrew) Date: Fri, 8 Nov 2013 14:09:25 +0000 (UTC) Subject: [Haskell-cafe] Help using Groundhog Template Haskell. References: <527C4E9B.4070602@gmail.com> Message-ID: I seem to have worked around this by hand rolling instances for TransactionType as below. I would still like to understand how to make this work with mkPersist though. instance G.PersistField TransactionType where persistName _ = "TransactionType" toPersistValues = GG.primToPersistValue fromPersistValues = GG.primFromPersistValue dbType _ = G.DbTypePrimitive G.DbString False Nothing Nothing instance G.PrimitivePersistField TransactionType where toPrimitivePersistValue _ a = G.PersistString (show a) fromPrimitivePersistValue _ (G.PersistString s) = read s fromPrimitivePersistValue _ _ = error "Expected PersistString" From corentin.dupont at gmail.com Fri Nov 8 19:44:44 2013 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Fri, 8 Nov 2013 20:44:44 +0100 Subject: [Haskell-cafe] IDE Message-ID: Hi cafe, I would like to know which IDE are you using? I use Leksah, I like the GUI design and constant compilation process. However, the development seems to be slowing down: last version date from early 2012. The installation process is very painful. There is FPComplete IDE coming up, but it's commercial. I'm experimenting with it, anyway: how to compile using cabal files? It doesn't seem to recognize them. Will there be an off-line version? I'm interested to know if you are using vim to develop: which extension are you using? I'm interested in continuous compilation, project files browsing, code completion, search-in-files. Best, Corentin -------------- next part -------------- An HTML attachment was scrubbed... URL: From tt1729 at yahoo.com Fri Nov 8 19:55:46 2013 From: tt1729 at yahoo.com (Tommy Thorn) Date: Fri, 8 Nov 2013 11:55:46 -0800 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: I use both kinds: Emacs + haskell-mode and Emacs For Mac OS X + haskell-mode. :) Tommy On Nov 8, 2013, at 11:44 , Corentin Dupont wrote: > Hi cafe, > I would like to know which IDE are you using? > I use Leksah, I like the GUI design and constant compilation process. > However, the development seems to be slowing down: last version date from early 2012. The installation process is very painful. > > There is FPComplete IDE coming up, but it's commercial. > I'm experimenting with it, anyway: how to compile using cabal files? It doesn't seem to recognize them. Will there be an off-line version? > > I'm interested to know if you are using vim to develop: which extension are you using? I'm interested in continuous compilation, project files browsing, code completion, search-in-files. > > Best, > Corentin > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From miguelimo38 at yandex.ru Fri Nov 8 19:57:26 2013 From: miguelimo38 at yandex.ru (MigMit) Date: Fri, 8 Nov 2013 23:57:26 +0400 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: <92FA7970-54BB-4D0F-8116-3F218426837C@yandex.ru> Emacs. The ability to run ghci in another frame is a killer feature. Sublime is the closest competitor, but implements this feature in an uncomfortable way. On 08 Nov 2013, at 23:44, Corentin Dupont wrote: > Hi cafe, > I would like to know which IDE are you using? > I use Leksah, I like the GUI design and constant compilation process. > However, the development seems to be slowing down: last version date from early 2012. The installation process is very painful. > > There is FPComplete IDE coming up, but it's commercial. > I'm experimenting with it, anyway: how to compile using cabal files? It doesn't seem to recognize them. Will there be an off-line version? > > I'm interested to know if you are using vim to develop: which extension are you using? I'm interested in continuous compilation, project files browsing, code completion, search-in-files. > > Best, > Corentin > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From miroslav.karpis at gmail.com Fri Nov 8 19:57:50 2013 From: miroslav.karpis at gmail.com (Miro Karpis) Date: Fri, 8 Nov 2013 20:57:50 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: Hi, I use sublime with sublime-haskell. m. On Fri, Nov 8, 2013 at 8:55 PM, Tommy Thorn wrote: > I use both kinds: Emacs + haskell-mode and Emacs For Mac OS X + > haskell-mode. > > :) > > Tommy > > On Nov 8, 2013, at 11:44 , Corentin Dupont > wrote: > > > Hi cafe, > > I would like to know which IDE are you using? > > I use Leksah, I like the GUI design and constant compilation process. > > However, the development seems to be slowing down: last version date > from early 2012. The installation process is very painful. > > > > There is FPComplete IDE coming up, but it's commercial. > > I'm experimenting with it, anyway: how to compile using cabal files? It > doesn't seem to recognize them. Will there be an off-line version? > > > > I'm interested to know if you are using vim to develop: which extension > are you using? I'm interested in continuous compilation, project files > browsing, code completion, search-in-files. > > > > Best, > > Corentin > > > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From davidleothomas at gmail.com Fri Nov 8 20:08:21 2013 From: davidleothomas at gmail.com (David Thomas) Date: Fri, 8 Nov 2013 12:08:21 -0800 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: I use vim, though I think if you know neither vim nor emacs, emacs might be a better choice for Haskell. On Fri, Nov 8, 2013 at 11:57 AM, Miro Karpis wrote: > Hi, I use sublime with sublime-haskell. > > m. > > > On Fri, Nov 8, 2013 at 8:55 PM, Tommy Thorn wrote: > >> I use both kinds: Emacs + haskell-mode and Emacs For Mac OS X + >> haskell-mode. >> >> :) >> >> Tommy >> >> On Nov 8, 2013, at 11:44 , Corentin Dupont >> wrote: >> >> > Hi cafe, >> > I would like to know which IDE are you using? >> > I use Leksah, I like the GUI design and constant compilation process. >> > However, the development seems to be slowing down: last version date >> from early 2012. The installation process is very painful. >> > >> > There is FPComplete IDE coming up, but it's commercial. >> > I'm experimenting with it, anyway: how to compile using cabal files? It >> doesn't seem to recognize them. Will there be an off-line version? >> > >> > I'm interested to know if you are using vim to develop: which extension >> are you using? I'm interested in continuous compilation, project files >> browsing, code completion, search-in-files. >> > >> > Best, >> > Corentin >> > >> > >> > _______________________________________________ >> > Haskell-Cafe mailing list >> > Haskell-Cafe at haskell.org >> > http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.dupont at gmail.com Fri Nov 8 20:14:35 2013 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Fri, 8 Nov 2013 21:14:35 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: I'm a vimer :) although I use it a lot to do small editing on random files, I've never used it as a dev environment. On Fri, Nov 8, 2013 at 9:08 PM, David Thomas wrote: > I use vim, though I think if you know neither vim nor emacs, emacs might > be a better choice for Haskell. > > > On Fri, Nov 8, 2013 at 11:57 AM, Miro Karpis wrote: > >> Hi, I use sublime with sublime-haskell. >> >> m. >> >> >> On Fri, Nov 8, 2013 at 8:55 PM, Tommy Thorn wrote: >> >>> I use both kinds: Emacs + haskell-mode and Emacs For Mac OS X + >>> haskell-mode. >>> >>> :) >>> >>> Tommy >>> >>> On Nov 8, 2013, at 11:44 , Corentin Dupont >>> wrote: >>> >>> > Hi cafe, >>> > I would like to know which IDE are you using? >>> > I use Leksah, I like the GUI design and constant compilation process. >>> > However, the development seems to be slowing down: last version date >>> from early 2012. The installation process is very painful. >>> > >>> > There is FPComplete IDE coming up, but it's commercial. >>> > I'm experimenting with it, anyway: how to compile using cabal files? >>> It doesn't seem to recognize them. Will there be an off-line version? >>> > >>> > I'm interested to know if you are using vim to develop: which >>> extension are you using? I'm interested in continuous compilation, project >>> files browsing, code completion, search-in-files. >>> > >>> > Best, >>> > Corentin >>> > >>> > >>> > _______________________________________________ >>> > Haskell-Cafe mailing list >>> > Haskell-Cafe at haskell.org >>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From asuk1979 at gmail.com Fri Nov 8 21:01:26 2013 From: asuk1979 at gmail.com (=?KOI8-R?B?4czFy9PBzsTSIPPVyMHSxdc=?=) Date: Sat, 9 Nov 2013 01:01:26 +0400 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: I?m too, but I use it alot. And here are some pretty useful vim plugins set nocompatible filetype off set rtp+=~/.vim/bundle/vundle/ call vundle#rc() Bundle 'gmarik/vundle' Bundle 'bling/vim-airline' Bundle 'Shougo/unite.vim' Bundle 'kien/ctrlp.vim' Bundle 'scrooloose/nerdtree' Bundle 'majutsushi/tagbar' Bundle 'tpope/vim-sensible' Bundle 'tpope/vim-unimpaired' " { Edit Bundle 'terryma/vim-multiple-cursors' Bundle 'scrooloose/syntastic' Bundle 'sjl/gundo.vim' Bundle 'scrooloose/nerdcommenter' Bundle 'godlygeek/tabular' Bundle 'Raimondi/delimitMate' " } " { Git Bundle 'airblade/vim-gitgutter' Bundle 'tpope/vim-fugitive' " } " reStructuredText Bundle 'Rykka/riv.vim' " Markdown Bundle 'plasticboy/vim-markdown' " Bundle 'Valloric/YouCompleteMe? " Bundle 'Shougo/vimproc.vim' " { Haskell " Bundle 'urso/haskell_syntax.vim' " Bundle 'eagletmt/ghcmod-vim' Bundle 'Twinside/vim-haskellConceal' Bundle 'vim-scripts/haskell.vim' Bundle 'Twinside/vim-haskellFold' Bundle 'bitc/lushtags' Bundle 'vim-scripts/Darcs' " } " { Dash Bundle 'rizzatti/funcoo.vim' Bundle 'rizzatti/dash.vim' " } filetype plugin indent on ... 2013/11/9 Corentin Dupont > I'm a vimer :) > although I use it a lot to do small editing on random files, I've never > used it as a dev environment. > > > > On Fri, Nov 8, 2013 at 9:08 PM, David Thomas wrote: > >> I use vim, though I think if you know neither vim nor emacs, emacs might >> be a better choice for Haskell. >> >> >> On Fri, Nov 8, 2013 at 11:57 AM, Miro Karpis wrote: >> >>> Hi, I use sublime with sublime-haskell. >>> >>> m. >>> >>> >>> On Fri, Nov 8, 2013 at 8:55 PM, Tommy Thorn wrote: >>> >>>> I use both kinds: Emacs + haskell-mode and Emacs For Mac OS X + >>>> haskell-mode. >>>> >>>> :) >>>> >>>> Tommy >>>> >>>> On Nov 8, 2013, at 11:44 , Corentin Dupont >>>> wrote: >>>> >>>> > Hi cafe, >>>> > I would like to know which IDE are you using? >>>> > I use Leksah, I like the GUI design and constant compilation process. >>>> > However, the development seems to be slowing down: last version date >>>> from early 2012. The installation process is very painful. >>>> > >>>> > There is FPComplete IDE coming up, but it's commercial. >>>> > I'm experimenting with it, anyway: how to compile using cabal files? >>>> It doesn't seem to recognize them. Will there be an off-line version? >>>> > >>>> > I'm interested to know if you are using vim to develop: which >>>> extension are you using? I'm interested in continuous compilation, project >>>> files browsing, code completion, search-in-files. >>>> > >>>> > Best, >>>> > Corentin >>>> > >>>> > >>>> > _______________________________________________ >>>> > Haskell-Cafe mailing list >>>> > Haskell-Cafe at haskell.org >>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpmoresmau at gmail.com Fri Nov 8 21:17:35 2013 From: jpmoresmau at gmail.com (JP Moresmau) Date: Fri, 8 Nov 2013 22:17:35 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: Well, as the maintainer I suppose I should mention EclipseFP. It doesn't have partial compilation but can rebuild your project when you save a file, so you see the impact of your changes. It uses Cabal settings and has a Cabal editor. It provides code completion, and you can search and rename across files and projects within your workspace. I dont't have a huge amount of time at the moment to develop new big things, but I try to fix bugs as they're reported and release a version every three months or so. I use it of course for all my Haskell developments. Of course you need to have a JRE and download/install Eclipse, and I know Eclipse is not everybody's cup of tea. JP On Fri, Nov 8, 2013 at 10:01 PM, ????????? ??????? wrote: > I?m too, but I use it alot. And here are some pretty useful vim plugins > > set nocompatible > filetype off > > set rtp+=~/.vim/bundle/vundle/ > call vundle#rc() > > Bundle 'gmarik/vundle' > > Bundle 'bling/vim-airline' > Bundle 'Shougo/unite.vim' > Bundle 'kien/ctrlp.vim' > Bundle 'scrooloose/nerdtree' > Bundle 'majutsushi/tagbar' > Bundle 'tpope/vim-sensible' > Bundle 'tpope/vim-unimpaired' > > " { Edit > Bundle 'terryma/vim-multiple-cursors' > Bundle 'scrooloose/syntastic' > Bundle 'sjl/gundo.vim' > Bundle 'scrooloose/nerdcommenter' > Bundle 'godlygeek/tabular' > Bundle 'Raimondi/delimitMate' > " } > > " { Git > Bundle 'airblade/vim-gitgutter' > Bundle 'tpope/vim-fugitive' > " } > > " reStructuredText > Bundle 'Rykka/riv.vim' > " Markdown > Bundle 'plasticboy/vim-markdown' > > " Bundle 'Valloric/YouCompleteMe? > " Bundle 'Shougo/vimproc.vim' > > " { Haskell > " Bundle 'urso/haskell_syntax.vim' > " Bundle 'eagletmt/ghcmod-vim' > Bundle 'Twinside/vim-haskellConceal' > Bundle 'vim-scripts/haskell.vim' > Bundle 'Twinside/vim-haskellFold' > Bundle 'bitc/lushtags' > Bundle 'vim-scripts/Darcs' > " } > > " { Dash > Bundle 'rizzatti/funcoo.vim' > Bundle 'rizzatti/dash.vim' > " } > > filetype plugin indent on > > ... > > > 2013/11/9 Corentin Dupont > >> I'm a vimer :) >> although I use it a lot to do small editing on random files, I've never >> used it as a dev environment. >> >> >> >> On Fri, Nov 8, 2013 at 9:08 PM, David Thomas wrote: >> >>> I use vim, though I think if you know neither vim nor emacs, emacs might >>> be a better choice for Haskell. >>> >>> >>> On Fri, Nov 8, 2013 at 11:57 AM, Miro Karpis wrote: >>> >>>> Hi, I use sublime with sublime-haskell. >>>> >>>> m. >>>> >>>> >>>> On Fri, Nov 8, 2013 at 8:55 PM, Tommy Thorn wrote: >>>> >>>>> I use both kinds: Emacs + haskell-mode and Emacs For Mac OS X + >>>>> haskell-mode. >>>>> >>>>> :) >>>>> >>>>> Tommy >>>>> >>>>> On Nov 8, 2013, at 11:44 , Corentin Dupont >>>>> wrote: >>>>> >>>>> > Hi cafe, >>>>> > I would like to know which IDE are you using? >>>>> > I use Leksah, I like the GUI design and constant compilation process. >>>>> > However, the development seems to be slowing down: last version date >>>>> from early 2012. The installation process is very painful. >>>>> > >>>>> > There is FPComplete IDE coming up, but it's commercial. >>>>> > I'm experimenting with it, anyway: how to compile using cabal files? >>>>> It doesn't seem to recognize them. Will there be an off-line version? >>>>> > >>>>> > I'm interested to know if you are using vim to develop: which >>>>> extension are you using? I'm interested in continuous compilation, project >>>>> files browsing, code completion, search-in-files. >>>>> > >>>>> > Best, >>>>> > Corentin >>>>> > >>>>> > >>>>> > _______________________________________________ >>>>> > Haskell-Cafe mailing list >>>>> > Haskell-Cafe at haskell.org >>>>> > http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>>> _______________________________________________ >>>>> Haskell-Cafe mailing list >>>>> Haskell-Cafe at haskell.org >>>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>>> >>>> >>>> >>>> _______________________________________________ >>>> Haskell-Cafe mailing list >>>> Haskell-Cafe at haskell.org >>>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>>> >>>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- JP Moresmau http://jpmoresmau.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From coreyoconnor at gmail.com Fri Nov 8 22:28:23 2013 From: coreyoconnor at gmail.com (Corey O'Connor) Date: Fri, 8 Nov 2013 14:28:23 -0800 Subject: [Haskell-cafe] a tiny HTTP server.. that doesn't work In-Reply-To: References: Message-ID: This is on Mac OS 10.8 and 10.7. I'll be testing NixOS (Linux) this weekend. Was having troubles getting jmeter running... Cheers, Corey -Corey O'Connor coreyoconnor at gmail.com http://corebotllc.com/ On Wed, Nov 6, 2013 at 4:37 PM, Joey Adams wrote: > On Tue, Nov 5, 2013 at 9:10 PM, Corey O'Connor wrote: > >> I've updated the code to handle persistent connections. As best I can >> figure anyways.. >> Unfortunately this does not resolve the issue. The server still reports >> the connection being closed before the full response is read. >> > > What OS are you testing on? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marco-oweber at gmx.de Fri Nov 8 22:34:57 2013 From: marco-oweber at gmx.de (Marc Weber) Date: Fri, 08 Nov 2013 23:34:57 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: <1383949869-sup-2718@nixos> github.com/MarcWeber/vim-addon-haskell: Provides simple compile in background quickfix implementation with auto reconfiguring of your cabal project. It also supports multiple cabal configurations vim-addon-async is an alternative async implementation for Vim based on client-server which could be used to implement accessing ghci in some ways. It already implements python/ruby REPL with Vim completion. Would be some work, though. Vim occasionally crashes, too. Note: vim-addon-manager is a close competitor to vundle, see http://vim-wiki.mawercer.de/wiki/topic/vim%20plugin%20managment.html Note2: On Mailinglists you should always bottom quote which also means - delete text you don't reply to ! Even Windows users can do so comfortably using Shift-Ctrl-END Del. I don't know about current state of scion. In the past for older ghc's there was an implementation for Vim, too. Marc Weber From wren at freegeek.org Sat Nov 9 03:31:49 2013 From: wren at freegeek.org (wren at freegeek.org) Date: Fri, 08 Nov 2013 22:31:49 -0500 Subject: [Haskell-cafe] float show instances In-Reply-To: <527CEE7F.7040906@nh2.me> References: <527CEE7F.7040906@nh2.me> Message-ID: <6711ad8c4b15ddce1fc1ad7a8dc61c20@freegeek.org> On 11/8/13 9:00 AM, Niklas Hamb?chen wrote: > On 07/11/13 06:12, Evan Laforge wrote: >> Ok, here's a bit of shameless bike-sheddery, so feel free to move on >> if you don't have time for that kind of thing. >> >> It seems silly, but this is something that's been bothering me for >> something like 5 years now, namely that ghc's float show instance is >> very aggressive about resorting to scientific notation > > Glad that somebody feels the same! I also feel the same. I don't mind scientific notation generally, but the current versions are very aggressive about it. -- Live well, ~wren From efsubenovex at gmail.com Sat Nov 9 19:59:35 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sat, 9 Nov 2013 11:59:35 -0800 Subject: [Haskell-cafe] IDE Message-ID: I use vim for all dev work except iOS. Specifically I use MacVim on OS X and GVim on Linux. Once I switched to vim I never looked back. Here are some plugins that I use: http://github.com/gmarik/vundle -- Package manager http://github.com/Shougo/vimproc -- Required for ghcmod-vim http://github.com/Shougo/neocomplcache -- Completion http://github.com/Shougo/neosnippet -- Snippets http://github.com/schell/vim-snippets -- Snippets http://github.com/scrooloose/syntastic -- Syntax checking http://github.com/scrooloose/nerdtree -- File drawer http://github.com/altercation/vim-colors-solarized -- Color theme http://github.com/ujihisa/neco-ghc -- Haskell completion for neocomplcache http://github.com/tpope/vim-fugitive.git-- Git integration http://github.com/kien/ctrlp.vim -- Sublime text's anything command (quick goto) http://github.com/Lokaltog/vim-powerline-- Status line http://github.com/majutsushi/tagbar -- Symbol goto based on ctags http://github.com/kana/vim-fakeclip -- OS X clipboard support http://github.com/flazz/vim-colorschemes-- More colorschemes http://github.com/eagletmt/ghcmod-vim -- Syntax/compilation checking, quickfix integration http://github.com/travitch/hasksyn -- Better haskell syntax coloring http://github.com/dag/vim2hs -- More haskell syntax coloring I have a lot of Haskell syntax plugins and some of those may be conflicting, IDK, but it works well IMO. Using all that I get a pretty good IDE feeling when developing in Haskell. I also use a tool called steeloverseer that I wrote to continuously compile my cabal projects. If you're interested it's on hackage and you can read the readme at https://github.com/schell/steeloverseer/. I hope that helps! -------------- next part -------------- An HTML attachment was scrubbed... URL: From vagif.verdi at gmail.com Sat Nov 9 21:34:25 2013 From: vagif.verdi at gmail.com (Vagif Verdi) Date: Sat, 9 Nov 2013 13:34:25 -0800 (PST) Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> Emacs + haskell-mode gives you: - cabal project loading, support sandboxing. - autocomplete (using generated TAGS file with hasktags) - code navigation. You click on a function and it jumps to its definition. - navigation of top level functions (imenu) - type info - error and warning jumps - import management - ghci - hoogle and hayoo help integration - hlint integration You can do continuous compilation using emacs fly-mode. On Friday, November 8, 2013 11:44:44 AM UTC-8, Corentin Dupont wrote: > > Hi cafe, > I would like to know which IDE are you using? > I use Leksah, I like the GUI design and constant compilation process. > However, the development seems to be slowing down: last version date from > early 2012. The installation process is very painful. > > There is FPComplete IDE coming up, but it's commercial. > I'm experimenting with it, anyway: how to compile using cabal files? It > doesn't seem to recognize them. Will there be an off-line version? > > I'm interested to know if you are using vim to develop: which extension > are you using? I'm interested in continuous compilation, project files > browsing, code completion, search-in-files. > > Best, > Corentin > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From baliulia at gmail.com Sat Nov 9 23:46:59 2013 From: baliulia at gmail.com (=?UTF-8?B?SWduYXMgVnnFoW5pYXVza2Fz?=) Date: Sun, 10 Nov 2013 00:46:59 +0100 Subject: [Haskell-cafe] Expressing "self-composable" functions at the type level Message-ID: <527EC973.5070409@gmail.com> Hi, I'm wondering if there's some way to express that a function can be composed with itself at the type level. Due to polymorphism this is not quite the same as saying that the domain and co-domain match. Example: swap :: (a, b) -> (b, a) swap . swap :: (a, b) -> (a, b) I'd like to write a function such as (in pseudocode): involute :: ((a -> b) &&& (b -> a)) -> (a -> a) involute f = f . f But I obviously can't write down the type for (a -> b) &&& (b -> a) Perhaps this can be done with some typeclass hackery? -- Ignas From alex at lagoa.com Sun Nov 10 00:14:57 2013 From: alex at lagoa.com (Alexander Vieth) Date: Sat, 9 Nov 2013 19:14:57 -0500 Subject: [Haskell-cafe] Expressing "self-composable" functions at the type level In-Reply-To: <527EC973.5070409@gmail.com> References: <527EC973.5070409@gmail.com> Message-ID: <2CEC6736-DCC9-44DA-8936-F28FDED5F6C7@lagoa.com> > Due to polymorphism this is not > quite the same as saying that the domain and co-domain match. I believe it's the same as saying that the type of the co-domain can be refined to the type of the domain. Self-composability is already expressed at the type level, although it may not be immediately clear. In the case of swap, it might seem like it's not possible because (b, a) can be refined to (a, b) only if a = b, but when we compose swap with itself we get fresh names for the type variables, and (b, a) can indeed be refined to (a1, b1). Trying to type (swap . swap) we find that the first swap has type (a, b) -> (b, a) and the second swap has type (a1, b1) -> (b1, a1) so if we set b = a1 and a = b1 then we recover the type (b1, a1) -> (b1, a1). Alex On 2013-11-09, at 6:46 PM, Ignas Vy?niauskas wrote: > Hi, > > I'm wondering if there's some way to express that a function can be > composed with itself at the type level. Due to polymorphism this is not > quite the same as saying that the domain and co-domain match. > > Example: > > swap :: (a, b) -> (b, a) > swap . swap :: (a, b) -> (a, b) > > I'd like to write a function such as (in pseudocode): > > involute :: ((a -> b) &&& (b -> a)) -> (a -> a) > involute f = f . f > > But I obviously can't write down the type for (a -> b) &&& (b -> a) > > Perhaps this can be done with some typeclass hackery? > > -- > Ignas > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From baliulia at gmail.com Sun Nov 10 00:53:26 2013 From: baliulia at gmail.com (=?UTF-8?B?SWduYXMgVnnFoW5pYXVza2Fz?=) Date: Sun, 10 Nov 2013 01:53:26 +0100 Subject: [Haskell-cafe] Expressing "self-composable" functions at the type level In-Reply-To: <2CEC6736-DCC9-44DA-8936-F28FDED5F6C7@lagoa.com> References: <527EC973.5070409@gmail.com> <2CEC6736-DCC9-44DA-8936-F28FDED5F6C7@lagoa.com> Message-ID: <527ED906.1020106@gmail.com> On 11/10/2013 01:14 AM, Alexander Vieth wrote: >> Due to polymorphism this is not quite the same as saying that the >> domain and co-domain match. > > I believe it's the same as saying that the type of the co-domain can > be refined to the type of the domain. Self-composability is already > expressed at the type level, although it may not be immediately > clear. > > In the case of swap, it might seem like it's not possible because (b, > a) can be refined to (a, b) only if a = b, but when we compose swap > with itself we get fresh names for the type variables, and (b, a) can > indeed be refined to (a1, b1). Trying to type (swap . swap) we find > that the first swap has type (a, b) -> (b, a) and the second swap has > type (a1, b1) -> (b1, a1) so if we set b = a1 and a = b1 then we > recover the type (b1, a1) -> (b1, a1). Hmm, you are right, I didn't quite think through the case of swap. Thanks! Another case would be to consider a function like: double :: a -> (a, a) double x = \x -> (x, x) then (double . double) is possible, but (I think) it's impossible to write a function for such compositions in general: e.g. Prelude> let involute = \f -> f . f Prelude> :t involute (\x -> (x, x)) :1:18: Occurs check: cannot construct the infinite type: t0 = (t0, t1) I guess this is simply not type-able in System F? -- Ignas From dan.doel at gmail.com Sun Nov 10 02:18:41 2013 From: dan.doel at gmail.com (Dan Doel) Date: Sat, 9 Nov 2013 21:18:41 -0500 Subject: [Haskell-cafe] Expressing "self-composable" functions at the type level In-Reply-To: <527ED906.1020106@gmail.com> References: <527EC973.5070409@gmail.com> <2CEC6736-DCC9-44DA-8936-F28FDED5F6C7@lagoa.com> <527ED906.1020106@gmail.com> Message-ID: On Sat, Nov 9, 2013 at 7:53 PM, Ignas Vy?niauskas wrote: > I guess this is simply not type-able in System F? There are System F types that can accomplish some cases of this; just not Hindley-Milner types. For instance: twicePair :: (forall a. a -> (a, a)) -> (forall a. a -> ((a,a),(a,a))) twicePair f = f . f That is, of course, very specific to your example. Doing significantly better is harder, and I don't think you'll ever get to the real type you want, which is: twice : ((a -> b) ? (b -> c)) -> a -> c I.E. look up interstection types if you're into this stuff. They tend to be less popular than quantifier-based polymorphism, though. From simon.bergot at gmail.com Sun Nov 10 06:32:45 2013 From: simon.bergot at gmail.com (Simon bergot) Date: Sun, 10 Nov 2013 07:32:45 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> References: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> Message-ID: I am usually an emacs+evil windows user, but the first time I tried to set things up for haskell, I failed. I still use emacs for small scripts I use eclipseFP for other projects for the following reasons: - it was easy to set-up - it has a lot features out of the box - I can use Vrapper to get vim keybindings - autocomplete - HLint support - stylish haskell integration - unit tests support with HTF - cabal file edition I never used eclipse before, but I did not find it too painful. The trade-off with emacs configuration difficulty was more than enough for me. Thank you JP Moresmau! On 9 November 2013 22:34, Vagif Verdi wrote: > Emacs + haskell-mode gives you: > > - cabal project loading, support sandboxing. > - autocomplete (using generated TAGS file with hasktags) > - code navigation. You click on a function and it jumps to its definition. > - navigation of top level functions (imenu) > - type info > - error and warning jumps > - import management > - ghci > - hoogle and hayoo help integration > - hlint integration > > You can do continuous compilation using emacs fly-mode. > > > On Friday, November 8, 2013 11:44:44 AM UTC-8, Corentin Dupont wrote: >> >> Hi cafe, >> I would like to know which IDE are you using? >> I use Leksah, I like the GUI design and constant compilation process. >> However, the development seems to be slowing down: last version date from >> early 2012. The installation process is very painful. >> >> There is FPComplete IDE coming up, but it's commercial. >> I'm experimenting with it, anyway: how to compile using cabal files? It >> doesn't seem to recognize them. Will there be an off-line version? >> >> I'm interested to know if you are using vim to develop: which extension >> are you using? I'm interested in continuous compilation, project files >> browsing, code completion, search-in-files. >> >> Best, >> Corentin >> >> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Simon -------------- next part -------------- An HTML attachment was scrubbed... URL: From tsgmoore at gmail.com Sun Nov 10 12:14:17 2013 From: tsgmoore at gmail.com (Theo Moore) Date: Sun, 10 Nov 2013 12:14:17 +0000 Subject: [Haskell-cafe] Installing pandoc without root Message-ID: I am trying to install the Haskell libraries for pandoc on a local home folder and without root access, using the command: cabal install pandoc However, I run into the error: cabal: Missing dependency on a foreign library: * Missing (or bad) header file: zlib.h * Missing C library: z >From what I understand, I need to install zlib1g-dev. GHC and cabal install are available, but without root access I'm having trouble figuring out how to provide the necessary zlib files. I've tried to download the source of zlib1g-dev, but in order to compile it, I have to use "make" which I do not have the priviledge to invoke. Can someone guide me through getting pandoc up and running without root access? The system is Debian 3.2.41-2 x86_64 GNU/Linux. From ivan.miljenovic at gmail.com Sun Nov 10 12:34:53 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Sun, 10 Nov 2013 23:34:53 +1100 Subject: [Haskell-cafe] Installing pandoc without root In-Reply-To: References: Message-ID: On 10 November 2013 23:14, Theo Moore wrote: > I am trying to install the Haskell libraries for pandoc on a local > home folder and without root access, using the command: > > cabal install pandoc > > However, I run into the error: > cabal: Missing dependency on a foreign library: > * Missing (or bad) header file: zlib.h > * Missing C library: z > > From what I understand, I need to install zlib1g-dev. GHC and cabal > install are available, but without root access I'm having trouble > figuring out how to provide the necessary zlib files. I've tried to > download the source of zlib1g-dev, but in order to compile it, I have > to use "make" which I do not have the priviledge to invoke. > > Can someone guide me through getting pandoc up and running without > root access? The system is Debian 3.2.41-2 x86_64 GNU/Linux. You should be able to configure, build and install the zlib library+headers into your own $HOME directory. One guide (that on a quick skim looks OK) is http://blog.sanctum.geek.nz/compiling-in-home/ (Whether it's possible to install just the header files of zlib is something I can't say.) > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From mail at joachim-breitner.de Sun Nov 10 12:36:04 2013 From: mail at joachim-breitner.de (Joachim Breitner) Date: Sun, 10 Nov 2013 13:36:04 +0100 Subject: [Haskell-cafe] Installing pandoc without root In-Reply-To: References: Message-ID: <1384086964.2175.16.camel@kirk> Hi, Am Sonntag, den 10.11.2013, 12:14 +0000 schrieb Theo Moore: > From what I understand, I need to install zlib1g-dev. installing stuff as non-root is a general problem, and not particularly related to Haskell (in fact, the problem is rather solved for Haskell). I?ve heard good things about using NixOS to install your own stuff as a user, and in your own home directory: http://nixos.org/ Greetings, Joachim -- Joachim ?nomeata? Breitner mail at joachim-breitner.de ? http://www.joachim-breitner.de/ Jabber: nomeata at joachim-breitner.de ? GPG-Key: 0x4743206C Debian Developer: nomeata at debian.org -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 198 bytes Desc: This is a digitally signed message part URL: From ivan.miljenovic at gmail.com Sun Nov 10 13:00:54 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Mon, 11 Nov 2013 00:00:54 +1100 Subject: [Haskell-cafe] Installing pandoc without root In-Reply-To: <1384086964.2175.16.camel@kirk> References: <1384086964.2175.16.camel@kirk> Message-ID: On 10 November 2013 23:36, Joachim Breitner wrote: > Hi, > > Am Sonntag, den 10.11.2013, 12:14 +0000 schrieb Theo Moore: >> From what I understand, I need to install zlib1g-dev. > > installing stuff as non-root is a general problem, and not particularly > related to Haskell (in fact, the problem is rather solved for Haskell). > > I?ve heard good things about using NixOS to install your own stuff as a > user, and in your own home directory: > http://nixos.org/ Except I think you just use the nix package manager rather than the full-blown NixOS for that ;-) An alternative for that is gentoo-prefix: http://www.gentoo.org/proj/en/gentoo-alt/prefix/ Or, if you just have a few C libraries you want to install as a user, then GNU Stow can help managing them: http://www.gnu.org/software/stow/ (Any which way you go, of course, you'll probably need to start with installing the tools you need for it ;-) > > Greetings, > Joachim > > -- > Joachim ?nomeata? Breitner > mail at joachim-breitner.de ? http://www.joachim-breitner.de/ > Jabber: nomeata at joachim-breitner.de ? GPG-Key: 0x4743206C > Debian Developer: nomeata at debian.org > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From simon at banquise.net Sun Nov 10 13:14:26 2013 From: simon at banquise.net (Simon Marechal) Date: Sun, 10 Nov 2013 14:14:26 +0100 Subject: [Haskell-cafe] Installing pandoc without root In-Reply-To: References: Message-ID: <527F86B2.6070407@banquise.net> On 11/10/2013 01:14 PM, Theo Moore wrote: > Can someone guide me through getting pandoc up and running without > root access? The system is Debian 3.2.41-2 x86_64 GNU/Linux. A possible solution is to download the zlib1g-dev package, and unpack it somewhere, using the dpkg command. Then you can alter cabal configuration so that it looks for headers at the given place. You should not need the headers once the package is compiled, so you can safely remove them. From tsgmoore at gmail.com Sun Nov 10 13:46:39 2013 From: tsgmoore at gmail.com (Theo Moore) Date: Sun, 10 Nov 2013 13:46:39 +0000 Subject: [Haskell-cafe] Installing pandoc without root In-Reply-To: References: Message-ID: Ivan, Thank you for that helpful link. Unfortunately, it does not look like I have access to make. Is there a workaround? On Sun, Nov 10, 2013 at 12:34 PM, Ivan Lazar Miljenovic wrote: > On 10 November 2013 23:14, Theo Moore wrote: >> I am trying to install the Haskell libraries for pandoc on a local >> home folder and without root access, using the command: >> >> cabal install pandoc >> >> However, I run into the error: >> cabal: Missing dependency on a foreign library: >> * Missing (or bad) header file: zlib.h >> * Missing C library: z >> >> From what I understand, I need to install zlib1g-dev. GHC and cabal >> install are available, but without root access I'm having trouble >> figuring out how to provide the necessary zlib files. I've tried to >> download the source of zlib1g-dev, but in order to compile it, I have >> to use "make" which I do not have the priviledge to invoke. >> >> Can someone guide me through getting pandoc up and running without >> root access? The system is Debian 3.2.41-2 x86_64 GNU/Linux. > > You should be able to configure, build and install the zlib > library+headers into your own $HOME directory. One guide (that on a > quick skim looks OK) is http://blog.sanctum.geek.nz/compiling-in-home/ > > (Whether it's possible to install just the header files of zlib is > something I can't say.) > >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > -- > Ivan Lazar Miljenovic > Ivan.Miljenovic at gmail.com > http://IvanMiljenovic.wordpress.com From baliulia at gmail.com Sun Nov 10 15:35:38 2013 From: baliulia at gmail.com (=?UTF-8?B?SWduYXMgVnnFoW5pYXVza2Fz?=) Date: Sun, 10 Nov 2013 16:35:38 +0100 Subject: [Haskell-cafe] Expressing "self-composable" functions at the type level In-Reply-To: References: <527EC973.5070409@gmail.com> <2CEC6736-DCC9-44DA-8936-F28FDED5F6C7@lagoa.com> <527ED906.1020106@gmail.com> Message-ID: <527FA7CA.2010907@gmail.com> Hi, On 11/10/2013 03:18 AM, Dan Doel wrote: > Doing significantly better is harder, and I don't think you'll ever > get to the real type you want, which is: > > twice : ((a -> b) ? (b -> c)) -> a -> c > > I.E. look up interstection types if you're into this stuff. They > tend to be less popular than quantifier-based polymorphism, though. I think the problem is that having intersection types implies subtyping, and subtyping is obviously troublesome. Essentially the same problem [as mine] is discussed in an old thread, where a partial ("value-level") solution is proposed via typeclass hackery: http://www.haskell.org/pipermail/haskell-cafe/2006-January/013868.html -- Ignas From ivan.miljenovic at gmail.com Sun Nov 10 22:41:25 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Mon, 11 Nov 2013 09:41:25 +1100 Subject: [Haskell-cafe] Installing pandoc without root In-Reply-To: References: Message-ID: On 11 November 2013 00:46, Theo Moore wrote: > Ivan, > > Thank you for that helpful link. Unfortunately, it does not look like > I have access to make. Is there a > workaround? As in "make isn't installed"? The only alternatives are to somehow install the pre-built binary as described by Simon, or else to somehow install Make first (either on its own or as some kind of prefix environment). > > > > On Sun, Nov 10, 2013 at 12:34 PM, Ivan Lazar Miljenovic > wrote: >> On 10 November 2013 23:14, Theo Moore wrote: >>> I am trying to install the Haskell libraries for pandoc on a local >>> home folder and without root access, using the command: >>> >>> cabal install pandoc >>> >>> However, I run into the error: >>> cabal: Missing dependency on a foreign library: >>> * Missing (or bad) header file: zlib.h >>> * Missing C library: z >>> >>> From what I understand, I need to install zlib1g-dev. GHC and cabal >>> install are available, but without root access I'm having trouble >>> figuring out how to provide the necessary zlib files. I've tried to >>> download the source of zlib1g-dev, but in order to compile it, I have >>> to use "make" which I do not have the priviledge to invoke. >>> >>> Can someone guide me through getting pandoc up and running without >>> root access? The system is Debian 3.2.41-2 x86_64 GNU/Linux. >> >> You should be able to configure, build and install the zlib >> library+headers into your own $HOME directory. One guide (that on a >> quick skim looks OK) is http://blog.sanctum.geek.nz/compiling-in-home/ >> >> (Whether it's possible to install just the header files of zlib is >> something I can't say.) >> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> >> >> -- >> Ivan Lazar Miljenovic >> Ivan.Miljenovic at gmail.com >> http://IvanMiljenovic.wordpress.com -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From Andrew.Butterfield at scss.tcd.ie Mon Nov 11 09:03:44 2013 From: Andrew.Butterfield at scss.tcd.ie (Andrew Butterfield) Date: Mon, 11 Nov 2013 09:03:44 +0000 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: <250FB6B1-C507-42CB-82C1-E7D8DB14424D@scss.tcd.ie> I use WinEdt + MikTex on Windows? Most of my work uses .lhs literate scripts that are also LaTeX files, hence the perhaps strange choice. I run Windows in a VM on Mac OS X (my desktop) because Mac support for LaTeX is, well, basically dreadful ! ? now I'm sliding off-topic so I'll shut up? Regards, Andrew. On 8 Nov 2013, at 19:44, Corentin Dupont wrote: > Hi cafe, > I would like to know which IDE are you using? > I use Leksah, I like the GUI design and constant compilation process. > However, the development seems to be slowing down: last version date from early 2012. The installation process is very painful. > > There is FPComplete IDE coming up, but it's commercial. > I'm experimenting with it, anyway: how to compile using cabal files? It doesn't seem to recognize them. Will there be an off-line version? > > I'm interested to know if you are using vim to develop: which extension are you using? I'm interested in continuous compilation, project files browsing, code completion, search-in-files. > > Best, > Corentin > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -------------------------------------------------------------------- Andrew Butterfield Tel: +353-1-896-2517 Fax: +353-1-677-2204 Lero at TCD, Head of Foundations & Methods Research Group Director of Teaching and Learning - Undergraduate, School of Computer Science and Statistics, Room G.39, O'Reilly Institute, Trinity College, University of Dublin http://www.scss.tcd.ie/Andrew.Butterfield/ -------------------------------------------------------------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From ketil at malde.org Mon Nov 11 10:17:38 2013 From: ketil at malde.org (Ketil Malde) Date: Mon, 11 Nov 2013 11:17:38 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> References: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> Message-ID: <87li0v2qf1.fsf@wespe.malde.org> > Emacs + haskell-mode gives you: [lots of goodies I need to learn more about] > You can do continuous compilation using emacs fly-mode. After starting to use ghc-mod, I never looked back. Having trouble spots being automatically highlighted is really a huge improvement over the old write-compile-debug cycle. Other benefits, like automatic type signature insertion is also nice, of course. (I haven't really tried anything else, so perhaps this is standard fare these days. Just wanted to voice my appreciation, I guess :-) -k -- If I haven't seen further, it is by standing in the footprints of giants From andra.dinu at erlang-solutions.com Mon Nov 11 12:31:15 2013 From: andra.dinu at erlang-solutions.com (Andra Dinu) Date: Mon, 11 Nov 2013 13:31:15 +0100 (CET) Subject: [Haskell-cafe] Haskell talks at Code Mesh London 3-5 Dec - Early Bird ends in 3 days In-Reply-To: <497061111.726790.1384173068230.JavaMail.zimbra@erlang-solutions.com> Message-ID: <333709620.726792.1384173075749.JavaMail.zimbra@erlang-solutions.com> Hi, Between the 4th and 5th of December, inventors and users of the most discussed technologies of the moment will gather in London for the second edition of Code Mesh - The Alternative Programming Conference. Haskell talks include: * Haskell at Barclays: Exotic Tools for Exotic Trades - http://codemesh.io/index.html#tim-williams * The Haxl Project at Facebook - http://codemesh.io/index.html#simon-marlow * Haskell in the Newsroom - http://codemesh.io/index.html#erik-hinton Other languages discussed: Clojure, Erlang, Elixir, Rust, Julia and more! Among the 50 speakers you will also find Ruby guru and author of 'The Pragmatic Programmer' Dave Thomas, Erlang co-inventor Joe Armstrong, Elixir creator Jos? Valim, Akka inventor Jonas Bon?r, creator of the Parallela board Andreas Olofsson, creator of Catnip IDE Bodil Stokke, co-inventor of Julia Stefan Karpinski, Clojure experts Carin Meijer and Timothy Baldridge, creator of ZeroMQ Pieter Hintjens, as well as O'Reilly authors such as Francesco Cesarini and Dean Wampler. Check out the entire programme on the conference website: http://codemesh.io/ Thanks, Andra -- Andra Dinu Community & Social ERLANG SOLUTIONS LTD New Loom House 101 Back Church Lane London, E1 1LU United Kingdom Tel +44(0)2076550344 Mob +44(0)7983484387 www.erlang-solutions.com From ketil at malde.org Mon Nov 11 13:19:18 2013 From: ketil at malde.org (Ketil Malde) Date: Mon, 11 Nov 2013 14:19:18 +0100 Subject: [Haskell-cafe] The participation threshold (was Re: idea: ratings (or maybe comments) for packages in hackage) In-Reply-To: References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> <87wqkm0vyy.fsf@wespe.malde.org> Message-ID: <87fvr32i09.fsf@wespe.malde.org> Carter Schonwald writes: > 1) comments have spam > 2) the new process for getting the ACLs to a package where you're On the face of it, this looks like two entirely different things. But in a sense, I think they're not. As hackage is tightening up its administrative aspects, there are new protocols and due process to accomplish various things. However, one must be acutely aware of the cost of even small hurdles. I read somewhere (but couldn't find it again) that for every extra action required in a process, you lose a certain - fairly large - percentage of people. So when I fixed a few things in Data.Judy, I emailed the patch to Don S (the maintainer), who suggested I just take it over. I actually took the trouble of figuring out the process for transferring maintainership (which wasn't terribly obvious), and mailed him back. And haven't heard anything. And I don't blame him, he's likely busy with real work, and doesn't have any particular interest in an old orphaned library. Now, sure, I can find the correct subscription process for libraries@, subscribe, wait for confirmation, send a message applying for maintainership, wait for approval (or rejection, and appeal?), then upload the new version to hackage. Or I can install an IRC client, find out which IRC server I should use, go to #hackage, send a message, resend it at intervals, until somebody responds, wait for maintainership to be transferred, upload a new package. Well, guess what, this has little to no benefit to myself - and chances are, I'll postpone it to some lazy day in the future - probably never. After all, my version works for me. Anyway, I'm not saying the processes and protocols are wrong, perhaps the net benefit outweighs the costs. I have previously uploaded new versions to hackage after not getting a response from the maintainer for a few days - this was much to the annoyance of said maintainer, so there are clearly downsides to having a process that is too open. I think the important thing is that: a) we keep in mind that any hurdle, any restriction has a real and tangible cost, and thus the necessity of any restrictive feature should be very carefully considered b) if a restriction cannot be avoided, its impact should be made as small as possible (for instance, requests could be directed to a list that isn't subscribers only) So in the case of comments, yes, there is a risk of spam (although I do think disqus is doing a pretty good job of avoiding it). But it is also a very low-barrier way for users of sending feedback. Must we really sacrifice that? -k PS: I'd love user comments on anything I maintain, I wonder if I could sneak in some code in the .cabal file that will render a disqus comment field on hackage regardless? :-) -- If I haven't seen further, it is by standing in the footprints of giants From rrnewton at gmail.com Mon Nov 11 15:01:06 2013 From: rrnewton at gmail.com (Ryan Newton) Date: Mon, 11 Nov 2013 10:01:06 -0500 Subject: [Haskell-cafe] Things stopping pure Haskell code from having a cross-platform single semantics? Message-ID: Haskell isn't like Java byte code in having a single semantics for a program irrespective of where it is run. In particular, "Int" has a platform-defined width -- so the same (pure) code can yield different answers on different machines. numCapabilities was also a "leak" of platform information, which did not require IO. But, happily, now it does not appear in the [Trustworthy] module, Control.Concurrent. Ok, what else? What other holes are there that allow my pure functions to change their answer on different machines? I'm making a list of these in a paper and I want to make sure I give a full account. Thanks, -Ryan -------------- next part -------------- An HTML attachment was scrubbed... URL: From hesselink at gmail.com Mon Nov 11 15:03:35 2013 From: hesselink at gmail.com (Erik Hesselink) Date: Mon, 11 Nov 2013 16:03:35 +0100 Subject: [Haskell-cafe] The participation threshold (was Re: idea: ratings (or maybe comments) for packages in hackage) In-Reply-To: <87fvr32i09.fsf@wespe.malde.org> References: <87wqknoqwz.fsf@gmail.com> <20131104224536.GC3424@x200> <20131105053502.GA26966@sniper> <87wqkm0vyy.fsf@wespe.malde.org> <87fvr32i09.fsf@wespe.malde.org> Message-ID: > b) if a restriction cannot be avoided, its impact should be made as > small as possible (for instance, requests could be directed to a list > that isn't subscribers only) For hackage specifically, you can email admin at hackage.haskell.org to get assistance for stuff like taking over a package if the maintainer is unable/absent. Erik From allbery.b at gmail.com Mon Nov 11 15:10:18 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 11 Nov 2013 10:10:18 -0500 Subject: [Haskell-cafe] Things stopping pure Haskell code from having a cross-platform single semantics? In-Reply-To: References: Message-ID: On Mon, Nov 11, 2013 at 10:01 AM, Ryan Newton wrote: > Ok, what else? What other holes are there that allow my pure functions to > change their answer on different machines? I'm making a list of these in a > paper and I want to make sure I give a full account. > Not something likely to strike the average program, but all the CAFs in System.Info are pure (not in IO). And two of them claim to be *runtime* information. :( -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From yanxiaopei199 at gmail.com Mon Nov 11 16:53:52 2013 From: yanxiaopei199 at gmail.com (Thanatos xiao) Date: Tue, 12 Nov 2013 00:53:52 +0800 Subject: [Haskell-cafe] IDE In-Reply-To: <87li0v2qf1.fsf@wespe.malde.org> References: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> <87li0v2qf1.fsf@wespe.malde.org> Message-ID: I use emacs + haskell-mode and some plugs developing in emacs very useful! 2013/11/11 Ketil Malde > > > Emacs + haskell-mode gives you: > > [lots of goodies I need to learn more about] > > > You can do continuous compilation using emacs fly-mode. > > After starting to use ghc-mod, I never looked back. Having trouble > spots being automatically highlighted is really a huge improvement over > the old write-compile-debug cycle. Other benefits, like automatic type > signature insertion is also nice, of course. > > (I haven't really tried anything else, so perhaps this is standard fare > these days. Just wanted to voice my appreciation, I guess :-) > > -k > -- > If I haven't seen further, it is by standing in the footprints of giants > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andres at well-typed.com Mon Nov 11 18:22:14 2013 From: andres at well-typed.com (=?ISO-8859-1?Q?Andres_L=F6h?=) Date: Mon, 11 Nov 2013 19:22:14 +0100 Subject: [Haskell-cafe] New: Haskell meeting in Regensburg, 2013-11-12, 20:00 Message-ID: Hi. There's a new monthly Haskell meeting in Regensburg, Bavaria, Germany. Tomorrow will be our third meeting, and the first one with a Haskell talk: Tuesday, 12 November 2013 20:00 Plan 9, Werftstra?e 15, 93059 Regensburg There'll be a short presentation by Martin Ruderer on how to solve problems such as the n-queens problem in Haskell. In addition, there's time for informal discussions and drinks. Everyone who's interested in Haskell is welcome. No actual knowledge of Haskell is expected or required. We'll speak German and/or English, depending on who's going to be there. If you'd like to get updates about future Regensburg Haskell meetings or vote on when we meet next, please join our mailing list at http://lists.binary-kitchen.de/listinfo/haskell If you have any questions and for some reason don't want to join the mailing list, you can also email me :) Hope to see many of you tomorrow. Cheers, Andres From omeragacan at gmail.com Mon Nov 11 19:28:44 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Mon, 11 Nov 2013 21:28:44 +0200 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? Message-ID: Hi all, Sorry for off-topic question, I'm asking this question here because as Haskell community we invent lots of new Haskell-like(sometimes a subset of Haskell like Fay, sometimes different languages with Haskell syntax and Haskell-like features like Elm and recent language with row polymorphic records -- I don't remember it's name) languages. What I'm wondering is that js_of_ocaml project looks like solving all problems we have. It's supports 100% of OCaml(it translates OCaml bytecode), and OCaml is arguably better than all languages we invented(awesome module system, records, strict by default, all OCaml libraries(except FFI ones) work, like functional data structures, parser generators etc.) (I'm assuming we won't have JS backend for GHC anytime soon) So in short, I don't understand why use Haskell like compile-to-js languages instead of js_of_ocaml (other than learning purposes -- JS may be a nice high-level target language to practice writing compilers etc.) Please note that I'm not using any compile-to-js languages in my work, so I may not be able to make a fair comparison, but to me all other compile-to-js langauges look worse after seeing js_of_ocaml. Of course, if I had a JS backend for GHC(which would mean compiling Haskell to JS with all extensions) it would be best solution, but for now I think js_of_ocaml is superior to all other solutions. I'm wondering your opinions about this. Thanks, --- ?mer Sinan A?acan http://osa1.net From charlieap at gmail.com Mon Nov 11 19:31:25 2013 From: charlieap at gmail.com (Charlie Paul) Date: Mon, 11 Nov 2013 11:31:25 -0800 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: > > (I'm assuming we won't have JS backend for GHC anytime soon) You would be somewhat mistaken. Just beware of compiling huge packages with it. On Mon, Nov 11, 2013 at 11:28 AM, ?mer Sinan A?acan wrote: > Hi all, > > Sorry for off-topic question, I'm asking this question here because as > Haskell community we invent lots of new Haskell-like(sometimes a > subset of Haskell like Fay, sometimes different languages with Haskell > syntax and Haskell-like features like Elm and recent language with row > polymorphic records -- I don't remember it's name) languages. What I'm > wondering is that js_of_ocaml project looks like solving all problems > we have. It's supports 100% of OCaml(it translates OCaml bytecode), > and OCaml is arguably better than all languages we invented(awesome > module system, records, strict by default, all OCaml libraries(except > FFI ones) work, like functional data structures, parser generators > etc.) > > (I'm assuming we won't have JS backend for GHC anytime soon) > > So in short, I don't understand why use Haskell like compile-to-js > languages instead of js_of_ocaml (other than learning purposes -- JS > may be a nice high-level target language to practice writing compilers > etc.) > > Please note that I'm not using any compile-to-js languages in my work, > so I may not be able to make a fair comparison, but to me all other > compile-to-js langauges look worse after seeing js_of_ocaml. Of > course, if I had a JS backend for GHC(which would mean compiling > Haskell to JS with all extensions) it would be best solution, but for > now I think js_of_ocaml is superior to all other solutions. > > I'm wondering your opinions about this. > > Thanks, > > --- > ?mer Sinan A?acan > http://osa1.net > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From omeragacan at gmail.com Mon Nov 11 19:32:02 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Mon, 11 Nov 2013 21:32:02 +0200 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: I'm aware of this, but when I first tried it a few months ago, it was not easy to use at all. Is it changed now? --- ?mer Sinan A?acan http://osa1.net 2013/11/11 Charlie Paul : >> (I'm assuming we won't have JS backend for GHC anytime soon) > > You would be somewhat mistaken. Just beware of compiling huge packages with > it. > > > On Mon, Nov 11, 2013 at 11:28 AM, ?mer Sinan A?acan > wrote: >> >> Hi all, >> >> Sorry for off-topic question, I'm asking this question here because as >> Haskell community we invent lots of new Haskell-like(sometimes a >> subset of Haskell like Fay, sometimes different languages with Haskell >> syntax and Haskell-like features like Elm and recent language with row >> polymorphic records -- I don't remember it's name) languages. What I'm >> wondering is that js_of_ocaml project looks like solving all problems >> we have. It's supports 100% of OCaml(it translates OCaml bytecode), >> and OCaml is arguably better than all languages we invented(awesome >> module system, records, strict by default, all OCaml libraries(except >> FFI ones) work, like functional data structures, parser generators >> etc.) >> >> (I'm assuming we won't have JS backend for GHC anytime soon) >> >> So in short, I don't understand why use Haskell like compile-to-js >> languages instead of js_of_ocaml (other than learning purposes -- JS >> may be a nice high-level target language to practice writing compilers >> etc.) >> >> Please note that I'm not using any compile-to-js languages in my work, >> so I may not be able to make a fair comparison, but to me all other >> compile-to-js langauges look worse after seeing js_of_ocaml. Of >> course, if I had a JS backend for GHC(which would mean compiling >> Haskell to JS with all extensions) it would be best solution, but for >> now I think js_of_ocaml is superior to all other solutions. >> >> I'm wondering your opinions about this. >> >> Thanks, >> >> --- >> ?mer Sinan A?acan >> http://osa1.net >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From charlieap at gmail.com Mon Nov 11 19:33:51 2013 From: charlieap at gmail.com (Charlie Paul) Date: Mon, 11 Nov 2013 11:33:51 -0800 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: I tried it about a month ago, and the vagrant install method was easy and straightforward, if slow. They plan to cabalize it as well. On Mon, Nov 11, 2013 at 11:32 AM, ?mer Sinan A?acan wrote: > I'm aware of this, but when I first tried it a few months ago, it was > not easy to use at all. Is it changed now? > > --- > ?mer Sinan A?acan > http://osa1.net > > > 2013/11/11 Charlie Paul : > >> (I'm assuming we won't have JS backend for GHC anytime soon) > > > > You would be somewhat mistaken. Just beware of compiling huge packages > with > > it. > > > > > > On Mon, Nov 11, 2013 at 11:28 AM, ?mer Sinan A?acan < > omeragacan at gmail.com> > > wrote: > >> > >> Hi all, > >> > >> Sorry for off-topic question, I'm asking this question here because as > >> Haskell community we invent lots of new Haskell-like(sometimes a > >> subset of Haskell like Fay, sometimes different languages with Haskell > >> syntax and Haskell-like features like Elm and recent language with row > >> polymorphic records -- I don't remember it's name) languages. What I'm > >> wondering is that js_of_ocaml project looks like solving all problems > >> we have. It's supports 100% of OCaml(it translates OCaml bytecode), > >> and OCaml is arguably better than all languages we invented(awesome > >> module system, records, strict by default, all OCaml libraries(except > >> FFI ones) work, like functional data structures, parser generators > >> etc.) > >> > >> (I'm assuming we won't have JS backend for GHC anytime soon) > >> > >> So in short, I don't understand why use Haskell like compile-to-js > >> languages instead of js_of_ocaml (other than learning purposes -- JS > >> may be a nice high-level target language to practice writing compilers > >> etc.) > >> > >> Please note that I'm not using any compile-to-js languages in my work, > >> so I may not be able to make a fair comparison, but to me all other > >> compile-to-js langauges look worse after seeing js_of_ocaml. Of > >> course, if I had a JS backend for GHC(which would mean compiling > >> Haskell to JS with all extensions) it would be best solution, but for > >> now I think js_of_ocaml is superior to all other solutions. > >> > >> I'm wondering your opinions about this. > >> > >> Thanks, > >> > >> --- > >> ?mer Sinan A?acan > >> http://osa1.net > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Mon Nov 11 19:37:39 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Mon, 11 Nov 2013 14:37:39 -0500 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: On Mon, Nov 11, 2013 at 2:32 PM, ?mer Sinan A?acan wrote: > I'm aware of this, but when I first tried it a few months ago, it was > not easy to use at all. Is it changed now? > The biggest bump in usability will come from it not being just in HEAD with everything about building it that that implies. (next release of GHC will have it) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Mon Nov 11 19:39:20 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 11 Nov 2013 14:39:20 -0500 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: yup! i'm very excited about GHCJS once the 7.8 GHC lands :) On Mon, Nov 11, 2013 at 2:37 PM, Brandon Allbery wrote: > On Mon, Nov 11, 2013 at 2:32 PM, ?mer Sinan A?acan wrote: > >> I'm aware of this, but when I first tried it a few months ago, it was >> not easy to use at all. Is it changed now? >> > > The biggest bump in usability will come from it not being just in HEAD > with everything about building it that that implies. (next release of GHC > will have it) > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From graham at fatlazycat.com Mon Nov 11 22:31:48 2013 From: graham at fatlazycat.com (Graham Berks) Date: Mon, 11 Nov 2013 22:31:48 +0000 Subject: [Haskell-cafe] Quickcheck generator help Message-ID: Hi, have the following type data BinomialHeap a = EmptyHeap | Node a Int (BinomialHeap a) and wanted to create a test generator with type ?a? as an Int for example hence had? newtype BinominalHeapInt = BinominalHeap Int deriving (Eq, Show) But struggling to get the generator correct, currently have? instance Arbitrary BinominalHeapInt where arbitrary = sized heap' where heap' 0 = return EmptyHeap heap' n | n>0 = oneof [return EmptyHeap, liftM3 Node arbitrary arbitrary subnode] where subnode = heap' (n `div` 2) But it complains? ? ? Expected type: Int -> Gen BinominalHeapInt ? ? ? Actual type: Int -> Gen (BinomialHeap a1) in sized heap? Any pointers ? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Mon Nov 11 22:59:53 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Tue, 12 Nov 2013 09:59:53 +1100 Subject: [Haskell-cafe] Quickcheck generator help In-Reply-To: References: Message-ID: On 12 November 2013 09:31, Graham Berks wrote: > Hi, have the following type > > data BinomialHeap a = EmptyHeap | Node a Int (BinomialHeap a) > > and wanted to create a test generator with type ?a? as an Int for example > > hence had > > newtype BinominalHeapInt = BinominalHeap Int deriving (Eq, Show) Methinks this line is an error: what you've said is that BinominalHeapInt is an Int wrapped in a BinominalHeap constructor; you probably want: newtype BinomialHeapInt = BHI (BinomialHeap Int) Notice also your type of "Binominal" instead of "Binomial". (You can't derive anything as Eq and Show aren't derived/defined for BinomialHeap) > > But struggling to get the generator correct, currently have > > instance Arbitrary BinominalHeapInt where > arbitrary = sized heap' where > heap' 0 = return EmptyHeap > heap' n | n>0 = oneof [return EmptyHeap, liftM3 Node arbitrary arbitrary > subnode] > where subnode = heap' (n `div` 2) What you'd probably want is to have "instance (Arbitrary a) => Arbitrary (BinomialHeap a) where ..." with this definition, and then: instance Arbitrary BinomialHeapInt where arbitrary = fmap BHI arbitrary > > But it complains > > Expected type: Int -> Gen BinominalHeapInt > Actual type: Int -> Gen (BinomialHeap a1) > > in sized heap? > > Any pointers ? > > Thanks > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From alexander at plaimi.net Mon Nov 11 23:42:54 2013 From: alexander at plaimi.net (Alexander Berntsen) Date: Tue, 12 Nov 2013 00:42:54 +0100 Subject: [Haskell-cafe] Looking for feedback on my Haskell game programming paper Message-ID: <52816B7E.8040203@plaimi.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 Someone suggested I posted this here: . "This" being an informal introduction to game programming in Haskell, aimed at game programmers used to C or C-likes. I and a fellow student originally wrote it for a class, but someone (someone else than the first someone) found the URL and posted it on Reddit[0], and various other people have read it as well -- so we already have some feedback to go on. But we welcome more feedback. It has yet to be shared outside of the Haskell community, as I would like to polish it first, and reach a 1.0 version. (Hopefully this week!) The game presented in the paper is far from finished. We aim towards a full-blown but small game. It should have multi-player, AI, networking, somewhat complicated physics, control handling, menus, a graphics system, and so on and so forth. Basically it should cover "everything", but still be small enough to serve as an example. Contributions to the game itself would be also be greatly appreciated. Its source is available on GitHub[1]. [0] [1] - -- Alexander alexander at plaimi.net http://plaimi.net/~alexander -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iF4EAREIAAYFAlKBa34ACgkQRtClrXBQc7UDGgEAtTF83DTlLM8eR68hGhgJTxj3 1sygYsqNQae3Zm5KbMcA/RfwyqyWzBgOOyeuI0JpSToWuh1ex2ILFcPdjX5nR6X7 =f0mJ -----END PGP SIGNATURE----- From conal at conal.net Tue Nov 12 00:35:48 2013 From: conal at conal.net (Conal Elliott) Date: Mon, 11 Nov 2013 16:35:48 -0800 Subject: [Haskell-cafe] Things stopping pure Haskell code from having a cross-platform single semantics? In-Reply-To: References: Message-ID: For a few more such leaks, see http://hackage.haskell.org/package/base-4.6.0.1/docs/System-Info.html , as mentioned in http://conal.net/blog/posts/notions-of-purity-in-haskell . -- Conal On Mon, Nov 11, 2013 at 7:01 AM, Ryan Newton wrote: > Haskell isn't like Java byte code in having a single semantics for a > program irrespective of where it is run. In particular, "Int" has a > platform-defined width -- so the same (pure) code can yield different > answers on different machines. > > numCapabilities was also a "leak" of platform information, which did not > require IO. But, happily, now it does not appear in the [Trustworthy] > module, Control.Concurrent. > > Ok, what else? What other holes are there that allow my pure functions to > change their answer on different machines? I'm making a list of these in a > paper and I want to make sure I give a full account. > > Thanks, > -Ryan > > > _______________________________________________ > ghc-devs mailing list > ghc-devs at haskell.org > http://www.haskell.org/mailman/listinfo/ghc-devs > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dot_wangyushi at yeah.net Tue Nov 12 02:26:37 2013 From: dot_wangyushi at yeah.net (m00nlight) Date: Tue, 12 Nov 2013 10:26:37 +0800 (CST) Subject: [Haskell-cafe] IDE In-Reply-To: References: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> <87li0v2qf1.fsf@wespe.malde.org> Message-ID: The haskell-mode 13.7 of Emacs will eat all the cpu resource on my computer when I configure the indent of haskell mode. Does any one encounter the same issue ? -- -- Best Regards From Emacs Like Excellent Browser: Conkeror At 2013-11-12 00:53:52,"Thanatos xiao" wrote: I use emacs + haskell-mode and some plugs developing in emacs very useful! 2013/11/11 Ketil Malde > Emacs + haskell-mode gives you: [lots of goodies I need to learn more about] > You can do continuous compilation using emacs fly-mode. After starting to use ghc-mod, I never looked back. Having trouble spots being automatically highlighted is really a huge improvement over the old write-compile-debug cycle. Other benefits, like automatic type signature insertion is also nice, of course. (I haven't really tried anything else, so perhaps this is standard fare these days. Just wanted to voice my appreciation, I guess :-) -k -- If I haven't seen further, it is by standing in the footprints of giants _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe at haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe -------------- next part -------------- An HTML attachment was scrubbed... URL: From hans at hanshoglund.se Tue Nov 12 12:20:50 2013 From: hans at hanshoglund.se (=?iso-8859-1?Q?Hans_H=F6glund?=) Date: Tue, 12 Nov 2013 13:20:50 +0100 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: <12B5C404-9A13-4229-B5BC-4DA78237BCB5@hanshoglund.se> It is actually confirmed that GHCJS will go into an official GHC release? I have not been able to find that information on the GHC tracker. I have tried GHCJS, Haste and the UHC-JS in the past and found Haste the most easy to install and use. As far as I know, GHCJS and Haste are the only compilers to support all GHC extensions. Of course, this actualizes that old question of whether pervasive use of GHC-only extensions is A Good Thing... yet still I keep finding {-# LANGUAGE DeriveTraversable, ViewPatterns, TypeFamilies ? #-} on top of my source files. Regards, Hans On Mon, Nov 11, 2013 at 2:37 PM, Brandon Allbery wrote: > On Mon, Nov 11, 2013 at 2:32 PM, ?mer Sinan A?acan wrote: > >> I'm aware of this, but when I first tried it a few months ago, it was >> not easy to use at all. Is it changed now? >> > > The biggest bump in usability will come from it not being just in HEAD > with everything about building it that that implies. (next release of GHC > will have it) > > -- > brandon s allbery kf8nh sine nomine > associates > allbery.b at gmail.com > ballbery at sinenomine.net > unix, openafs, kerberos, infrastructure, xmonad > http://sinenomine.net > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Nov 12 16:32:02 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 12 Nov 2013 11:32:02 -0500 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: <12B5C404-9A13-4229-B5BC-4DA78237BCB5@hanshoglund.se> References: <12B5C404-9A13-4229-B5BC-4DA78237BCB5@hanshoglund.se> Message-ID: No. It will be it's own package on hackage. On Tuesday, November 12, 2013, Hans H?glund wrote: > It is actually confirmed that GHCJS will go into an official GHC release? > I have not been able to find that information on the GHC tracker. > > I have tried GHCJS, Haste and the UHC-JS in the past and found Haste the > most easy to install and use. As far as I know, GHCJS and Haste are the > only compilers to support all GHC extensions. > > Of course, this actualizes that old question of whether pervasive use of > GHC-only extensions is A Good Thing... yet still I keep finding {-# > LANGUAGE DeriveTraversable, ViewPatterns, TypeFamilies ? #-} on top of my > source files. > > Regards, > Hans > > > On Mon, Nov 11, 2013 at 2:37 PM, Brandon Allbery > >wrote: > > On Mon, Nov 11, 2013 at 2:32 PM, ?mer Sinan A?acan > >wrote: > > > I'm aware of this, but when I first tried it a few months ago, it was > > not easy to use at all. Is it changed now? > > > > The biggest bump in usability will come from it not being just in HEAD > > with everything about building it that that implies. (next release of GHC > > will have it) > > > -- > > brandon s allbery kf8nh sine nomine > > associates > > allbery.b at gmail.com > > ballbery at sinenomine.net 'ballbery at sinenomine.net');> > > unix, openafs, kerberos, infrastructure, xmonad > > http://sinenomine.net > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org 'Haskell-Cafe at haskell.org');> > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jeremy at n-heptane.com Tue Nov 12 17:24:43 2013 From: jeremy at n-heptane.com (Jeremy Shaw) Date: Tue, 12 Nov 2013 11:24:43 -0600 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan wrote: > I'm aware of this, but when I first tried it a few months ago, it was > not easy to use at all. Is it changed now? Last I heard, Luite was waiting for GHC 7.8 to be released because it contains changes that will allow him to upload ghcjs to hackage and then you will be able to just cabal install it. I could be wrong though. - jeremy From haskell at patrickmylund.com Tue Nov 12 17:38:46 2013 From: haskell at patrickmylund.com (Patrick Mylund Nielsen) Date: Tue, 12 Nov 2013 12:38:46 -0500 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw wrote: > On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan > wrote: > > I'm aware of this, but when I first tried it a few months ago, it was > > not easy to use at all. Is it changed now? > > Last I heard, Luite was waiting for GHC 7.8 to be released because it > contains changes that will allow him to upload ghcjs to hackage and > then you will be able to just cabal install it. I could be wrong > though. > As far as I know, that's correct. The easiest way to install and use it right now is using their Vagrant setup: http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun -------------- next part -------------- An HTML attachment was scrubbed... URL: From doug at cs.dartmouth.edu Tue Nov 12 17:42:00 2013 From: doug at cs.dartmouth.edu (Doug McIlroy) Date: Tue, 12 Nov 2013 12:42:00 -0500 Subject: [Haskell-cafe] Things stopping pure Haskell code Message-ID: <201311121742.rACHg0vR010513@stowe.cs.dartmouth.edu> > What other holes are there that allow my pure functions to > change their answer on different machines? Floating point poses potential surprises. Library functions required by Haskell, but obtained from outside, can differ. IEEE FP modes may not be consistently set across all or even consistently at all times in one system if control ever leaaves Haskell code. Haskell's second-rate IO conversion functions cry out for replacement. I can imagine them being replaced in installations that really care about floating-point. Doug McIlroy From haskell at nand.wakku.to Tue Nov 12 18:15:44 2013 From: haskell at nand.wakku.to (Niklas Haas) Date: Tue, 12 Nov 2013 19:15:44 +0100 Subject: [Haskell-cafe] Things stopping pure Haskell code from having a cross-platform single semantics? In-Reply-To: References: Message-ID: <20131112191544.GA6454@nanodesu.talocan.mine.nu> The pure functions from Data.Char depend on the system locale, at least with GHC's implementation. From abbasakbar at hushmail.com Tue Nov 12 18:17:58 2013 From: abbasakbar at hushmail.com (abbasakbar at hushmail.com) Date: Tue, 12 Nov 2013 18:17:58 +0000 Subject: [Haskell-cafe] Fake Conferences CSCI and WORLDCOMP of Hamid Arabnia Message-ID: <20131112181758.359556017B@smtp.hushmail.com> Fake Conferences CSCI and WORLDCOMP of Hamid Arabnia Hamid Arabnia from University of Georgia is well known for his fake WORLDCOMP conferences https://sites.google.com/site/worlddump1 or https://sites.google.com/site/dumpconf Hamid Arabnia understood that he cannot deceive researchers anymore using his WORLDCOMP. Hamid Arabnia (Guru of Fake Conferences and champion of academic scam) has recently started 2014 International Conference on Computational Science and Computational Intelligence (CSCI'14) http://www.americancse.org to deceive researchers further. CSCI'14 is started under the title of ?American Council on Science and Education? which is a dummy corporation (does not exist anywhere in the world). Hamid Arabnia buried his name in the list of names of other innocent steering and program committee members of CSCI?14 to avoid any special attention. He knows that if his name is given any special attention then researchers immediately know that the conference is fake due to his ?track record? with WORLDCOMP. Hamid Arabnia (the money hungry beast) spoiled the reputations and careers of many authors and committee members involved in his infamous WORLDCOMP for more than a decade and he is now ready to do the same using CSCI. Interestingly, CSCI is scheduled to be held at the same venue where WORLDCOMP was held until 2012. Hamid Arabnia claimed that CSCI proceedings will be published by IEEE but no one knows if IEEE really publishes. Many scholars have already sent emails to IEEE protesting for the unethical behavior of Hamid Arabnia and for the new series of his bogus conferences CSCI. CSCI paper submission deadline will be extended multiple times as usual. Do not spoil your resume by submitting your papers in this bogus conference CSCI which will not be held beyond 2014. Sincerely, Many researchers cheated by Hamid Arabnia conferences From omeragacan at gmail.com Tue Nov 12 20:24:27 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Tue, 12 Nov 2013 22:24:27 +0200 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: That's great news. I wonder if that means it'll be end for Fay and similar languages? --- ?mer Sinan A?acan http://osa1.net 2013/11/12 Patrick Mylund Nielsen : > On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw wrote: >> >> On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan >> wrote: >> > I'm aware of this, but when I first tried it a few months ago, it was >> > not easy to use at all. Is it changed now? >> >> Last I heard, Luite was waiting for GHC 7.8 to be released because it >> contains changes that will allow him to upload ghcjs to hackage and >> then you will be able to just cabal install it. I could be wrong >> though. > > > As far as I know, that's correct. > > The easiest way to install and use it right now is using their Vagrant > setup: > http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun From carter.schonwald at gmail.com Tue Nov 12 20:33:15 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 12 Nov 2013 15:33:15 -0500 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: thats up to the users :) that said, having full ghc haskell to target JS will be pretty amazing :) On Tue, Nov 12, 2013 at 3:24 PM, ?mer Sinan A?acan wrote: > That's great news. I wonder if that means it'll be end for Fay and > similar languages? > > --- > ?mer Sinan A?acan > http://osa1.net > > > 2013/11/12 Patrick Mylund Nielsen : > > On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw > wrote: > >> > >> On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan < > omeragacan at gmail.com> > >> wrote: > >> > I'm aware of this, but when I first tried it a few months ago, it was > >> > not easy to use at all. Is it changed now? > >> > >> Last I heard, Luite was waiting for GHC 7.8 to be released because it > >> contains changes that will allow him to upload ghcjs to hackage and > >> then you will be able to just cabal install it. I could be wrong > >> though. > > > > > > As far as I know, that's correct. > > > > The easiest way to install and use it right now is using their Vagrant > > setup: > > > http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.lentczner at gmail.com Tue Nov 12 22:38:32 2013 From: mark.lentczner at gmail.com (Mark Lentczner) Date: Tue, 12 Nov 2013 14:38:32 -0800 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: On Tue, Nov 12, 2013 at 3:24 PM, ?mer Sinan A?acan wrote: > That's great news. I wonder if that means it'll be end for Fay and similar > languages? > On Tue, Nov 12, 2013 at 12:33 PM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > that said, having full ghc haskell to target JS will be pretty amazing :) > I think the biggest determiner, by far, is ease of integration and deployment. Integration means things like how can I use this with a web page, full other other bits in JS (like google analytics, and FB plug-ins), and access jQuery. Deployment means things like how easily I can edit, and then see that code run *in situ.* These things, more than language completeness, will determine what succeeds. (viz. PHP!) - Mark -------------- next part -------------- An HTML attachment was scrubbed... URL: From dstcruz at gmail.com Wed Nov 13 03:47:41 2013 From: dstcruz at gmail.com (Daniel Santa Cruz) Date: Tue, 12 Nov 2013 22:47:41 -0500 Subject: [Haskell-cafe] Haskell Weekly News: Issue 286 Message-ID: Welcome to issue 286 of the HWN, an issue covering crowd-sourced bits of information about Haskell from around the web. This issue covers the weeks of November 03 to 09, 2013. Quotes of the Week * edwardk: (->) is syntax, sadly. * chrisdone: my brother was killed by an IO monad hpc: i guess it started as an evaluation, but ended up as an execution... * mauke: no, haskell doesn't support trees * un1xguy: first web server was written in php... Top Reddit Stories * Haskell, the Language Most Likely to Change the Way you Think About Programming Domain: m.huffpost.com, Score: 54, Comments: 71 On Reddit: [1] http://goo.gl/E0dfbl Original: [2] http://goo.gl/1CGVmK * Announcing 24 Days of Hackage 2013 - I need your help! Domain: ocharles.org.uk, Score: 53, Comments: 45 On Reddit: [3] http://goo.gl/7RupOj Original: [4] http://goo.gl/6Uog4B * Pyret: New teaching language from makers of Racket with ADTs and pattern matching Domain: pyret.org, Score: 47, Comments: 25 On Reddit: [5] http://goo.gl/Xeyyyh Original: [6] http://goo.gl/GJmYgI * haskintex: Write and run Haskell within LaTeX Domain: daniel-diaz.github.io, Score: 42, Comments: 14 On Reddit: [7] http://goo.gl/1UTbdL Original: [8] http://goo.gl/2DbE5I * Haskell.org SSL rollout Domain: hackage.haskell.org, Score: 41, Comments: 9 On Reddit: [9] http://goo.gl/2DvgLX Original: [10] http://goo.gl/M0QwMh * Why Lists? Domain: self.haskell, Score: 36, Comments: 54 On Reddit: [11] http://goo.gl/Y2ma9V Original: [12] http://goo.gl/Y2ma9V * Frege: a JVM pure functional programming language in the spirit of Haskell Domain: github.com, Score: 36, Comments: 22 On Reddit: [13] http://goo.gl/pyaB8s Original: [14] http://goo.gl/kJWFg * Switching from imperative to functional programming with games in Elm (xpost from /r/programming) Domain: github.com, Score: 35, Comments: 11 On Reddit: [15] http://goo.gl/CbsMhS Original: [16] http://goo.gl/0MpQJ0 * FP Complete is hiring a Ruby expert Haskeller. Help bring Haskell to Rubyists! Domain: self.haskell, Score: 34, Comments: 26 On Reddit: [17] http://goo.gl/eb6G1s Original: [18] http://goo.gl/eb6G1s * plaimi?s introduction to Haskell for the Haskell-curious game programmer [PDF] Domain: secure.plaimi.net, Score: 31, Comments: 21 On Reddit: [19] http://goo.gl/khkU80 Original: [20] http://goo.gl/ZgRzkn * The F# Computation Expression Zoo (Why "computation expressions" are not just an "enterprise-y monad") Domain: tomasp.net, Score: 31, Comments: 18 On Reddit: [21] http://goo.gl/qnbrNx Original: [22] http://goo.gl/ErKmeU * Try PureScript Domain: tryps.functorial.com, Score: 30, Comments: 13 On Reddit: [23] http://goo.gl/mOJCvG Original: [24] http://goo.gl/aujnyl * Internship at Facebook London working on Haxl Domain: haskell.org, Score: 30, Comments: 4 On Reddit: [25] http://goo.gl/pHjgFp Original: [26] http://goo.gl/3qrzyR * Soostone is hiring in Turkey Domain: haskell.org, Score: 29, Comments: 15 On Reddit: [27] http://goo.gl/juSJLL Original: [28] http://goo.gl/IpYTkJ * Mind-bending behavior for deserialization in Haskell Domain: justinleitgeb.com, Score: 25, Comments: 75 On Reddit: [29] http://goo.gl/4BnEVn Original: [30] http://goo.gl/wTC06g * Hudak and Jones - An Experiment in Software Prototyping Productivity - 1994 [PDF] Domain: cs.yale.edu, Score: 24, Comments: 9 On Reddit: [31] http://goo.gl/krp66H Original: [32] http://goo.gl/qK6H98 * Webcast: Designing Domain Specific Languages with Haskell - Michael Snoyman - 2012-11-14 Domain: oreillynet.com, Score: 23, Comments: 0 On Reddit: [33] http://goo.gl/liqoge Original: [34] http://goo.gl/X7N0eN * Code review request: Wikipedia API for Haskell Domain: self.haskell, Score: 23, Comments: 25 On Reddit: [35] http://goo.gl/VgPCpC Original: [36] http://goo.gl/VgPCpC * transliterate: A korean transliteration library targeting GHC, Fay, and JS Domain: github.com, Score: 21, Comments: 16 On Reddit: [37] http://goo.gl/oYrL6c Original: [38] http://goo.gl/OAZ1z9 * lens-family 1.0.0 Domain: comments.gmane.org, Score: 20, Comments: 5 On Reddit: [39] http://goo.gl/H1HFyZ Original: [40] http://goo.gl/oAAd6Z * Gershom Bazerman, NYC Haskell Meetup Organizer, interviewed for your great learning Domain: rogueleaderr.com, Score: 20, Comments: 0 On Reddit: [41] http://goo.gl/unTdeJ Original: [42] http://goo.gl/0hJ1DL Top StackOverflow Questions * ?Eta reduce? is not always held in Haskell? votes: 11, answers: 1 Read on SO: [43] http://goo.gl/G0NZPp * Data Constructor promotion in GHC-7.6 votes: 10, answers: 0 Read on SO: [44] http://goo.gl/huK32T * best way to check arguments of a function in haskell votes: 9, answers: 1 Read on SO: [45] http://goo.gl/Cz5VDs * Processing a very large text file with lazy Texts and ByteStrings votes: 8, answers: 1 Read on SO: [46] http://goo.gl/eMtxDx * Style vs Performance Using Vectors votes: 8, answers: 1 Read on SO: [47] http://goo.gl/gm9o08 * Monad with no wrapped value? votes: 8, answers: 4 Read on SO: [48] http://goo.gl/XPBwQd * Is it safe to reuse a conduit? votes: 7, answers: 1 Read on SO: [49] http://goo.gl/QTepyV * Haskell Repa stencil hacks votes: 6, answers: 1 Read on SO: [50] http://goo.gl/2vEqVg * Are Functor instances unique? votes: 6, answers: 1 Read on SO: [51] http://goo.gl/EHm4yq Until next time, [52]+Daniel Santa Cruz References 1. http://m.huffpost.com/us/entry/4242119 2. http://www.reddit.com/r/haskell/comments/1q93r2/haskell_the_language_most_likely_to_change_the/ 3. http://ocharles.org.uk/blog/posts/2013-11-06-24-days-of-hackage-2013.html 4. http://www.reddit.com/r/haskell/comments/1q1sg1/announcing_24_days_of_hackage_2013_i_need_your/ 5. http://www.pyret.org/index.html 6. http://www.reddit.com/r/haskell/comments/1q8wv5/pyret_new_teaching_language_from_makers_of_racket/ 7. http://daniel-diaz.github.io/projects/haskintex 8. http://www.reddit.com/r/haskell/comments/1pwcd7/haskintex_write_and_run_haskell_within_latex/ 9. https://hackage.haskell.org/ 10. http://www.reddit.com/r/haskell/comments/1q1039/haskellorg_ssl_rollout/ 11. http://www.reddit.com/r/haskell/comments/1q0jsj/why_lists/ 12. http://www.reddit.com/r/haskell/comments/1q0jsj/why_lists/ 13. https://github.com/Frege/frege 14. http://www.reddit.com/r/haskell/comments/1q3r8v/frege_a_jvm_pure_functional_programming_language/ 15. https://github.com/Dobiasd/elm-articles/blob/master/switching_from_imperative_to_functional_programming_with_games_in_Elm.md 16. http://www.reddit.com/r/haskell/comments/1q5s14/switching_from_imperative_to_functional/ 17. http://www.reddit.com/r/haskell/comments/1pv6ua/fp_complete_is_hiring_a_ruby_expert_haskeller/ 18. http://www.reddit.com/r/haskell/comments/1pv6ua/fp_complete_is_hiring_a_ruby_expert_haskeller/ 19. https://secure.plaimi.net/~alexander/tmp/main.pdf 20. http://www.reddit.com/r/haskell/comments/1q1b9f/plaimis_introduction_to_haskell_for_the/ 21. http://tomasp.net/blog/2013/computation-zoo-padl/index.html 22. http://www.reddit.com/r/haskell/comments/1q6o2a/the_f_computation_expression_zoo_why_computation/ 23. http://tryps.functorial.com/ 24. http://www.reddit.com/r/haskell/comments/1pu02e/try_purescript/ 25. http://www.haskell.org/pipermail/haskell/2013-November/023977.html 26. http://www.reddit.com/r/haskell/comments/1pvggf/internship_at_facebook_london_working_on_haxl/ 27. http://www.haskell.org/pipermail/haskell-cafe/2013-November/111295.html 28. http://www.reddit.com/r/haskell/comments/1pyfor/soostone_is_hiring_in_turkey/ 29. http://justinleitgeb.com/haskell/mind-bending-behavior-for-deserialization-in-haskell/ 30. http://www.reddit.com/r/haskell/comments/1q4r3b/mindbending_behavior_for_deserialization_in/ 31. http://www.cs.yale.edu/publications/techreports/tr1049.pdf 32. http://www.reddit.com/r/haskell/comments/1pxvbk/hudak_and_jones_an_experiment_in_software/ 33. http://oreillynet.com/pub/e/2400 34. http://www.reddit.com/r/haskell/comments/1pzre6/webcast_designing_domain_specific_languages_with/ 35. http://www.reddit.com/r/haskell/comments/1pzymv/code_review_request_wikipedia_api_for_haskell/ 36. http://www.reddit.com/r/haskell/comments/1pzymv/code_review_request_wikipedia_api_for_haskell/ 37. https://github.com/bergmark/transliterate 38. http://www.reddit.com/r/haskell/comments/1q367s/transliterate_a_korean_transliteration_library/ 39. http://comments.gmane.org/gmane.comp.lang.haskell.cafe/107972 40. http://www.reddit.com/r/haskell/comments/1ps3d7/lensfamily_100/ 41. http://rogueleaderr.com/post/66018558718/a-interview-4-gershom-bazerman-organizer-of#disqus_thread 42. http://www.reddit.com/r/haskell/comments/1pwkey/gershom_bazerman_nyc_haskell_meetup_organizer/ 43. http://stackoverflow.com/questions/19758828/eta-reduce-is-not-always-held-in-haskell 44. http://stackoverflow.com/questions/19875636/data-constructor-promotion-in-ghc-7-6 45. http://stackoverflow.com/questions/19869902/best-way-to-check-arguments-of-a-function-in-haskell 46. http://stackoverflow.com/questions/19779559/processing-a-very-large-text-file-with-lazy-texts-and-bytestrings 47. http://stackoverflow.com/questions/19803949/style-vs-performance-using-vectors 48. http://stackoverflow.com/questions/19884548/monad-with-no-wrapped-value 49. http://stackoverflow.com/questions/19793824/is-it-safe-to-reuse-a-conduit 50. http://stackoverflow.com/questions/19749343/haskell-repa-stencil-hacks 51. http://stackoverflow.com/questions/19774904/are-functor-instances-unique 52. https://plus.google.com/105107667630152149014/about -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at lelf.lu Wed Nov 13 13:56:02 2013 From: me at lelf.lu (Anton Nikishaev) Date: Wed, 13 Nov 2013 17:56:02 +0400 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? References: Message-ID: ?mer Sinan A?acan writes: > That's great news. I wonder if that means it'll be end for Fay and > similar languages? GHCJS's Hello World is 2.1M worth of javascript (well, that's how it was several month ago, maybe it's better now?). And even google closure compiled with advanced optimizations it's ~500K. Fay's output is 5K after google-closure-mumbo-jumbo. > 2013/11/12 Patrick Mylund Nielsen : >> On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw wrote: >>> >>> On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan >>> wrote: >>> > I'm aware of this, but when I first tried it a few months ago, it was >>> > not easy to use at all. Is it changed now? >>> >>> Last I heard, Luite was waiting for GHC 7.8 to be released because it >>> contains changes that will allow him to upload ghcjs to hackage and >>> then you will be able to just cabal install it. I could be wrong >>> though. >> >> >> As far as I know, that's correct. >> >> The easiest way to install and use it right now is using their Vagrant >> setup: >> http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun -- lelf From iricanaycan at gmail.com Wed Nov 13 14:18:11 2013 From: iricanaycan at gmail.com (Aycan iRiCAN) Date: Wed, 13 Nov 2013 16:18:11 +0200 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: church% hastec --version 0.2.9 church% cat > Hello.hs module Main where main = print "Hello world." church% hastec --opt-google-closure --start=asap Hello.hs Compiling Main into . Linking Hello.js Linking Main Linking GHC.IO.Handle.Text Linking Haste.Handle Linking GHC.Tuple Linking GHC.Types Linking GHC.Show Linking GHC.List Linking GHC.Base Linking GHC.IO Running the Google Closure compiler on Hello.js... church% nodejs Hello.js "Hello world." Hello.js 5750 Bytes (46746 bytes without google closure). On Wed, Nov 13, 2013 at 3:56 PM, Anton Nikishaev wrote: > ?mer Sinan A?acan writes: > > > That's great news. I wonder if that means it'll be end for Fay and > > similar languages? > > GHCJS's Hello World is 2.1M worth of javascript (well, that's how it was > several month ago, maybe it's better now?). And even google closure > compiled with advanced optimizations it's ~500K. > > Fay's output is 5K after google-closure-mumbo-jumbo. > > > > > 2013/11/12 Patrick Mylund Nielsen : > >> On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw > wrote: > >>> > >>> On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan < > omeragacan at gmail.com> > >>> wrote: > >>> > I'm aware of this, but when I first tried it a few months ago, it was > >>> > not easy to use at all. Is it changed now? > >>> > >>> Last I heard, Luite was waiting for GHC 7.8 to be released because it > >>> contains changes that will allow him to upload ghcjs to hackage and > >>> then you will be able to just cabal install it. I could be wrong > >>> though. > >> > >> > >> As far as I know, that's correct. > >> > >> The easiest way to install and use it right now is using their Vagrant > >> setup: > >> > http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun > > -- > lelf > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- http://www.google.com/profiles/iricanaycan -------------- next part -------------- An HTML attachment was scrubbed... URL: From vlatko.basic at gmail.com Wed Nov 13 16:37:33 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Wed, 13 Nov 2013 17:37:33 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." Message-ID: <5283AACD.40300@gmail.com> Hi Cafe, in an example function f :: a -> Bool f a = let b = "x" in a == b compiler complains with `a' is a rigid type variable bound by the type signature for f :: a -> Bool I'm puzzled with the choice of word 'rigid' here. I see these types as - 'b' has "rigid/unchangeable" type (only String), and - 'a' has "soft/variable" type (any type, no constraints). Why is it called rigid? Where does the meaning (in this context) come from? Best regards, vlatko From rhymoid at gmail.com Wed Nov 13 16:52:24 2013 From: rhymoid at gmail.com (Stijn van Drongelen) Date: Wed, 13 Nov 2013 17:52:24 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5283AACD.40300@gmail.com> References: <5283AACD.40300@gmail.com> Message-ID: On Wed, Nov 13, 2013 at 5:37 PM, Vlatko Basic wrote: > Hi Cafe, > > in an example function > > f :: a -> Bool > f a = let b = "x" in a == b > > compiler complains with > `a' is a rigid type variable bound by the type signature for f :: a -> > Bool > > I'm puzzled with the choice of word 'rigid' here. > I see these types as > - 'b' has "rigid/unchangeable" type (only String), and > - 'a' has "soft/variable" type (any type, no constraints). > > Why is it called rigid? > Where does the meaning (in this context) come from? > > > > Best regards, > > vlatko > Hi Vlatko, I suspect the nomenclature comes from SPJ et al.'s "Simple Unification-based Type Inference for GADTs" (even though you're not using GADTs). Here, 'rigid' is used as a more technical term for "user-supplied". But I'm not sure. Kind regards, Stijn -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Nov 13 16:53:03 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 13 Nov 2013 11:53:03 -0500 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5283AACD.40300@gmail.com> References: <5283AACD.40300@gmail.com> Message-ID: On Wed, Nov 13, 2013 at 11:37 AM, Vlatko Basic wrote: > f :: a -> Bool > f a = let b = "x" in a == b > > compiler complains with > `a' is a rigid type variable bound by the type signature for f :: a -> > Bool > > I'm puzzled with the choice of word 'rigid' here. > I see these types as > - 'b' has "rigid/unchangeable" type (only String), and > - 'a' has "soft/variable" type (any type, no constraints). > The type declaration is the final arbiter. Since it says "any type", it means exactly that: you are claiming your function is prepared to handle *any type* the caller wishes to specify. It is not "soft", nor "variable" in the sense you intend: it is a hard requirement that your function must be prepared to handle whatever type the caller wants there. But instead your function requires that it be String, because both sides of (==) must be the same type. This violates the type signature'a assertion that the caller can specify any type. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From vlatko.basic at gmail.com Wed Nov 13 17:24:41 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Wed, 13 Nov 2013 18:24:41 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> Message-ID: <5283B5D9.8030309@gmail.com> An HTML attachment was scrubbed... URL: From vlatko.basic at gmail.com Wed Nov 13 17:25:34 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Wed, 13 Nov 2013 18:25:34 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> Message-ID: <5283B60E.1010500@gmail.com> An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Nov 13 17:42:31 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 13 Nov 2013 12:42:31 -0500 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5283B5D9.8030309@gmail.com> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> Message-ID: On Wed, Nov 13, 2013 at 12:24 PM, Vlatko Basic wrote: > Thanks for explanation. If I understood correctly, 'rigid' refers the > requirement, not the type itself. > I think that more intuitive/understandable would be something like > > 'b' has too rigid type for 'a' ... > Not really, unless you're talking about some notion of "types of types" (which exists, but not in this way). You're still trying to hold onto some notion that `a` is flexible; but the compiler does not care about the kind of flexibility you want. You will need to let go of that "flexible" for Haskell's type system to make sense. (This will make more sense when you start using typeclasses. Or, at least once you've tried to use your notion of "flexible" with them, because it will lead you straight into a brick wall that is not flexible at all.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam at well-typed.com Wed Nov 13 17:52:13 2013 From: adam at well-typed.com (Adam Gundry) Date: Wed, 13 Nov 2013 17:52:13 +0000 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5283B5D9.8030309@gmail.com> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> Message-ID: <5283BC4D.6070907@well-typed.com> Hi Vlatko, On 13/11/13 17:24, Vlatko Basic wrote: > Thanks for explanation. If I understood correctly, 'rigid' refers the > requirement, not the type itself. It refers to the type *variable*. This is a standard term [1] from unification theory, where variables are divided into two kinds: * rigid variables, which may not be filled in by the unifier; and * flexible variables, which may be filled in to solve a constraint. As Brandon says, a variable in a type declaration means "any type", so it is rigid. Flexible variables are introduced when you use a polymorphic definition, and the type inference algorithm must solve for them. Sometimes one speaks of a "rigid type", meaning a type that is either constant (like String) or a rigid variable. > I think that more intuitive/understandable would be something like > > 'b' has too rigid type for 'a' ... > > At least, that is what I have to tell myself when I encounter this issue You may well be right that this error message could be easier to understand, but in suggesting an alternative, be careful to be consistent with the existing meaning of "rigid". Adam [1] Which is to say, I can't remember where it originates. >> -------- Original Message -------- >> Subject: Re: [Haskell-cafe] Word rigid in "`a' is a rigid type >> variable..." >> From: Brandon Allbery >> To: Vlatko Ba?i? >> Cc: Haskell-Cafe >> Date: 13.11.2013 17:53 >> >> >> On Wed, Nov 13, 2013 at 11:37 AM, Vlatko Basic > > wrote: >> >> f :: a -> Bool >> f a = let b = "x" in a == b >> >> compiler complains with >> `a' is a rigid type variable bound by the type signature for f >> :: a -> Bool >> >> I'm puzzled with the choice of word 'rigid' here. >> I see these types as >> - 'b' has "rigid/unchangeable" type (only String), and >> - 'a' has "soft/variable" type (any type, no constraints). >> >> >> The type declaration is the final arbiter. Since it says "any type", >> it means exactly that: you are claiming your function is prepared to >> handle *any type* the caller wishes to specify. It is not "soft", nor >> "variable" in the sense you intend: it is a hard requirement that your >> function must be prepared to handle whatever type the caller wants there. >> >> But instead your function requires that it be String, because both >> sides of (==) must be the same type. This violates the type >> signature'a assertion that the caller can specify any type. >> >> -- >> brandon s allbery kf8nh sine nomine >> associates >> allbery.b at gmail.com >> ballbery at sinenomine.net >> unix, openafs, kerberos, infrastructure, xmonad >> http://sinenomine.net -- Adam Gundry, Haskell Consultant Well-Typed LLP, http://www.well-typed.com/ From evohunz at gmail.com Wed Nov 13 17:52:48 2013 From: evohunz at gmail.com (Thiago Negri) Date: Wed, 13 Nov 2013 15:52:48 -0200 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5283B5D9.8030309@gmail.com> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> Message-ID: > > I think that more intuitive/understandable would be something like > > 'b' has too rigid type for 'a' ... > > At least, that is what I have to tell myself when I encounter this issue > I don't think this is quite correct. As I'm a daily Java programmer, one thing that really troubled me was to think as `a' being something like `Object', but it is wrong. The `a' really means that the client of the function can define the type it wants, and be precise. I guess it's easier to see this in the value (result) of a function: "f :: a -> b" is a function that takes any value and produces any value the user wants, i.e. I can take an Int out of it, or a Double, or a String, or a Foo, or a Bar. That's a huge difference between Java's "Object f(Object a)" (a better comparison would be with " B f(A a);", I guess). I'm diverging a bit, but what I want to say is that there is no way to tell that the type of "b" is "too rigid" for the type `a' , because the `a' can be anything, even the exact type of "b". -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Wed Nov 13 17:56:44 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Wed, 13 Nov 2013 12:56:44 -0500 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> Message-ID: On Wed, Nov 13, 2013 at 12:42 PM, Brandon Allbery wrote: > On Wed, Nov 13, 2013 at 12:24 PM, Vlatko Basic wrote: > >> Thanks for explanation. If I understood correctly, 'rigid' refers the >> requirement, not the type itself. >> > > I think that more intuitive/understandable would be something like >> >> 'b' has too rigid type for 'a' ... >> > > Not really, unless you're talking about some notion of "types of types" > (which exists, but not in this way). You're still trying to hold onto some > notion that `a` is flexible; but the compiler does not care about the kind > of flexibility you want. You will need to let go of that "flexible" for > Haskell's type system to make sense. > As an example of this, by the way: your function declaration admits only two possible definitions, ignoring nontermination. Both of them ignore `a` entirely, because you can't do *anything* with it. You don't get much more rigid than being unable to use it at all! -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdmkolbe at gmail.com Wed Nov 13 18:16:48 2013 From: mdmkolbe at gmail.com (Michael D. Adams) Date: Wed, 13 Nov 2013 12:16:48 -0600 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 Message-ID: ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 I'm pleased to announce the first public release of the Haskell Pdf Presenter (hpdfp). Project home page: http://michaeldadams.org/projects/haskell-pdf-presenter/ Project on Hackage: http://hackage.haskell.org/package/haskell-pdf-presenter/ Project repository: http://michaeldadams.org/repos-pub/hg/haskell-pdf-presenter/ What it is ========== The Haskell Pdf Presenter (hpdfp) is a tool for presenting PDF-based slide shows. For example, as a presenter, I like to see the next slide before it is shown to the audience as well as how much allotted time remains. I was never quite satisfied with the existing tools for this, so I wrote my own and hpdfp is the result. Though I originally wrote it for my own use, the tool has matured over time, and I now wish to share it with others. Aside from being a useful tool, I think hpdfp is a good example of elegance and economy in program design. Despite being only a thousand lines long, this program is full of features that may not be obvious at first glance so please be sure to look at the available help. Status ====== I've been using this tool in my own talks for over a year now, and it is fairly stable and feature complete. I've only tested it on Ubuntu so I don't know if it ports to other platforms. I'd love to hear any field reports about how it runs on other platforms. Future Directions ================= I have a long TODO list of ideas I may implement in the future, but most development has been driven by the practical considerations that I discover as I use the tool. If you have a use case for a particular feature, please let me know. ================ Feature requests, bug reports, suggestions or feedback as well as contributions to the documentation or implementation are most welcome. Michael D. Adams From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Nov 13 19:09:42 2013 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 13 Nov 2013 19:09:42 +0000 Subject: [Haskell-cafe] Best practices for Arrows? In-Reply-To: <20130622212423.GA14099@city.ac.uk> References: <20130622122348.GC5083@weber> <20130622153615.20082a74@tritium.ertes.de> <20130622180509.GD5083@weber> <20130622212423.GA14099@city.ac.uk> Message-ID: <20131113190942.GF6340@weber> On Sat, Jun 22, 2013 at 10:24:23PM +0100, Ross Paterson wrote: > On Sat, Jun 22, 2013 at 07:05:09PM +0100, Tom Ellis wrote: > > On Sat, Jun 22, 2013 at 03:36:15PM +0200, Ertugrul S?ylemez wrote: > > > If the interface is not under your control, make yourself comfortable > > > with the complete arrow syntax, most notably how it handles operators, > > > combinators and the `(| banana bracket notation |)`. This is very > > > valuable information. > > > > Interesting. I hadn't noticed the `(| banana bracket notation |)` on the > > GHC Arrows page[1] before, but just saw it when I went back to check. > > The banana brackets can be handy when you have operations on your arrow > type beyond the ones in Arrow and ArrowLoop. But beware that the types of > the operations you can use with it will be changing in the next release > of GHC. The change is the first one described on > > http://hackage.haskell.org/trac/ghc/wiki/ArrowNotation Is there any example of using Arrow banana brackets? I downloaded all of Hackage and grepped it, and the only usage was in the comments of Control.Arrow.Internals! I have feeling these might be useful to me, but I can't quite understand how they work. Tom From mail at nh2.me Wed Nov 13 19:57:54 2013 From: mail at nh2.me (=?UTF-8?B?TmlrbGFzIEhhbWLDvGNoZW4=?=) Date: Wed, 13 Nov 2013 19:57:54 +0000 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: References: Message-ID: <5283D9C2.2070108@nh2.me> That is great, I've been interested in that program since your POPL talk. One problem I've had with it so far: It takes 100% CPU time when idle, which makes my laptop go quite hot. Any idea why that could be? On Wed 13 Nov 2013 18:16:48 GMT, Michael D. Adams wrote: > ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 > > I'm pleased to announce the first public release of the Haskell Pdf > Presenter (hpdfp). > > Project home page: > http://michaeldadams.org/projects/haskell-pdf-presenter/ > > Project on Hackage: > http://hackage.haskell.org/package/haskell-pdf-presenter/ > > Project repository: > http://michaeldadams.org/repos-pub/hg/haskell-pdf-presenter/ > > What it is > ========== > The Haskell Pdf Presenter (hpdfp) is a tool for presenting PDF-based > slide shows. For example, as a presenter, I like to see the next slide > before it is shown to the audience as well as how much allotted time > remains. I was never quite satisfied with the existing tools for this, > so I wrote my own and hpdfp is the result. > > Though I originally wrote it for my own use, the tool has matured over > time, and I now wish to share it with others. Aside from being a > useful tool, I think hpdfp is a good example of elegance and economy > in program design. Despite being only a thousand lines long, this > program is full of features that may not be obvious at first glance so > please be sure to look at the available help. > > Status > ====== > I've been using this tool in my own talks for over a year now, and > it is fairly stable and feature complete. I've only tested it on > Ubuntu so I don't know if it ports to other platforms. I'd love to > hear any field reports about how it runs on other platforms. > > Future Directions > ================= > I have a long TODO list of ideas I may implement in the future, but > most development has been driven by the practical considerations that > I discover as I use the tool. If you have a use case for a particular > feature, please let me know. > > ================ > > Feature requests, bug reports, suggestions or feedback as well as > contributions to the documentation or implementation are most welcome. > > Michael D. Adams > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From omeragacan at gmail.com Wed Nov 13 20:18:26 2013 From: omeragacan at gmail.com (=?ISO-8859-9?Q?=D6mer_Sinan_A=F0acan?=) Date: Wed, 13 Nov 2013 22:18:26 +0200 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: Anyone tried this same test on GHCJS? --- ?mer Sinan A?acan http://osa1.net 2013/11/13 Aycan iRiCAN : > church% hastec --version > 0.2.9 > > church% cat > Hello.hs > module Main where > main = print "Hello world." > > church% hastec --opt-google-closure --start=asap Hello.hs > Compiling Main into . > Linking Hello.js > Linking Main > Linking GHC.IO.Handle.Text > Linking Haste.Handle > Linking GHC.Tuple > Linking GHC.Types > Linking GHC.Show > Linking GHC.List > Linking GHC.Base > Linking GHC.IO > Running the Google Closure compiler on Hello.js... > > church% nodejs Hello.js > "Hello world." > > > Hello.js 5750 Bytes (46746 bytes without google closure). > > > > On Wed, Nov 13, 2013 at 3:56 PM, Anton Nikishaev wrote: >> >> ?mer Sinan A?acan writes: >> >> > That's great news. I wonder if that means it'll be end for Fay and >> > similar languages? >> >> GHCJS's Hello World is 2.1M worth of javascript (well, that's how it was >> several month ago, maybe it's better now?). And even google closure >> compiled with advanced optimizations it's ~500K. >> >> Fay's output is 5K after google-closure-mumbo-jumbo. >> >> >> >> > 2013/11/12 Patrick Mylund Nielsen : >> >> On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw >> >> wrote: >> >>> >> >>> On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan >> >>> >> >>> wrote: >> >>> > I'm aware of this, but when I first tried it a few months ago, it >> >>> > was >> >>> > not easy to use at all. Is it changed now? >> >>> >> >>> Last I heard, Luite was waiting for GHC 7.8 to be released because it >> >>> contains changes that will allow him to upload ghcjs to hackage and >> >>> then you will be able to just cabal install it. I could be wrong >> >>> though. >> >> >> >> >> >> As far as I know, that's correct. >> >> >> >> The easiest way to install and use it right now is using their Vagrant >> >> setup: >> >> >> >> http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun >> >> -- >> lelf >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > -- > http://www.google.com/profiles/iricanaycan > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From haskell at patrickmylund.com Wed Nov 13 20:22:11 2013 From: haskell at patrickmylund.com (Patrick Mylund Nielsen) Date: Wed, 13 Nov 2013 15:22:11 -0500 Subject: [Haskell-cafe] off-topic question: why invent new Haskell-like compile-to-js functional languages when we have awesome js_of_ocaml ? In-Reply-To: References: Message-ID: On Wed, Nov 13, 2013 at 3:18 PM, ?mer Sinan A?acan wrote: > Anyone tried this same test on GHCJS? I'm definitely interested in seeing the same, but for a recent version of GHCJS, too. Personally, I think Fay is great, size- and API-wise for when what you're making is a "script." When you're making a big/real application, I prefer a more complete API, and I find that the initial payload size is negligible in these cases. > 2013/11/13 Aycan iRiCAN : > > church% hastec --version > > 0.2.9 > > > > church% cat > Hello.hs > > module Main where > > main = print "Hello world." > > > > church% hastec --opt-google-closure --start=asap Hello.hs > > Compiling Main into . > > Linking Hello.js > > Linking Main > > Linking GHC.IO.Handle.Text > > Linking Haste.Handle > > Linking GHC.Tuple > > Linking GHC.Types > > Linking GHC.Show > > Linking GHC.List > > Linking GHC.Base > > Linking GHC.IO > > Running the Google Closure compiler on Hello.js... > > > > church% nodejs Hello.js > > "Hello world." > > > > > > Hello.js 5750 Bytes (46746 bytes without google closure). > > > > > > > > On Wed, Nov 13, 2013 at 3:56 PM, Anton Nikishaev wrote: > >> > >> ?mer Sinan A?acan writes: > >> > >> > That's great news. I wonder if that means it'll be end for Fay and > >> > similar languages? > >> > >> GHCJS's Hello World is 2.1M worth of javascript (well, that's how it was > >> several month ago, maybe it's better now?). And even google closure > >> compiled with advanced optimizations it's ~500K. > >> > >> Fay's output is 5K after google-closure-mumbo-jumbo. > >> > >> > >> > >> > 2013/11/12 Patrick Mylund Nielsen : > >> >> On Tue, Nov 12, 2013 at 12:24 PM, Jeremy Shaw > >> >> wrote: > >> >>> > >> >>> On Mon, Nov 11, 2013 at 1:32 PM, ?mer Sinan A?acan > >> >>> > >> >>> wrote: > >> >>> > I'm aware of this, but when I first tried it a few months ago, it > >> >>> > was > >> >>> > not easy to use at all. Is it changed now? > >> >>> > >> >>> Last I heard, Luite was waiting for GHC 7.8 to be released because > it > >> >>> contains changes that will allow him to upload ghcjs to hackage and > >> >>> then you will be able to just cabal install it. I could be wrong > >> >>> though. > >> >> > >> >> > >> >> As far as I know, that's correct. > >> >> > >> >> The easiest way to install and use it right now is using their > Vagrant > >> >> setup: > >> >> > >> >> > http://www.reddit.com/r/haskell/comments/1fvv5q/ghcjs_introduction_concurrent_haskell_in_the/caeifun > >> > >> -- > >> lelf > >> > >> > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > > > > > > -- > > http://www.google.com/profiles/iricanaycan > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From waldmann at imn.htwk-leipzig.de Wed Nov 13 22:47:19 2013 From: waldmann at imn.htwk-leipzig.de (Johannes Waldmann) Date: Wed, 13 Nov 2013 22:47:19 +0000 (UTC) Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 References: Message-ID: > ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 could you explain how you compile this? (what compiler, what version of base, etc.) For me, it does not work with ghc-7.6.3 (binary package) because gtk2hs does not work hackage version (0.12.4) does not work because of /tmp/gtk-0.12.4-7461/gtk-0.12.4/SetupWrapper.hs:94:45: Ambiguous occurrence `moreRecentFile' and darcs version (0.12.4.1) breaks with Graphics/UI/Gtk/Printing/PrintOperation.chs:409:6: Couldn't match expected type `Ptr ()' with actual type `Window' and it also does not work with ghc/fedora (distro package) 7.4.2 HaskellPdfPresenter.hs:901:10: Ambiguous occurrence `catch' It could refer to either `Prelude.catch', imported from `Prelude' at HaskellPdfPresenter.hs:1:1 (and originally defined in `System.IO.Error') or `Control.Exception.catch', - J.W. From mdmkolbe at gmail.com Thu Nov 14 08:14:12 2013 From: mdmkolbe at gmail.com (Michael D. Adams) Date: Thu, 14 Nov 2013 02:14:12 -0600 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: <5283D9C2.2070108@nh2.me> References: <5283D9C2.2070108@nh2.me> Message-ID: When the program is doing background rendering, it will go to 100% CPU time, but once the background rendering completes, it should settle down to almost no CPU usage at all (my task manager literally shows 0% CPU once pre-rending completes). Does this high CPU usage happen even when you don't load a PDF? After loading a PDF, there will be a small progress bar that races across the bottom of the presenter window. This represents the pre-rendering process. Does the CPU usage lower after that process completes? (If you need to run the experiment a few times, note that pressing Ctrl-R will flush the cache and re-trigger pre-rending.) If what you are seeing isn't just the background rendering, then the first place I would look is to see if the render thread is properly switching from renderThreadSoon (which burns up CPU) to renderThreadDelayed (which has a 100ms delay to avoid burning up CPU). You might also try changing the 100ms delay in renderThreadDelayed (HaskellPdfPresenter.hs line 932) to something larger like 1000ms. What operating system, compiler and package versions are you using? If you have any other clues, figure out what is going on, or if there is any way I can help you solve this, please let me know. On Wed, Nov 13, 2013 at 1:57 PM, Niklas Hamb?chen wrote: > That is great, I've been interested in that program since your POPL > talk. > > One problem I've had with it so far: > It takes 100% CPU time when idle, which makes my laptop go quite hot. > Any idea why that could be? > > On Wed 13 Nov 2013 18:16:48 GMT, Michael D. Adams wrote: >> ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 >> >> I'm pleased to announce the first public release of the Haskell Pdf >> Presenter (hpdfp). >> >> Project home page: >> http://michaeldadams.org/projects/haskell-pdf-presenter/ >> >> Project on Hackage: >> http://hackage.haskell.org/package/haskell-pdf-presenter/ >> >> Project repository: >> http://michaeldadams.org/repos-pub/hg/haskell-pdf-presenter/ >> >> What it is >> ========== >> The Haskell Pdf Presenter (hpdfp) is a tool for presenting PDF-based >> slide shows. For example, as a presenter, I like to see the next slide >> before it is shown to the audience as well as how much allotted time >> remains. I was never quite satisfied with the existing tools for this, >> so I wrote my own and hpdfp is the result. >> >> Though I originally wrote it for my own use, the tool has matured over >> time, and I now wish to share it with others. Aside from being a >> useful tool, I think hpdfp is a good example of elegance and economy >> in program design. Despite being only a thousand lines long, this >> program is full of features that may not be obvious at first glance so >> please be sure to look at the available help. >> >> Status >> ====== >> I've been using this tool in my own talks for over a year now, and >> it is fairly stable and feature complete. I've only tested it on >> Ubuntu so I don't know if it ports to other platforms. I'd love to >> hear any field reports about how it runs on other platforms. >> >> Future Directions >> ================= >> I have a long TODO list of ideas I may implement in the future, but >> most development has been driven by the practical considerations that >> I discover as I use the tool. If you have a use case for a particular >> feature, please let me know. >> >> ================ >> >> Feature requests, bug reports, suggestions or feedback as well as >> contributions to the documentation or implementation are most welcome. >> >> Michael D. Adams >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From mdmkolbe at gmail.com Thu Nov 14 08:29:00 2013 From: mdmkolbe at gmail.com (Michael D. Adams) Date: Thu, 14 Nov 2013 02:29:00 -0600 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: References: Message-ID: I am compiling with GHC 7.6.1 (Ubuntu), Base 4.6.0.0, Cabal 1.16, glib 0.12.4, poppler 0.12.2.2, gtk 0.12.4, cairo 0.12.4 (all from Hackage). The Hackage version of glib, etc. do not work with Cabal 1.18 due it adding 'moreRecentFile' to the API. However, it does seem to work if you downgrade the Cabal package to 1.16. It is any easy fix to rename the function to avoid the conflict, so I'm not sure why the package maintainers for glib, etc. haven't already done that. If you make the following change does hpdfp build with ghc/fedora (distro package) 7.4.2? (If so, I'll upload a new version of the package with the patch.) --- a/HaskellPdfPresenter.hs Wed Nov 13 12:11:26 2013 -0600 +++ b/HaskellPdfPresenter.hs Thu Nov 14 02:22:57 2013 -0600 @@ -898,7 +898,7 @@ -- Load a new PDF document openDoc state uri = do - doc <- catch (documentNewFromFile uri Nothing) + doc <- Control.Exception.catch (documentNewFromFile uri Nothing) -- Explicit modules to avoid ambiguity in GHC 7.4 (\x -> errorDialog ("Error opening \"" ++ uri ++ "\": " ++ show (x :: GError)) >> return Nothing) case doc of Nothing -> errorDialog ("Unknown error opening \"" ++ uri ++ "\"") >> return True On Wed, Nov 13, 2013 at 4:47 PM, Johannes Waldmann wrote: > >> ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 > > could you explain how you compile this? > (what compiler, what version of base, etc.) > > For me, it does not work with ghc-7.6.3 (binary package) > because gtk2hs does not work > hackage version (0.12.4) does not work because of > /tmp/gtk-0.12.4-7461/gtk-0.12.4/SetupWrapper.hs:94:45: > Ambiguous occurrence `moreRecentFile' > and darcs version (0.12.4.1) breaks with > Graphics/UI/Gtk/Printing/PrintOperation.chs:409:6: > Couldn't match expected type `Ptr ()' with actual type `Window' > > and it also does not work with ghc/fedora (distro package) 7.4.2 > HaskellPdfPresenter.hs:901:10: > Ambiguous occurrence `catch' > It could refer to either `Prelude.catch', > imported from `Prelude' at > HaskellPdfPresenter.hs:1:1 > (and originally defined in `System.IO.Error') > or `Control.Exception.catch', > > - J.W. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From jv at informatik.uni-bonn.de Thu Nov 14 08:33:44 2013 From: jv at informatik.uni-bonn.de (Janis Voigtlaender) Date: Thu, 14 Nov 2013 09:33:44 +0100 Subject: [Haskell-cafe] ANNOUNCE: Haskell Communities and Activities Report (25th ed., November 2013) Message-ID: <52848AE8.5040204@informatik.uni-bonn.de> On behalf of all the contributors, we are pleased to announce that the Haskell Communities and Activities Report (25th edition, November 2013) is now available, in PDF and HTML formats: http://haskell.org/communities/11-2013/report.pdf http://haskell.org/communities/11-2013/html/report.html Many thanks go to all the people that contributed to this report, both directly, by sending in descriptions, and indirectly, by doing all the interesting things that are reported. We hope you will find it as interesting a read as we did. If you have not encountered the Haskell Communities and Activities Reports before, you may like to know that the first of these reports was published in November 2001. Their goal is to improve the communication between the increasingly diverse groups, projects, and individuals working on, with, or inspired by Haskell. The idea behind these reports is simple: Every six months, a call goes out to all of you enjoying Haskell to contribute brief summaries of your own area of work. Many of you respond (eagerly, unprompted, and sometimes in time for the actual deadline) to the call. The editors collect all the contributions into a single report and feed that back to the community. When we try for the next update, six months from now, you might want to report on your own work, project, research area or group as well. So, please put the following into your diaries now: ======================================== End of April 2014: target deadline for contributions to the May 2014 edition of the HC&A Report ======================================== Unfortunately, many Haskellers working on interesting projects are so busy with their work that they seem to have lost the time to follow the Haskell related mailing lists and newsgroups, and have trouble even finding time to report on their work. If you are a member, user or friend of a project so burdened, please find someone willing to make time to report and ask them to "register" with the editors for a simple e-mail reminder in October (you could point us to them as well, and we can then politely ask if they want to contribute, but it might work better if you do the initial asking). Of course, they will still have to find the ten to fifteen minutes to draw up their report, but maybe we can increase our coverage of all that is going on in the community. Feel free to circulate this announcement further in order to reach people who might otherwise not see it. Enjoy! Mihai Maruseac and Janis Voigtlaender From hc at j4.pe Thu Nov 14 10:22:54 2013 From: hc at j4.pe (hc at j4.pe) Date: Thu, 14 Nov 2013 11:22:54 +0100 Subject: [Haskell-cafe] Aeson js question Message-ID: Hello everyone, I'd use aeson to parse JSON. I did much of the translation JSon in Haskell data but I'm stuck on one point. Suppose I have a JSon object that is in this form: {\"Ports\":{\"22/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"80/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]} I do not know how to "bind" the key name and value knowing that the key changes name "randomly". Example with port 21 and port 8888: {\"Ports\":{\"21/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"8888/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]}} All code : http://lpaste.net/95607 Thank you for your help. From vlatko.basic at gmail.com Thu Nov 14 10:33:15 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Thu, 14 Nov 2013 11:33:15 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> Message-ID: <5284A6EB.6080903@gmail.com> An HTML attachment was scrubbed... URL: From daniel.trstenjak at gmail.com Thu Nov 14 11:08:25 2013 From: daniel.trstenjak at gmail.com (Daniel Trstenjak) Date: Thu, 14 Nov 2013 12:08:25 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5284A6EB.6080903@gmail.com> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> Message-ID: <20131114110825.GA6796@machine> Hi Vlatko, On Thu, Nov 14, 2013 at 11:33:15AM +0100, Vlatko Basic wrote: > Yes, sometimes I still have the feeling I'm not thinking fully Haskellish. > Maybe it's time form me to re-read about the type system. > > Can you recommend any resources that helped you in better understanding? Did you understand what Brandon said, that 'a' has to be a 'String', because it's compared by an other string with '==' and the operator '==' demands, that both arguments have the same type? If you try to write the same function in C++ (the same may hold for Java Generics): template bool f(A a) { return a == "x"; } Than the C++ compiler would happily read this function and wouldn't complain in any way. Only if you would use this function with a type that isn't comparable with a string, than it would complain. The problem with the C++ way is, that the function isn't telling you in any way the constraints of type 'A', only if you're using a type that doesn't fulfill all constraints, than the compiler will tell you that with some very indirect error messages. Haskell is very explicit about the constraints, you have to explicitly declare all the constraints of your type. So looking at the function 'f': f :: a -> Bool f a = let b = "x" in a == b The first thing is the usage of '==', which is an operator of the type class 'Eq', so only types having an instance of 'Eq' are allowed: f :: Eq a => a -> Bool f a = let b = "x" in a == b But you're comparing the 'a' against a variable of type 'String' and because the type of '==' is 'a -> a -> Bool' the type of 'a' also has to be 'String'. f :: String -> Bool f a = let b = "x" in a == b Greetings, Daniel From vlatko.basic at gmail.com Thu Nov 14 11:14:41 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Thu, 14 Nov 2013 12:14:41 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <20131114110825.GA6796@machine> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> <20131114110825.GA6796@machine> Message-ID: <5284B0A1.6030600@gmail.com> Hi Daniel, Yes, I do understand all that. :-) The function is the most trivial example to show my confusion with the word rigid, not the error itself. I had a feeling Brandon was talking about some important differences in the way of thinking. vlatko -------- Original Message -------- Subject: Re: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." From: Daniel Trstenjak To: haskell-cafe at haskell.org Date: 14.11.2013 12:08 > > Hi Vlatko, > > On Thu, Nov 14, 2013 at 11:33:15AM +0100, Vlatko Basic wrote: >> Yes, sometimes I still have the feeling I'm not thinking fully Haskellish. >> Maybe it's time form me to re-read about the type system. >> >> Can you recommend any resources that helped you in better understanding? > > Did you understand what Brandon said, that 'a' has to be a 'String', > because it's compared by an other string with '==' and the operator > '==' demands, that both arguments have the same type? > > > If you try to write the same function in C++ (the same may hold for Java Generics): > > template > bool f(A a) { return a == "x"; } > > > Than the C++ compiler would happily read this function and wouldn't > complain in any way. Only if you would use this function with a type > that isn't comparable with a string, than it would complain. > > > The problem with the C++ way is, that the function isn't telling you in > any way the constraints of type 'A', only if you're using a type that > doesn't fulfill all constraints, than the compiler will tell you that with > some very indirect error messages. > > > Haskell is very explicit about the constraints, you have to explicitly > declare all the constraints of your type. > > > So looking at the function 'f': > > f :: a -> Bool > f a = let b = "x" in a == b > > > The first thing is the usage of '==', which is an operator of the > type class 'Eq', so only types having an instance of 'Eq' are allowed: > > f :: Eq a => a -> Bool > f a = let b = "x" in a == b > > > But you're comparing the 'a' against a variable of type 'String' and > because the type of '==' is 'a -> a -> Bool' the type of 'a' also has > to be 'String'. > > f :: String -> Bool > f a = let b = "x" in a == b > > > Greetings, > Daniel > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From org.haskell at miguel.ramos.name Thu Nov 14 12:03:49 2013 From: org.haskell at miguel.ramos.name (Miguel Ramos) Date: Thu, 14 Nov 2013 12:03:49 +0000 Subject: [Haskell-cafe] Tool for visualisation of graph reduction step by step Message-ID: <1384430629.2431.12.camel@w500.local> Hello, It has already been asked for on this list, and I think one does not exist, however: (a) Does anyone know of a tool for the stepwise visualisation of graph reduction? I am aware that it could only be used for minimal examples and that the output would be a bit implementation-specific. My interest is not debugging, but simply producing presentation slides. (b) What tools do people use for plotting static program graphs, such as those in books, papers and slides? I am currently using graphviz (dot) but I am not being able to tame it to make the graphs look good and proper for papers and slides. I also have a minimal interpreter, which can currently output each step to graphviz, but it still does not handle enough of the language to be usable and I don't want to divert the focus of my work. Thank you very much, Miguel Lopes Santos Ramos From shumovichy at gmail.com Thu Nov 14 12:39:19 2013 From: shumovichy at gmail.com (Yuras Shumovich) Date: Thu, 14 Nov 2013 15:39:19 +0300 Subject: [Haskell-cafe] Aeson js question In-Reply-To: References: Message-ID: <1384432759.4285.4.camel@shum-lt> Hi, The "ContainerNetworkSettingsPorts" should actually be a "Data.Map String ContainerNetworkSettingsPort" data ContainerNetworkSettingsPort = ContainerNetworkSettingsPort { HostIp :: String, HostPort :: String } type ContainerNetworkSettingsPorts = Map String ContainerNetworkSettingsPort You can reuse instance FromJSON a => FromJSON (Map String a) Thanks, Yuras On Thu, 2013-11-14 at 11:22 +0100, hc at j4.pe wrote: > Hello everyone, > > I'd use aeson to parse JSON. I did much of the translation JSon in > Haskell data but I'm stuck on one point. > > Suppose I have a JSon object that is in this form: > > {\"Ports\":{\"22/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"80/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]} > > I do not know how to "bind" the key name and value knowing that the > key changes name "randomly". Example with port 21 and port 8888: > > {\"Ports\":{\"21/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"8888/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]}} > > All code : http://lpaste.net/95607 > > Thank you for your help. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From allbery.b at gmail.com Thu Nov 14 14:17:20 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Thu, 14 Nov 2013 09:17:20 -0500 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5284A6EB.6080903@gmail.com> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> Message-ID: On Thu, Nov 14, 2013 at 5:33 AM, Vlatko Basic wrote: > -- You will need to let go of that "flexible" ... > > Yes, sometimes I still have the feeling I'm not thinking fully Haskellish. > Maybe it's time form me to re-read about the type system. > I hinted at it in my follow-up message. Beginners often see that unadorned "a" and think that that means it can be "anything" and hence "flexible" --- but in fact it's "caller determined" and that *you can't do anything at all with it*. It's not flexible, it's a featureless black box you can't see inside or affect in any way. Your only options are ignore it or hand it off to something else. To give an example of why that kind of thing can be useful, consider the map function: map :: (a -> b) -> [a] -> [b] `map` itself can do nothing with `a` (or `b`). But it has also been given a function which *can* do something. Moreover, just from the type, you can work out exactly what that something must be! (Ignoring nontermination, which basically means that we're ignoring "cheating" by throwing an exception or etc.) There is certainly flexibility here --- but that flexibility is not in the type system. To the type system, `a` and `b` are rigid, featureless boxes. But this lack of flexibility at the type level gives you flexibility at a different level, and at the same time gives you a guarantee: the type system won't let any implementation of `map` go behind your back and make changes to `a` or `b`, the only thing it's allowed to do it use the function you passed it. And in fact it only permits one sensible interpretation, which you can determine just from the type signature. > Can you recommend any resources that helped you in better understanding? > Not really, since I came at it somewhat "sideways". (In particular, I had already encountered functional programming via Lisp/Scheme and APL/J, and strong typing from exposure to SML.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From twey at twey.co.uk Thu Nov 14 14:39:22 2013 From: twey at twey.co.uk (=?UTF-8?Q?James_=E2=80=98Twey=E2=80=99_Kay?=) Date: Thu, 14 Nov 2013 14:39:22 +0000 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <5284A6EB.6080903@gmail.com> References: "<5283AACD.40300@gmail.com> " <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> Message-ID: On 2013-11-14 10:33, Vlatko Basic wrote: > Can you recommend any resources that helped you in better > understanding? I generally find it easier to think in terms of type functions: a type function is a function that takes a type and returns a type, written perhaps ?a ? E (where a is a type, and bound in E). The type of a Haskell function with a type variable a is a type function whose parameter just happens to be automatically filled in by the type checker at the call site: id ? ?a ? a ? a id _ x = x That makes it quite clear (to me, at least) where the type gets passed in. It's also pretty similar to a Java generic, which just has slightly different syntax for the type parameter: A id(A x) { return x; } In Java, you'd call that function (if I remember my Java syntax correctly) like id(3); the Haskell-with-type-functions version looks the same, except perhaps without the pointy brackets: id Integer 0 where id Integer ? Integer ? Integer id Char ? Char ? Char id (Either Char Bool) ? Either Char Bool ? Either Char Bool et cetera. HTH, ? Twey From mail at nh2.me Thu Nov 14 14:51:27 2013 From: mail at nh2.me (=?ISO-8859-1?Q?Niklas_Hamb=FCchen?=) Date: Thu, 14 Nov 2013 14:51:27 +0000 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: References: <5283D9C2.2070108@nh2.me> Message-ID: <5284E36F.3080200@nh2.me> On 14/11/13 08:14, Michael D. Adams wrote: > When the program is doing background rendering, it will go to 100% CPU > time, but once the background rendering completes, it should settle > down to almost no CPU usage at all (my task manager literally shows 0% > CPU once pre-rending completes). > > Does this high CPU usage happen even when you don't load a PDF? > > After loading a PDF, there will be a small progress bar that races > across the bottom of the presenter window. This represents the > pre-rendering process. Does the CPU usage lower after that process > completes? (If you need to run the experiment a few times, note that > pressing Ctrl-R will flush the cache and re-trigger pre-rending.) You are right, it is the background rendering. I accidentally re-triggered it multiple times by re-sizing the window. Thanks for your explanation! From mail at nh2.me Thu Nov 14 14:52:27 2013 From: mail at nh2.me (=?ISO-8859-1?Q?Niklas_Hamb=FCchen?=) Date: Thu, 14 Nov 2013 14:52:27 +0000 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: References: Message-ID: <5284E3AB.7000504@nh2.me> On 13/11/13 22:47, Johannes Waldmann wrote: > >> ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 > > could you explain how you compile this? > (what compiler, what version of base, etc.) I managed to install it with a plain `cabal install`. I used the GHC binaries from the web site and no Haskell Platform installed. From evohunz at gmail.com Thu Nov 14 15:02:29 2013 From: evohunz at gmail.com (Thiago Negri) Date: Thu, 14 Nov 2013 13:02:29 -0200 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> Message-ID: > Can you recommend any resources that helped you in better understanding? If you really like type theory, you may want to take at look at Types and Programming Languages by Benjamin C. Pierce. It goes from very simple concepts and builds up, getting into Typed Lambda Calculus and type systems for O.O. languages, for example. http://www.cis.upenn.edu/~bcpierce/tapl/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From waldmann at imn.htwk-leipzig.de Thu Nov 14 15:11:00 2013 From: waldmann at imn.htwk-leipzig.de (Johannes Waldmann) Date: Thu, 14 Nov 2013 15:11:00 +0000 (UTC) Subject: [Haskell-cafe] =?utf-8?q?Tool_for_visualisation_of_graph_reductio?= =?utf-8?q?n_step_by=09step?= References: <1384430629.2431.12.camel@w500.local> Message-ID: Miguel Ramos miguel.ramos.name> writes: > tool for the stepwise visualisation of graph reduction? I'm pretty sure the Graph Transformation community has lots. A typical venue is http://www.informatik.uni-bremen.de/icgt2012/ - J.W. From stephen.tetley at gmail.com Thu Nov 14 16:59:31 2013 From: stephen.tetley at gmail.com (Stephen Tetley) Date: Thu, 14 Nov 2013 16:59:31 +0000 Subject: [Haskell-cafe] Tool for visualisation of graph reduction step by step Message-ID: On 14 November 2013 12:03, Miguel Ramos wrote: > > (b) What tools do people use for plotting static program graphs, such as > those in books, papers and slides? Graphviz can be tamed somewhat with ranking - see the examples in the manual. If you want pretty, hand coded graphs then TikZ is a handsome option. It has the obvious edges with or without arrowheads, but also the "anchor" abstraction which is a very neat way of placing edges. From hc at j4.pe Thu Nov 14 18:38:44 2013 From: hc at j4.pe (hc at j4.pe) Date: Thu, 14 Nov 2013 19:38:44 +0100 Subject: [Haskell-cafe] Aeson js question In-Reply-To: <1384432759.4285.4.camel@shum-lt> References: <1384432759.4285.4.camel@shum-lt> Message-ID: Hello, Thank you for your reply. It really helped me. I mixed response to this post and this one: http://stackoverflow.com/questions/17278472/arbitrary-json-keys-with-aeson-haskell Now it works for those who are interested here is the example: http://lpaste.net/95671 regards 2013/11/14 Yuras Shumovich : > Hi, > > The "ContainerNetworkSettingsPorts" should actually be a "Data.Map > String ContainerNetworkSettingsPort" > > data ContainerNetworkSettingsPort = ContainerNetworkSettingsPort { > HostIp :: String, > HostPort :: String > } > > type ContainerNetworkSettingsPorts = Map String ContainerNetworkSettingsPort > > You can reuse instance FromJSON a => FromJSON (Map String a) > > Thanks, > Yuras > > On Thu, 2013-11-14 at 11:22 +0100, hc at j4.pe wrote: >> Hello everyone, >> >> I'd use aeson to parse JSON. I did much of the translation JSon in >> Haskell data but I'm stuck on one point. >> >> Suppose I have a JSon object that is in this form: >> >> {\"Ports\":{\"22/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"80/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]} >> >> I do not know how to "bind" the key name and value knowing that the >> key changes name "randomly". Example with port 21 and port 8888: >> >> {\"Ports\":{\"21/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49154\"}],\"8888/tcp\":[{\"HostIp\":\"0.0.0.0\",\"HostPort\":\"49155\"}]}} >> >> All code : http://lpaste.net/95607 >> >> Thank you for your help. >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From vlatko.basic at gmail.com Thu Nov 14 19:10:16 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Thu, 14 Nov 2013 20:10:16 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> Message-ID: <52852018.6040504@gmail.com> An HTML attachment was scrubbed... URL: From ky3 at atamo.com Thu Nov 14 19:54:20 2013 From: ky3 at atamo.com (Kim-Ee Yeoh) Date: Fri, 15 Nov 2013 02:54:20 +0700 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: <52852018.6040504@gmail.com> References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> <52852018.6040504@gmail.com> Message-ID: On Fri, Nov 15, 2013 at 2:10 AM, Vlatko Basic wrote: > I think I understand now why compiler calls it rigid and not "flexible" or > whatever. > It is because the call site defines the parameter type, and when that > parameter comes to function, its type is already rigidly determined. We > just do not know its type. So the type is rigidly unknown, and not flexible. > Counterexample: id2 :: a -> a id2 = id . id You're getting closer, but if you think of it from the viewpoint of the programmer who wrote the compiler (the same one who's wording all these error messages), it becomes really clear. What you've basically got before you is an algorithm to check the validity of types. So whereas the thing in question (whatever's denoted by 'a') is called a type 'variable', it doesn't 'vary' in (I'm guessing) the OO way. When checking the types in your function, 'a' is fixed, i.e. made rigid, by what's known as a 'universal quantification'. So when you code up the type checking algorithm, you'd see a crystal-clear similarity to treating 'a' as if it were a monotype like Bool or String. When checking the types in _uses_ of your function (say, something similar to 'id True') _that's_ when 'a' varies, i.e. in the sense that each use may fix 'a' to something different. Overall, I think you're doing really well for someone groping with Haskell general and its type system in particular. The lingo can be misleading. Personally, I think a lot can be made to fill the gap between trial-and-discovery and reading notationally-heavy formal texts like conf papers and textbooks (Pierce's TAPL). -- Kim-Ee -------------- next part -------------- An HTML attachment was scrubbed... URL: From mdmkolbe at gmail.com Fri Nov 15 07:59:00 2013 From: mdmkolbe at gmail.com (Michael D. Adams) Date: Fri, 15 Nov 2013 01:59:00 -0600 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: <5284E3AB.7000504@nh2.me> References: <5284E3AB.7000504@nh2.me> Message-ID: Apparently the following command gets around these build problems (provided of course that you have Cabal 1.16 installed). cabal install --cabal-lib-version=1.16.0 poppler I haven't tested it personally, but thought I'd pass it on. On Thu, Nov 14, 2013 at 8:52 AM, Niklas Hamb?chen wrote: > On 13/11/13 22:47, Johannes Waldmann wrote: >> >>> ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 >> >> could you explain how you compile this? >> (what compiler, what version of base, etc.) > > I managed to install it with a plain `cabal install`. > I used the GHC binaries from the web site and no Haskell Platform installed. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From mdmkolbe at gmail.com Fri Nov 15 08:21:03 2013 From: mdmkolbe at gmail.com (Michael D. Adams) Date: Fri, 15 Nov 2013 02:21:03 -0600 Subject: [Haskell-cafe] ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 In-Reply-To: References: Message-ID: I have published a new version (0.2.3) to Hackage that should fix this build error. On Thu, Nov 14, 2013 at 2:29 AM, Michael D. Adams wrote: > I am compiling with GHC 7.6.1 (Ubuntu), Base 4.6.0.0, Cabal 1.16, glib > 0.12.4, poppler 0.12.2.2, gtk 0.12.4, cairo 0.12.4 (all from Hackage). > > The Hackage version of glib, etc. do not work with Cabal 1.18 due it > adding 'moreRecentFile' to the API. However, it does seem to work if > you downgrade the Cabal package to 1.16. It is any easy fix to rename > the function to avoid the conflict, so I'm not sure why the package > maintainers for glib, etc. haven't already done that. > > If you make the following change does hpdfp build with ghc/fedora > (distro package) 7.4.2? (If so, I'll upload a new version of the > package with the patch.) > > --- a/HaskellPdfPresenter.hs Wed Nov 13 12:11:26 2013 -0600 > +++ b/HaskellPdfPresenter.hs Thu Nov 14 02:22:57 2013 -0600 > @@ -898,7 +898,7 @@ > > -- Load a new PDF document > openDoc state uri = do > - doc <- catch (documentNewFromFile uri Nothing) > + doc <- Control.Exception.catch (documentNewFromFile uri Nothing) -- > Explicit modules to avoid ambiguity in GHC 7.4 > (\x -> errorDialog ("Error opening \"" ++ uri ++ "\": " ++ > show (x :: GError)) >> return Nothing) > case doc of > Nothing -> errorDialog ("Unknown error opening \"" ++ uri ++ > "\"") >> return True > > On Wed, Nov 13, 2013 at 4:47 PM, Johannes Waldmann > wrote: >> >>> ANNOUNCE: Haskell Pdf Presenter (hpdfp) 0.2.2 >> >> could you explain how you compile this? >> (what compiler, what version of base, etc.) >> >> For me, it does not work with ghc-7.6.3 (binary package) >> because gtk2hs does not work >> hackage version (0.12.4) does not work because of >> /tmp/gtk-0.12.4-7461/gtk-0.12.4/SetupWrapper.hs:94:45: >> Ambiguous occurrence `moreRecentFile' >> and darcs version (0.12.4.1) breaks with >> Graphics/UI/Gtk/Printing/PrintOperation.chs:409:6: >> Couldn't match expected type `Ptr ()' with actual type `Window' >> >> and it also does not work with ghc/fedora (distro package) 7.4.2 >> HaskellPdfPresenter.hs:901:10: >> Ambiguous occurrence `catch' >> It could refer to either `Prelude.catch', >> imported from `Prelude' at >> HaskellPdfPresenter.hs:1:1 >> (and originally defined in `System.IO.Error') >> or `Control.Exception.catch', >> >> - J.W. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe From k.bleijenberg at lijbrandt.nl Fri Nov 15 08:39:06 2013 From: k.bleijenberg at lijbrandt.nl (Kees Bleijenberg) Date: Fri, 15 Nov 2013 09:39:06 +0100 Subject: [Haskell-cafe] how to call a callback in a haskell dll Message-ID: <000001cee1de$25630a00$70291e00$@bleijenberg@lijbrandt.nl> My program creates a Windows dll. The calling program calls a function with strings as parameters. Works fine. I want to add a extra parameter. This extra parameter is a callback: a function Int -> Int: stdcall. In Haskell I want to call this function. So I have to convert the pointer to a (formal) Haskell function. In the examples for the FFI, Haskell provides the callback. I need an example or documentation. Kees -------------- next part -------------- An HTML attachment was scrubbed... URL: From vlatko.basic at gmail.com Fri Nov 15 09:50:26 2013 From: vlatko.basic at gmail.com (Vlatko Basic) Date: Fri, 15 Nov 2013 10:50:26 +0100 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> <52852018.6040504@gmail.com> Message-ID: <5285EE62.9070709@gmail.com> An HTML attachment was scrubbed... URL: From horstmey at Mathematik.Uni-Marburg.de Fri Nov 15 11:45:03 2013 From: horstmey at Mathematik.Uni-Marburg.de (Thomas Horstmeyer) Date: Fri, 15 Nov 2013 12:45:03 +0100 Subject: [Haskell-cafe] Tool for visualisation of graph reduction step by step In-Reply-To: References: Message-ID: <5286093F.6060004@informatik.uni-marburg.de> Am 14.11.2013 17:59, schrieb Stephen Tetley: > > If you want pretty, hand coded graphs then TikZ is a handsome option. > It has the obvious edges with or without arrowheads, but also the > "anchor" abstraction which is a very neat way of placing edges. > That is my preferred way as well. I often use it through the package tkz-graph which makes defining graphs easy. [1] http://www.ctan.org/tex-archive/macros/latex/contrib/tkz/tkz-graph From org.haskell at miguel.ramos.name Fri Nov 15 15:08:48 2013 From: org.haskell at miguel.ramos.name (Miguel Ramos) Date: Fri, 15 Nov 2013 15:08:48 +0000 Subject: [Haskell-cafe] Tool for visualisation of graph reduction step by step In-Reply-To: References: Message-ID: <1384528128.807.22.camel@w500.local> Qui, 2013-11-14 ?s 16:59 +0000, Stephen Tetley escreveu: > On 14 November 2013 12:03, Miguel Ramos wrote: > > > > > (b) What tools do people use for plotting static program graphs, such as > > those in books, papers and slides? > > > Graphviz can be tamed somewhat with ranking - see the examples in the manual. Thanks, I've already conquered rank. For this kind of graph, mostly tree-like, I find useful to let dot infer rank from edges, except for those few edges which form cycles, where I use [ constraint = 0 ] so that a rank constraint is not introduced for them. To whom it may interest, my best is (distilled): digraph G { graph [ splines = polyline ]; node [ ordering = out, shape = plaintext ]; edge [ arrowhead = none, headport = n ]; a0 [ label = "@", root = 1 ]; a0 -> a1; a1 [ label = "@" ]; a1 -> a2; a2 [ label = take ]; a1 -> a3; a3 [ label = 5 ]; a0 -> a4; a4 [ label = "\"Desmond\"" ]; b0 [ label = "@", root = 1, xlabel = "$" ]; b0 -> b1; b1 [ label = f ]; b0:se -> b0 [ constraint = 0, arrowhead = normal ]; // back edge is special } ... and this leaves a lot to be desired, and for my purpose, invisible nodes or edges beat the purpose of specifying only the structure of the graph, instead of computing its appearance. I'm almost giving up with graphviz. > > If you want pretty, hand coded graphs then TikZ is a handsome option. > It has the obvious edges with or without arrowheads, but also the > "anchor" abstraction which is a very neat way of placing edges. Thanks, I didn't know TikZ, only PSTricks. I fear a bit having to compute edge paths by hand... However, it is true that an approach such as that provides good re-use and will be easier for repetitive graphs, better than graphviz, which does not have abstraction. Thank you, M.R. From org.haskell at miguel.ramos.name Fri Nov 15 15:13:02 2013 From: org.haskell at miguel.ramos.name (Miguel Ramos) Date: Fri, 15 Nov 2013 15:13:02 +0000 Subject: [Haskell-cafe] Tool for visualisation of graph reduction step by step In-Reply-To: References: <1384430629.2431.12.camel@w500.local> Message-ID: <1384528382.807.26.camel@w500.local> Qui, 2013-11-14 ?s 15:11 +0000, Johannes Waldmann escreveu: > Miguel Ramos miguel.ramos.name> writes: > > > tool for the stepwise visualisation of graph reduction? > > I'm pretty sure the Graph Transformation community has lots. > A typical venue is http://www.informatik.uni-bremen.de/icgt2012/ > > - J.W. Thanks, your tip made me find the following two: - Porgy, a bit too interactive for what I want, but interesting - Anagopos, seems to be perfect for big graphs in 3D, I'll probably use this latter on for more complex graphs. Greetings, M.R. From donn at avvanta.com Fri Nov 15 18:05:16 2013 From: donn at avvanta.com (Donn Cave) Date: Fri, 15 Nov 2013 10:05:16 -0800 (PST) Subject: [Haskell-cafe] how to call a callback in a haskell dll In-Reply-To: <000001cee1de$25630a00$70291e00$@bleijenberg@lijbrandt.nl> References: <000001cee1de$25630a00$70291e00$@bleijenberg@lijbrandt.nl> Message-ID: <20131115180516.EE4B9F3942@mail.avvanta.com> Quoth "Kees Bleijenberg" , > My program creates a Windows dll. The calling program calls a function with > strings as parameters. Works fine. > > I want to add a extra parameter. This extra parameter is a callback: a > function Int -> Int: stdcall. In Haskell I want to call this function. So I > have to convert the pointer to a (formal) Haskell function. > > In the examples for the FFI, Haskell provides the callback. I need an > example or documentation. It's unclear to me whether the Haskell program initially chooses the function and creates a pointer to it, or that happens in C/C++. In the former case, I think Foreign.StablePtr serves that purpose. In the latter case, Haskell will receive the function as something like FunPtr (CInt -> CInt), and you need a "dynamic" foreign function to convert the pointer, like foreign import ccall "dynamic" iiPtrStub :: FunPtr (CInt -> CInt) -> (CInt -> CInt) That's lightly documented in the library docs under Foreign.Ptr. Donn From trebla at vex.net Fri Nov 15 22:25:59 2013 From: trebla at vex.net (Albert Y. C. Lai) Date: Fri, 15 Nov 2013 17:25:59 -0500 Subject: [Haskell-cafe] Word rigid in "`a' is a rigid type variable..." In-Reply-To: References: <5283AACD.40300@gmail.com> <5283B5D9.8030309@gmail.com> <5284A6EB.6080903@gmail.com> Message-ID: <52869F77.90404@vex.net> "It could be any type" has always been a truism. It has never been an issue of contention. The issue has always been "but who gets to choose". Teachers and tutorial writers still don't address that up front and head on; they spend 99 minutes harping on "any", watch students fail, and finally spend 1 minute to reveal "but you don't choose". As opposed to revealing that in the 1st minute so everyone can save the other 99 minutes. Perhaps they think that it is obvious to themselves, and need not be said to students. Perhaps they need to ensure a certain high variance in student marks. Less flexibility for the provider equals more flexibility for the user. Less cavalier power for the writer equals more predictive power for the reader. Cavalier power has previously been known as convenience, flexibility, and expressive power, for the writer; extreme examples include self-modifying code and performing list operations on complex numbers (let us call that type cavalierism, so that we have a judgmental name for the antithesis to type safety); mild examples include type-case and allowing effects everywhere. Programming is a dialectic class struggle between the user and the provider, between the reader and the writer. Given the type signature f :: a -> Bool and the restriction of "no type-case" and "no effect" such as in Haskell, if a simple test results in f () = True, then I know f 5 = True, f "hello" = True, universally f x = True. I need just one test case, f (), to complement the type. This is from the free theorems that Phil Wadler talks about in the article "theorems for free!". Perhaps f is a useless function. Here is a useful function: dpc :: a -> [a] If a simple test results in dpc () = [(), (), ()], then I know dpc x = [x, x, x] universally. replicate 3 is, certainly, a useful function, at least for glue code. And it is important to know that I will not be trolled by "you get a list of 4 if the type is Double, and you get random numbers in the list if the type is Int". The writer's loss of cavalier power is my gain of predictive power. Your freedom is my slavery. Your ignorance is my strength. Your war is my peace. Customers who like this article may also like the following from the same author: http://www.vex.net/~trebla/weblog/any-all-some.html http://www.vex.net/~trebla/haskell/prerequisite.xhtml#leibniz and this talk (50 minutes) from another author: http://www.youtube.com/watch?v=TS1lpKBMkgg From agocorona at gmail.com Sat Nov 16 12:38:53 2013 From: agocorona at gmail.com (Alberto G. Corona ) Date: Sat, 16 Nov 2013 13:38:53 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: <9da4a3d9-9918-43ab-ad04-563181e527ee@googlegroups.com> <87li0v2qf1.fsf@wespe.malde.org> Message-ID: I use Leksah, that provides much of the things mentioned here except perhaps hLint integration. Another nice feature is that it can rebuild the tree of project dependencies when something changes. 2013/11/12 m00nlight > The haskell-mode 13.7 of Emacs will eat all the cpu resource on my > computer when I configure the > indent of haskell mode. Does any one encounter the same issue ? > > > > -- > -- > Best Regards > From Emacs Like Excellent Browser: Conkeror > > At 2013-11-12 00:53:52,"Thanatos xiao" wrote: > > I use emacs + haskell-mode and some plugs developing in emacs > very useful! > > > 2013/11/11 Ketil Malde > >> >> > Emacs + haskell-mode gives you: >> >> [lots of goodies I need to learn more about] >> >> > You can do continuous compilation using emacs fly-mode. >> >> After starting to use ghc-mod, I never looked back. Having trouble >> spots being automatically highlighted is really a huge improvement over >> the old write-compile-debug cycle. Other benefits, like automatic type >> signature insertion is also nice, of course. >> >> (I haven't really tried anything else, so perhaps this is standard fare >> these days. Just wanted to voice my appreciation, I guess :-) >> >> -k >> -- >> If I haven't seen further, it is by standing in the footprints of giants >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > > > <#1424a223dde85978_> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Alberto. -------------- next part -------------- An HTML attachment was scrubbed... URL: From Vaniax at gmx.de Sun Nov 17 22:42:25 2013 From: Vaniax at gmx.de (Vaniax) Date: Sun, 17 Nov 2013 23:42:25 +0100 Subject: [Haskell-cafe] Error cabal update: "Unsucessful HTTP code: 404" Message-ID: <52894651.7070804@gmx.de> Hi, I have a big problem with a fresh installation of the Haskell-Platform 2013.2 on Windows 7. When I try to run `cabal update` I get the following error message: "|Downloading the latest package list from hackage.haskell.org cabal: Failed to download http://hackage.haskell.org/packages/archive/00-index.tar.gz : ErrorMisc "Unsucessful HTTP code: 404" When I try ||`wget http://hackage.haskell.org/packages/archive/00-index.tar.gz`everything works alright. I'm using no proxies or something like that. Maybe someone know whats going wrong? A parallel Windows-XP installation of the platform works fine. Vaniax | -------------- next part -------------- An HTML attachment was scrubbed... URL: From orblivion at gmail.com Sun Nov 17 23:42:46 2013 From: orblivion at gmail.com (Dan Krol) Date: Sun, 17 Nov 2013 15:42:46 -0800 Subject: [Haskell-cafe] Error cabal update: "Unsucessful HTTP code: 404" In-Reply-To: <52894651.7070804@gmx.de> References: <52894651.7070804@gmx.de> Message-ID: haskell.org seemed to be altogether down the other day. Perhaps the second one worked because you tried it later? Did you try the cabal command today? As of at least right now haskell.org is working for me. On Sun, Nov 17, 2013 at 2:42 PM, Vaniax wrote: > Hi, > > I have a big problem with a fresh installation of the Haskell-Platform > 2013.2 on Windows 7. When I try to run `cabal update` I get > the following error message: > > "Downloading the latest package list from hackage.haskell.org cabal: > Failed to download > http://hackage.haskell.org/packages/archive/00-index.tar.gz : > ErrorMisc "Unsucessful HTTP code: 404" > > When I try `wget > http://hackage.haskell.org/packages/archive/00-index.tar.gz`everything > works alright. I'm using no proxies or something like that. Maybe someone > know whats going wrong? A parallel Windows-XP installation of the platform > works fine. > > > Vaniax > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tonymorris at gmail.com Mon Nov 18 00:12:25 2013 From: tonymorris at gmail.com (Tony Morris) Date: Mon, 18 Nov 2013 10:12:25 +1000 Subject: [Haskell-cafe] Canberra interest? Message-ID: <52895B69.7010309@gmail.com> Hello, I am from Brisbane, Australia and it is my mission to teach functional programming to all and especially Australia. I am tasked with this mission by my employer, NICTA, which is funded by the Australia government. With support from NICTA, I usually run (free) courses to assist in this mission and have done so in Sydney, Melbourne and Brisbane. However, I often wonder about any interest in Canberra. I do not find any user interest groups related to Functional Programming or language-specific such as Haskell when I search, so I was hoping to seek out any expressions of interest here. Are any of you from Canberra? If so, are you interested in learning more about functional programming? Would you be interested in attending a 2 or 3 day workshop? Do you have peers who would also be interested? If these people exist, how might I contact them? Thanks for any tips! -- Tony Morris http://tmorris.net/ From benl at ouroborus.net Mon Nov 18 01:32:26 2013 From: benl at ouroborus.net (Ben Lippmeier) Date: Mon, 18 Nov 2013 12:32:26 +1100 Subject: [Haskell-cafe] Canberra interest? In-Reply-To: <52895B69.7010309@gmail.com> References: <52895B69.7010309@gmail.com> Message-ID: <760644AB-F2CD-4641-B223-C3A46D5DAD1E@ouroborus.net> On 18/11/2013, at 11:12 AM, Tony Morris wrote: > Hello, I am from Brisbane, Australia and it is my mission to teach > functional programming to all and especially Australia. I am tasked with > this mission by my employer, NICTA, which is funded by the Australia > government. > > With support from NICTA, I usually run (free) courses to assist in this > mission and have done so in Sydney, Melbourne and Brisbane. However, I > often wonder about any interest in Canberra. I do not find any user > interest groups related to Functional Programming or language-specific > such as Haskell when I search, so I was hoping to seek out any > expressions of interest here. > > Are any of you from Canberra? If so, are you interested in learning more > about functional programming? Would you be interested in attending a 2 > or 3 day workshop? Do you have peers who would also be interested? If > these people exist, how might I contact them? I am from Canberra originally. On the academic side, talk to: Clem Baker-Finch -- teaches programming languages at ANU. http://people.cecs.anu.edu.au/user/3877 http://cs.anu.edu.au/courses/COMP3610/ Uwe Zimmer -- teaches first year programming in Haskell at ANU. https://researchers.anu.edu.au/researchers/zimmer-ur http://cs.anu.edu.au/student/comp1100/index.html Also anyone who is tutoring for them. There are also FP people in the RSISE/NICTA lab, but they are more experienced researchers that don't need the basics of functional programming taught to them. Eg: Michael Norrish -- is associated with the L4 verified project here in Sydney. http://nicta.com.au/people/norrishm At one time Alex Mason was organising some FP events from Canberra, but I haven't heard anything about him for a year or more. I suspect he's graduated by now (was an undergrad at ANU). Ben. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjaredsimpson at gmail.com Mon Nov 18 04:20:21 2013 From: jjaredsimpson at gmail.com (jared simpson) Date: Sun, 17 Nov 2013 20:20:21 -0800 (PST) Subject: [Haskell-cafe] Incorrect behavior in Data.Complex ? Message-ID: Prelude Data.Complex> 0**2 0.0 Prelude Data.Complex> 0**2 :: Complex Double NaN :+ NaN Prelude Data.Complex> exp $ 2 * log 0 :: Complex Double NaN :+ NaN Prelude Data.Complex> log 0 :: Complex Double (-Infinity) :+ 0.0 Prelude Data.Complex> 2 * it :: Complex Double (-Infinity) :+ NaN Prelude Data.Complex> exp it :: Complex Double NaN :+ NaN So Complex uses the default implementation of **. Then when 2*(-inf :+ 0) is evaluated. We do (2 * -inf - 0*0) :+ (2*0 + -inf*0). Which because of -inf*0 sets the imaginary part to NaN. Then exp (-inf :+ NaN) = exp x cos y :+ exp x sin y which becomes 0 * cos NaN :+ 0 * sin NaN. So we end up with NaN :+ NaN. So is there a library I should be using, or is this a bug? -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean at functionaljobs.com Mon Nov 18 07:00:02 2013 From: sean at functionaljobs.com (Functional Jobs) Date: Mon, 18 Nov 2013 02:00:02 -0500 Subject: [Haskell-cafe] New Functional Programming Job Opportunities Message-ID: <5289bb01946dc@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Compiler Engineer at BAE Systems http://functionaljobs.com/jobs/8656-compiler-engineer-at-bae-systems Cheers, Sean Murphy FunctionalJobs.com From ivan.miljenovic at gmail.com Mon Nov 18 07:12:51 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Mon, 18 Nov 2013 18:12:51 +1100 Subject: [Haskell-cafe] Canberra interest? In-Reply-To: <760644AB-F2CD-4641-B223-C3A46D5DAD1E@ouroborus.net> References: <52895B69.7010309@gmail.com> <760644AB-F2CD-4641-B223-C3A46D5DAD1E@ouroborus.net> Message-ID: On 18 November 2013 12:32, Ben Lippmeier wrote: > > On 18/11/2013, at 11:12 AM, Tony Morris wrote: > > Hello, I am from Brisbane, Australia and it is my mission to teach > functional programming to all and especially Australia. I am tasked with > this mission by my employer, NICTA, which is funded by the Australia > government. > > With support from NICTA, I usually run (free) courses to assist in this > mission and have done so in Sydney, Melbourne and Brisbane. However, I > often wonder about any interest in Canberra. I do not find any user > interest groups related to Functional Programming or language-specific > such as Haskell when I search, so I was hoping to seek out any > expressions of interest here. > > Are any of you from Canberra? If so, are you interested in learning more > about functional programming? Would you be interested in attending a 2 > or 3 day workshop? Do you have peers who would also be interested? If > these people exist, how might I contact them? > > > I am from Canberra originally. > > On the academic side, talk to: > > Clem Baker-Finch -- teaches programming languages at ANU. > http://people.cecs.anu.edu.au/user/3877 > http://cs.anu.edu.au/courses/COMP3610/ > > Uwe Zimmer -- teaches first year programming in Haskell at ANU. > https://researchers.anu.edu.au/researchers/zimmer-ur > http://cs.anu.edu.au/student/comp1100/index.html > > Also anyone who is tutoring for them. > > There are also FP people in the RSISE/NICTA lab, but they are more > experienced researchers that don't need > the basics of functional programming taught to them. Eg: > > Michael Norrish -- is associated with the L4 verified project here in > Sydney. > http://nicta.com.au/people/norrishm > > At one time Alex Mason was organising some FP events from Canberra, but I > haven't heard anything about him for a year or more. I suspect he's > graduated by now (was an undergrad at ANU). There's also me. The CLUG group has a programmers SIG night second Thursday every month, but might also be interested in general: http://clug.org.au/ (admittedly I haven't been to any in a while due to conflicting schedules, but I keep meaning to go and do a parsing combinators talk...) > > Ben. > > > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From conrad at metadecks.org Mon Nov 18 07:15:09 2013 From: conrad at metadecks.org (Conrad Parker) Date: Mon, 18 Nov 2013 18:15:09 +1100 Subject: [Haskell-cafe] Canberra interest? In-Reply-To: References: <52895B69.7010309@gmail.com> <760644AB-F2CD-4641-B223-C3A46D5DAD1E@ouroborus.net> Message-ID: On 18 November 2013 18:12, Ivan Lazar Miljenovic wrote: > > http://clug.org.au/ (admittedly I haven't been to any in a while due > to conflicting schedules, but I keep meaning to go and do a parsing > combinators talk...) > Does that make it a lazy parsing combinators talk? Conrad. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Mon Nov 18 07:16:07 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Mon, 18 Nov 2013 18:16:07 +1100 Subject: [Haskell-cafe] Canberra interest? In-Reply-To: References: <52895B69.7010309@gmail.com> <760644AB-F2CD-4641-B223-C3A46D5DAD1E@ouroborus.net> Message-ID: On 18 November 2013 18:15, Conrad Parker wrote: > > On 18 November 2013 18:12, Ivan Lazar Miljenovic > wrote: >> >> http://clug.org.au/ (admittedly I haven't been to any in a while due >> to conflicting schedules, but I keep meaning to go and do a parsing >> combinators talk...) > > > Does that make it a lazy parsing combinators talk? *groan* > > Conrad. -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From R.Paterson at city.ac.uk Mon Nov 18 08:24:44 2013 From: R.Paterson at city.ac.uk (Ross Paterson) Date: Mon, 18 Nov 2013 08:24:44 +0000 Subject: [Haskell-cafe] Incorrect behavior in Data.Complex ? In-Reply-To: References: Message-ID: <20131118082443.GA3983@city.ac.uk> On Sun, Nov 17, 2013 at 08:20:21PM -0800, jared simpson wrote: > Prelude Data.Complex> 0**2 > 0.0 > Prelude Data.Complex> 0**2 :: Complex Double > NaN :+ NaN > [...] > > So Complex uses the default implementation of **. Then when 2*(-inf :+ 0) is > evaluated. We do (2 * -inf - 0*0) :+ (2*0 + -inf*0). Which because of -inf*0 > sets the imaginary part to NaN. > > Then exp (-inf :+ NaN) = exp x cos y :+ exp x sin y which becomes 0 * cos NaN > :+ 0 * sin NaN. So we end up with NaN :+ NaN. > > So is there a library I should be using, or is this a bug? I would say the default implementation of (**) is wrong: to match the Float/Double instances it should be x ** y = if x == 0 then 0 else exp (log x * y) From Vaniax at gmx.de Mon Nov 18 18:01:49 2013 From: Vaniax at gmx.de (Vaniax) Date: Mon, 18 Nov 2013 19:01:49 +0100 Subject: [Haskell-cafe] Error cabal update: "Unsucessful HTTP code: 404" In-Reply-To: References: <52894651.7070804@gmx.de> Message-ID: <528A560D.8020104@gmx.de> Mhh, I tried it two hours ago with the same result. Am 18.11.2013 00:42, schrieb Dan Krol: > haskell.org seemed to be altogether down the other day. Perhaps the second > one worked because you tried it later? Did you try the cabal command today? > As of at least right now haskell.org is working for me. > > > On Sun, Nov 17, 2013 at 2:42 PM, Vaniax wrote: > >> Hi, >> >> I have a big problem with a fresh installation of the Haskell-Platform >> 2013.2 on Windows 7. When I try to run `cabal update` I get >> the following error message: >> >> "Downloading the latest package list from hackage.haskell.org cabal: >> Failed to download >> http://hackage.haskell.org/packages/archive/00-index.tar.gz : >> ErrorMisc "Unsucessful HTTP code: 404" >> >> When I try `wget >> http://hackage.haskell.org/packages/archive/00-index.tar.gz`everything >> works alright. I'm using no proxies or something like that. Maybe someone >> know whats going wrong? A parallel Windows-XP installation of the platform >> works fine. >> >> >> Vaniax >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> From natalia at fpcomplete.com Mon Nov 18 18:30:15 2013 From: natalia at fpcomplete.com (Natalia Muska) Date: Mon, 18 Nov 2013 10:30:15 -0800 Subject: [Haskell-cafe] FP Complete Launches Free Community edition of FP Haskell Center Message-ID: https://www.fpcomplete.com/business/blog/fp-complete-launches-free-community-edition-fp-haskell-center-announces-feature-upgrades/ -- Natalia Muska Marketing Manager FP Complete, Inc. Natalia at fpcomplete.com 865-506-6513 skype: natalia.s.muska -------------- next part -------------- An HTML attachment was scrubbed... URL: From jjaredsimpson at gmail.com Mon Nov 18 21:54:38 2013 From: jjaredsimpson at gmail.com (jared simpson) Date: Mon, 18 Nov 2013 16:54:38 -0500 Subject: [Haskell-cafe] Incorrect behavior in Data.Complex ? In-Reply-To: <20131118082443.GA3983@city.ac.uk> References: <20131118082443.GA3983@city.ac.uk> Message-ID: On Mon, Nov 18, 2013 at 3:24 AM, Ross Paterson wrote: > On Sun, Nov 17, 2013 at 08:20:21PM -0800, jared simpson wrote: > > Prelude Data.Complex> 0**2 > > 0.0 > > Prelude Data.Complex> 0**2 :: Complex Double > > NaN :+ NaN > > [...] > > > > So Complex uses the default implementation of **. Then when 2*(-inf :+ > 0) is > > evaluated. We do (2 * -inf - 0*0) :+ (2*0 + -inf*0). Which because of > -inf*0 > > sets the imaginary part to NaN. > > > > Then exp (-inf :+ NaN) = exp x cos y :+ exp x sin y which becomes 0 * > cos NaN > > :+ 0 * sin NaN. So we end up with NaN :+ NaN. > > > > So is there a library I should be using, or is this a bug? > > I would say the default implementation of (**) is wrong: to match the > Float/Double instances it should be > > x ** y = if x == 0 then 0 else exp (log x * y) > _______________________________________________ Bug filed thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tomahawkins at gmail.com Mon Nov 18 22:48:11 2013 From: tomahawkins at gmail.com (Tom Hawkins) Date: Mon, 18 Nov 2013 16:48:11 -0600 Subject: [Haskell-cafe] New Functional Programming Job Opportunities In-Reply-To: <5289bb01946dc@functionaljobs.com> References: <5289bb01946dc@functionaljobs.com> Message-ID: And if you would like to bypass the HR resume filter, send your CVs to me and I'll get them to the right people (i.e. my boss and the SAFE program manager). -Tom On Mon, Nov 18, 2013 at 1:00 AM, Functional Jobs wrote: > Here are some functional programming job opportunities that were posted > recently: > > Compiler Engineer at BAE Systems > http://functionaljobs.com/jobs/8656-compiler-engineer-at-bae-systems > > Cheers, > Sean Murphy > FunctionalJobs.com > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From marco-oweber at gmx.de Tue Nov 19 02:22:58 2013 From: marco-oweber at gmx.de (Marc Weber) Date: Tue, 19 Nov 2013 03:22:58 +0100 Subject: [Haskell-cafe] New Functional Programming Job Opportunities In-Reply-To: References: <5289bb01946dc@functionaljobs.com> Message-ID: <1384827576-sup-3698@nixos> Hi Tom, Eventually it might make sense telling that "US citizenship" will be required. Eg I'm German. Is there any chance for external people like me to take part in learning/understanding/applying your that technology to whatever problems? Or will it be "closed source" only? Marc Weber From eijiro.sumii at gmail.com Tue Nov 19 05:16:27 2013 From: eijiro.sumii at gmail.com (Eijiro Sumii) Date: Tue, 19 Nov 2013 14:16:27 +0900 Subject: [Haskell-cafe] FLOPS 2014 2nd CFP Message-ID: NEWS: - Journal publications in JFP (Jounral of Functional Programming) and TPLP (Theory and Practice of Logic Programming) are planned (see below). - Hyakumangoku Matsuri ( https://www.google.com/search?q=hyakumangoku%20matsuri&tbm=isch ) is scheduled *just* after FLOPS 2014. Call For Papers =============== Twelfth International Symposium on Functional and Logic Programming (FLOPS 2014) June 4-6, 2014 Kanazawa, Japan http://www.jaist.ac.jp/flops2014/ FLOPS is a forum for research on all issues concerning declarative programming, including functional programming and logic programming, and aims to promote cross-fertilization and integration between the two paradigms. Previous FLOPS meetings were held at Fuji Susono (1995), Shonan Village (1996), Kyoto (1998), Tsukuba (1999), Tokyo (2001), Aizu (2002), Nara (2004), Fuji Susono (2006), Ise (2008), Sendai (2010), and Kobe (2012). Topics ====== FLOPS solicits original papers in all areas of functional and logic programming, including (but not limited to): - Language issues: language design and constructs, programming methodology, integration of paradigms, interfacing with other languages, type systems, constraints, concurrency and distributed computing. - Foundations: logic and semantics, rewrite systems and narrowing, type theory, proof systems. - Implementation issues: compilation techniques, memory management, program analysis and transformation, partial evaluation, parallelism. - Applications: case studies, real-world applications, graphical user interfaces, Internet applications, XML, databases, formal methods and model checking. The proceedings will be published as an LNCS volume. The proceedings of the previous meetings (FLOPS 1999, 2001, 2002, 2004, 2006, 2008, 2010, and 2012) were published as LNCS 1722, 2024, 2441, 2998, 3945, 4989, 6009, and 7294. PC Co-Chairs ============ Michael Codish (Ben-Gurion University of the Negev) Eijiro Sumii (Tohoku University) PC Members ========== Lars Birkedal (Aarhus University) Michael Codish (Ben-Gurion University of the Negev) [co-chair] Marina De Vos (University of Bath) Moreno Falaschi (Universita degli studi di Udine) Carsten Fuhs (University College London) John Gallagher (Roskilde Universitet / IMDEA Software Institute) Samir Genaim (Universidad Complutense de Madrid) Laura Giordano (Universita del Piemonte Orientale) Ichiro Hasuo (University of Tokyo) Fritz Henglein (University of Copenhagen) Andy King (University of Kent) Oleg Kiselyov Vitaly Lagoon (MathWorks) Shin-Cheng Mu (Academia Sinica) Keiko Nakata (Institute of Cybernetics at Tallinn University of Technology) Luke Ong (University of Oxford) Peter Schachte (University of Melbourne) Takehide Soh (Kobe University) Eijiro Sumii (Tohoku University) [co-chair] Tachio Terauchi (Nagoya University) Joost Vennekens (KU Leuven) Janis Voigtlaender (Universitaet Bonn) Stephanie Weirich (University of Pennsylvania) Local Chair =========== Yuki Chiba (JAIST) Submission ========== Submissions must be unpublished and not submitted for publication elsewhere. Work that already appeared in unpublished or informally published workshops proceedings may be submitted. See also ACM SIGPLAN Republication Policy: http://www.sigplan.org/Resources/Policies/Republication Submissions should fall into one of the following categories: - Regular research papers: they should describe new results and will be judged on originality, correctness, and significance. - System descriptions: they should contain a link to a working system and will be judged on originality, usefulness, and design. - Declarative pearls: new and excellent declarative programs or theories with illustrative applications. System descriptions and declarative pearls must be explicitly marked as such in the title. Submissions must be written in English and can be up to 15 pages long including references, though pearls are typically shorter. Authors are required to use LaTeX2e and the Springer llncs class file, available at: http://www.springer.de/comp/lncs/authors.html Regular research papers should be supported by proofs and/or experimental results. In case of lack of space, this supporting information should be made accessible otherwise (e.g., a link to a Web page, or an appendix). Papers should be submitted electronically at: https://www.easychair.org/conferences/?conf=flops2014 Important Dates =============== Submission deadline: December 13, 2013 Author notification: February 10, 2014 Camera-ready copy: March 7, 2014 Journal Publication =================== - Journal of Functional Programming and - Theory and Practice of Logic Programming 2-4 of the best papers in each of the two areas: Functional Programming and Logic Programming, will be invited for inclusion in a designated FLOPS section within each of the two journals. The Theory and Practice of Logic Programming papers will appear as "Rapid Publications". All of the these submissions are expected to represent high-quality revisions and extensions of the selected FLOPS papers and will be reviewed under the standard criteria of each journal. Venue ===== Main Hall, Ishikawa Prefectural Museum of Art, 2-1 Dewa-machi, Kanazawa, Ishikawa 920-0963 JAPAN. Some Previous FLOPS =================== FLOPS 2012, Kobe: http://www.org.kobe-u.ac.jp/flops2012/ FLOPS 2010, Sendai: http://www.kb.ecei.tohoku.ac.jp/flops2010/ FLOPS 2008, Ise: http://www.math.nagoya-u.ac.jp/~garrigue/FLOPS2008/ Sponsor ======= Japan Society for Software Science and Technology (JSSST), Special Interest Group on Programming and Programming Languages (SIG-PPL) In Cooperation With =================== ACM SIGPLAN Asian Association for Foundation of Software (AAFS) Association for Logic Programming (ALP) From tpadilha84 at gmail.com Tue Nov 19 14:59:07 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Tue, 19 Nov 2013 12:59:07 -0200 Subject: [Haskell-cafe] Need help with very simple C++ FFI call Message-ID: Hi I'm trying write a ffi binding to the v8 javascript engine (C++ library). Theres one already at https://github.com/sol/v8 but I want to do it again as an exercise to improve by haskell skills. I chose this library be because it will force me to deal with impure functions using monads. Since its not a trivial library, it will also improve my knowledge of writing FFI bindings and cabal packages in case I want to wrap more C++ libraries in the future. My first step is to port the 'hello world' example in v8 embedders guide(https://developers.google.com/v8/get_started) as a haskell binding. So I have downloaded/compiled v8 and created the following directory structure: src/V8.hs cbits/haskell-v8.cpp # v8 libraries deps/lib/libv8_base.a deps/lib/libv8_snapshot.a # v8 headers deps/include/ Here's the contents of the haskell-v8.cpp file: http://pastebin.com/RfYCCxFQ (basically a copy of the v8 embedders example function, except that it returns a char pointer). and here's the haskell module: http://pastebin.com/fnXVbEeU I compiled a shared library exposing the c "hello" function with the following command: $ g++ \ -shared -o libhaskellv8.so \ -I./deps/include \ -L./deps/lib \ ./cbits/haskell-v8.cpp \ -lv8_base \ -lv8_snapshot \ -lpthread \ -lrt And loaded into ghci with the following: $ ghci -L. -lhaskellv8 src/V8.hs The problem is that I get a segmentation fault when I call the 'hello' function from ghci. To ensure the library was compiled correctly, I successfully called it from python: $ python -c \ 'from ctypes import CDLL, c_char_p; lv8=CDLL("libhaskellv8.so"); lv8.hello.restype = c_char_p; print lv8.hello()' Hello, World! I have selectively uncommented lines from the c++ file, and the segmentation faults starts happening when I uncomment line 14 (HandleScope handle_scope(isolate)). What am I missing here? From shumovichy at gmail.com Tue Nov 19 16:06:50 2013 From: shumovichy at gmail.com (Yuras Shumovich) Date: Tue, 19 Nov 2013 19:06:50 +0300 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: Message-ID: <1384877210.15424.5.camel@shum-lt> Hello, IIRC, strlen doesn't count the terminating '\0', so you'll need to malloc(strlen(*ascii) + 1). Not sure why python works, maybe just different memory layout hides the bug. Thanks, Yuras On Tue, 2013-11-19 at 12:59 -0200, Thiago Padilha wrote: > Hi > > I'm trying write a ffi binding to the v8 javascript engine (C++ > library). Theres one already at https://github.com/sol/v8 but I want > to do it again as an exercise to improve by haskell skills. > > I chose this library be because it will force me to deal with impure > functions using monads. Since its not a trivial library, it will also > improve my knowledge of writing FFI bindings and cabal packages in > case I want to wrap more C++ libraries in the future. > > My first step is to port the 'hello world' example in v8 embedders > guide(https://developers.google.com/v8/get_started) as a haskell > binding. So I have downloaded/compiled v8 and created the following > directory structure: > > src/V8.hs > cbits/haskell-v8.cpp > # v8 libraries > deps/lib/libv8_base.a > deps/lib/libv8_snapshot.a > # v8 headers > deps/include/ > > Here's the contents of the haskell-v8.cpp file: > http://pastebin.com/RfYCCxFQ (basically a copy of the v8 embedders > example function, except that it returns a char pointer). > > and here's the haskell module: http://pastebin.com/fnXVbEeU > > I compiled a shared library exposing the c "hello" function with the > following command: > > $ g++ \ > -shared -o libhaskellv8.so \ > -I./deps/include \ > -L./deps/lib \ > ./cbits/haskell-v8.cpp \ > -lv8_base \ > -lv8_snapshot \ > -lpthread \ > -lrt > > And loaded into ghci with the following: > > $ ghci -L. -lhaskellv8 src/V8.hs > > The problem is that I get a segmentation fault when I call the 'hello' > function from ghci. To ensure the library was compiled correctly, I > successfully called it from python: > > $ python -c \ > 'from ctypes import CDLL, c_char_p; lv8=CDLL("libhaskellv8.so"); > lv8.hello.restype = c_char_p; print lv8.hello()' > Hello, World! > > I have selectively uncommented lines from the c++ file, and the > segmentation faults starts happening when I uncomment line 14 > (HandleScope handle_scope(isolate)). > > What am I missing here? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From tpadilha84 at gmail.com Tue Nov 19 16:19:33 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Tue, 19 Nov 2013 14:19:33 -0200 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: <1384877210.15424.5.camel@shum-lt> References: <1384877210.15424.5.camel@shum-lt> Message-ID: Thanks for pointing the strlen issue, but as I stated before, the segmentation fault occurs even before the copying the resulting string. To illustrate the error better, heres a very trimmed(20 lines long) version of the c++ file that still causes the segmentation fault: http://pastebin.com/cJvkLQPg . Commenting line 14 will fix the segfault. On Tue, Nov 19, 2013 at 1:06 PM, Yuras Shumovich wrote: > > Hello, > > IIRC, strlen doesn't count the terminating '\0', so you'll need to > malloc(strlen(*ascii) + 1). > > Not sure why python works, maybe just different memory layout hides the > bug. > > Thanks, > Yuras > > On Tue, 2013-11-19 at 12:59 -0200, Thiago Padilha wrote: >> Hi >> >> I'm trying write a ffi binding to the v8 javascript engine (C++ >> library). Theres one already at https://github.com/sol/v8 but I want >> to do it again as an exercise to improve by haskell skills. >> >> I chose this library be because it will force me to deal with impure >> functions using monads. Since its not a trivial library, it will also >> improve my knowledge of writing FFI bindings and cabal packages in >> case I want to wrap more C++ libraries in the future. >> >> My first step is to port the 'hello world' example in v8 embedders >> guide(https://developers.google.com/v8/get_started) as a haskell >> binding. So I have downloaded/compiled v8 and created the following >> directory structure: >> >> src/V8.hs >> cbits/haskell-v8.cpp >> # v8 libraries >> deps/lib/libv8_base.a >> deps/lib/libv8_snapshot.a >> # v8 headers >> deps/include/ >> >> Here's the contents of the haskell-v8.cpp file: >> http://pastebin.com/RfYCCxFQ (basically a copy of the v8 embedders >> example function, except that it returns a char pointer). >> >> and here's the haskell module: http://pastebin.com/fnXVbEeU >> >> I compiled a shared library exposing the c "hello" function with the >> following command: >> >> $ g++ \ >> -shared -o libhaskellv8.so \ >> -I./deps/include \ >> -L./deps/lib \ >> ./cbits/haskell-v8.cpp \ >> -lv8_base \ >> -lv8_snapshot \ >> -lpthread \ >> -lrt >> >> And loaded into ghci with the following: >> >> $ ghci -L. -lhaskellv8 src/V8.hs >> >> The problem is that I get a segmentation fault when I call the 'hello' >> function from ghci. To ensure the library was compiled correctly, I >> successfully called it from python: >> >> $ python -c \ >> 'from ctypes import CDLL, c_char_p; lv8=CDLL("libhaskellv8.so"); >> lv8.hello.restype = c_char_p; print lv8.hello()' >> Hello, World! >> >> I have selectively uncommented lines from the c++ file, and the >> segmentation faults starts happening when I uncomment line 14 >> (HandleScope handle_scope(isolate)). >> >> What am I missing here? >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From allbery.b at gmail.com Tue Nov 19 16:19:42 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 19 Nov 2013 11:19:42 -0500 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: <1384877210.15424.5.camel@shum-lt> References: <1384877210.15424.5.camel@shum-lt> Message-ID: On Tue, Nov 19, 2013 at 11:06 AM, Yuras Shumovich wrote: > IIRC, strlen doesn't count the terminating '\0', so you'll need to > malloc(strlen(*ascii) + 1). > > Not sure why python works, maybe just different memory layout hides the > bug. > Also note that different memory allocators have different behaviors; depending on block size rounding, string length and arena accounting overhead, the allocated block may be larger than requested. So the malloc() that Python provides may possibly be returning something "accidentally" large enough to handle the NUL anyway. (I don't know if Python actually overrides/replaces the default malloc(); some other interpreters do.) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Tue Nov 19 16:21:40 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 19 Nov 2013 11:21:40 -0500 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: Message-ID: If you're wanting to call c++ code from ghci, you may need to use GHC 7.8 (current head), at least if you've hit any linking problems with using ghci in 7.6 or older ghc's. Just an advanced warning. :-) Happy hacking. On Tuesday, November 19, 2013, Thiago Padilha wrote: > Hi > > I'm trying write a ffi binding to the v8 javascript engine (C++ > library). Theres one already at https://github.com/sol/v8 but I want > to do it again as an exercise to improve by haskell skills. > > I chose this library be because it will force me to deal with impure > functions using monads. Since its not a trivial library, it will also > improve my knowledge of writing FFI bindings and cabal packages in > case I want to wrap more C++ libraries in the future. > > My first step is to port the 'hello world' example in v8 embedders > guide(https://developers.google.com/v8/get_started) as a haskell > binding. So I have downloaded/compiled v8 and created the following > directory structure: > > src/V8.hs > cbits/haskell-v8.cpp > # v8 libraries > deps/lib/libv8_base.a > deps/lib/libv8_snapshot.a > # v8 headers > deps/include/ > > Here's the contents of the haskell-v8.cpp file: > http://pastebin.com/RfYCCxFQ (basically a copy of the v8 embedders > example function, except that it returns a char pointer). > > and here's the haskell module: http://pastebin.com/fnXVbEeU > > I compiled a shared library exposing the c "hello" function with the > following command: > > $ g++ \ > -shared -o libhaskellv8.so \ > -I./deps/include \ > -L./deps/lib \ > ./cbits/haskell-v8.cpp \ > -lv8_base \ > -lv8_snapshot \ > -lpthread \ > -lrt > > And loaded into ghci with the following: > > $ ghci -L. -lhaskellv8 src/V8.hs > > The problem is that I get a segmentation fault when I call the 'hello' > function from ghci. To ensure the library was compiled correctly, I > successfully called it from python: > > $ python -c \ > 'from ctypes import CDLL, c_char_p; lv8=CDLL("libhaskellv8.so"); > lv8.hello.restype = c_char_p; print lv8.hello()' > Hello, World! > > I have selectively uncommented lines from the c++ file, and the > segmentation faults starts happening when I uncomment line 14 > (HandleScope handle_scope(isolate)). > > What am I missing here? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tpadilha84 at gmail.com Tue Nov 19 16:31:06 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Tue, 19 Nov 2013 14:31:06 -0200 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: <1384877210.15424.5.camel@shum-lt> Message-ID: On Tue, Nov 19, 2013 at 1:19 PM, Brandon Allbery wrote: > Also note that different memory allocators have different behaviors; > depending on block size rounding, string length and arena accounting > overhead, the allocated block may be larger than requested. So the malloc() > that Python provides may possibly be returning something "accidentally" > large enough to handle the NUL anyway. (I don't know if Python actually > overrides/replaces the default malloc(); some other interpreters do.) Line 14(which causes the segfault) comment says the HandleScope is being allocated on the stack: // Create a stack-allocated handle scope. HandleScope handle_scope(isolate); I dont know any C++. Is it possible that this line of code is allocating something on the heap? If so could ghci have overriden memory allocation routines in a way that would mess that allocation? From tpadilha84 at gmail.com Tue Nov 19 16:36:13 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Tue, 19 Nov 2013 14:36:13 -0200 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: Message-ID: On Tue, Nov 19, 2013 at 1:21 PM, Carter Schonwald wrote: > If you're wanting to call c++ code from ghci, you may need to use GHC 7.8 > (current head), at least if you've hit any linking problems with using ghci > in 7.6 or older ghc's. Just an advanced warning. :-) > > Happy hacking. I'm using GHC 7.6 but the shared library was compiled and linked using gcc. Would this GHC incompatibility cause troubles when loading already-linked shared libraries? From allbery.b at gmail.com Tue Nov 19 16:43:09 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 19 Nov 2013 11:43:09 -0500 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: <1384877210.15424.5.camel@shum-lt> Message-ID: On Tue, Nov 19, 2013 at 11:31 AM, Thiago Padilha wrote: > On Tue, Nov 19, 2013 at 1:19 PM, Brandon Allbery > wrote: > > Also note that different memory allocators have different behaviors; > > Line 14(which causes the segfault) comment says the HandleScope is > being allocated on the stack: > > // Create a stack-allocated handle scope. > HandleScope handle_scope(isolate); > > I dont know any C++. Is it possible that this line of code is > allocating something on the heap? If so could ghci have overriden > memory allocation routines in a way that would mess that allocation? > I don't think ghc/ghci overrides malloc() like that. And it is possible that the constructor, while allocating a stack object, also allocates some heap-based memory; but that is a detail of the C++ code of the constructor. That said, I believe g++ uses malloc/free behind the scenes for new/delete to avoid such conflicts (this is common because it is often necessary to mix C and C++ code, and it's just bad to have multiple memory allocators working in the same heap). (That said, the fact that it uses malloc/free behind the scenes does *not* guarantee that you can substitute malloc() for new/new[] or free() for delete/delete[]. But in this case, no C++ allocations should be escaping the C++ code, so that also should not be relevant.) It might be a good idea to run the test program under valgrind and see what it has to say about the problem. -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From shumovichy at gmail.com Tue Nov 19 16:50:03 2013 From: shumovichy at gmail.com (Yuras Shumovich) Date: Tue, 19 Nov 2013 19:50:03 +0300 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: <1384877210.15424.5.camel@shum-lt> Message-ID: <1384879803.15424.11.camel@shum-lt> Ok, then I don't see anything obviously wrong. I was embeding v8 into haskell project few months ago, and almost the same code works for me. I don't have v8 installed right now, so I can't try your code at the moment, but I see only one not trivial difference with my code. I'm creating isolate manually, and you are using the default one. Check that Isolate::GetCurrent() returns anything. I can imaging that your code is running in unbound green thread, or it is bound to OS thread other then the main one. v8 use thread local storage, that can be the issue. On Tue, 2013-11-19 at 14:19 -0200, Thiago Padilha wrote: > Thanks for pointing the strlen issue, but as I stated before, the > segmentation fault occurs even before the copying the resulting > string. To illustrate the error better, heres a very trimmed(20 lines > long) version of the c++ file that still causes the segmentation > fault: http://pastebin.com/cJvkLQPg . Commenting line 14 will fix the > segfault. > > On Tue, Nov 19, 2013 at 1:06 PM, Yuras Shumovich wrote: > > > > Hello, > > > > IIRC, strlen doesn't count the terminating '\0', so you'll need to > > malloc(strlen(*ascii) + 1). > > > > Not sure why python works, maybe just different memory layout hides the > > bug. > > > > Thanks, > > Yuras > > > > On Tue, 2013-11-19 at 12:59 -0200, Thiago Padilha wrote: > >> Hi > >> > >> I'm trying write a ffi binding to the v8 javascript engine (C++ > >> library). Theres one already at https://github.com/sol/v8 but I want > >> to do it again as an exercise to improve by haskell skills. > >> > >> I chose this library be because it will force me to deal with impure > >> functions using monads. Since its not a trivial library, it will also > >> improve my knowledge of writing FFI bindings and cabal packages in > >> case I want to wrap more C++ libraries in the future. > >> > >> My first step is to port the 'hello world' example in v8 embedders > >> guide(https://developers.google.com/v8/get_started) as a haskell > >> binding. So I have downloaded/compiled v8 and created the following > >> directory structure: > >> > >> src/V8.hs > >> cbits/haskell-v8.cpp > >> # v8 libraries > >> deps/lib/libv8_base.a > >> deps/lib/libv8_snapshot.a > >> # v8 headers > >> deps/include/ > >> > >> Here's the contents of the haskell-v8.cpp file: > >> http://pastebin.com/RfYCCxFQ (basically a copy of the v8 embedders > >> example function, except that it returns a char pointer). > >> > >> and here's the haskell module: http://pastebin.com/fnXVbEeU > >> > >> I compiled a shared library exposing the c "hello" function with the > >> following command: > >> > >> $ g++ \ > >> -shared -o libhaskellv8.so \ > >> -I./deps/include \ > >> -L./deps/lib \ > >> ./cbits/haskell-v8.cpp \ > >> -lv8_base \ > >> -lv8_snapshot \ > >> -lpthread \ > >> -lrt > >> > >> And loaded into ghci with the following: > >> > >> $ ghci -L. -lhaskellv8 src/V8.hs > >> > >> The problem is that I get a segmentation fault when I call the 'hello' > >> function from ghci. To ensure the library was compiled correctly, I > >> successfully called it from python: > >> > >> $ python -c \ > >> 'from ctypes import CDLL, c_char_p; lv8=CDLL("libhaskellv8.so"); > >> lv8.hello.restype = c_char_p; print lv8.hello()' > >> Hello, World! > >> > >> I have selectively uncommented lines from the c++ file, and the > >> segmentation faults starts happening when I uncomment line 14 > >> (HandleScope handle_scope(isolate)). > >> > >> What am I missing here? > >> _______________________________________________ > >> Haskell-Cafe mailing list > >> Haskell-Cafe at haskell.org > >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > From tpadilha84 at gmail.com Tue Nov 19 17:13:04 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Tue, 19 Nov 2013 15:13:04 -0200 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: <1384879803.15424.11.camel@shum-lt> References: <1384877210.15424.5.camel@shum-lt> <1384879803.15424.11.camel@shum-lt> Message-ID: On Tue, Nov 19, 2013 at 1:50 PM, Yuras Shumovich wrote: > > Ok, then I don't see anything obviously wrong. > > I was embeding v8 into haskell project few months ago, and almost the > same code works for me. > > I don't have v8 installed right now, so I can't try your code at the > moment, but I see only one not trivial difference with my code. I'm > creating isolate manually, and you are using the default one. Check that > Isolate::GetCurrent() returns anything. I can imaging that your code is > running in unbound green thread, or it is bound to OS thread other then > the main one. v8 use thread local storage, that can be the issue. Yuras, you are correct now :) I've replaced the first line by these: Isolate* isolate = Isolate::New(); // Sets this isolate as the entered one for the current thread isolate->Enter(); And the example worked as expected. Thanks for this very useful tip. I still dont understand why ghci is not using the default thread to run the binding, but from now on I will be more alert when binding to libraries that uses threads. Theres something else I also dont understood about FFI: When trying to debug the problem I've written many printf statements but none of them showed on the screen, but now that the example is working I've notice that all printed text appears once I exit ghci. Why is that happening? From carter.schonwald at gmail.com Tue Nov 19 17:15:24 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Tue, 19 Nov 2013 12:15:24 -0500 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: <1384877210.15424.5.camel@shum-lt> <1384879803.15424.11.camel@shum-lt> Message-ID: There's a flag you can pass to ghci for that thread local issue. I forget what it is, but it should be in the manual. On Tuesday, November 19, 2013, Thiago Padilha wrote: > On Tue, Nov 19, 2013 at 1:50 PM, Yuras Shumovich > > wrote: > > > > Ok, then I don't see anything obviously wrong. > > > > I was embeding v8 into haskell project few months ago, and almost the > > same code works for me. > > > > I don't have v8 installed right now, so I can't try your code at the > > moment, but I see only one not trivial difference with my code. I'm > > creating isolate manually, and you are using the default one. Check that > > Isolate::GetCurrent() returns anything. I can imaging that your code is > > running in unbound green thread, or it is bound to OS thread other then > > the main one. v8 use thread local storage, that can be the issue. > > Yuras, you are correct now :) > > I've replaced the first line by these: > > Isolate* isolate = Isolate::New(); > // Sets this isolate as the entered one for the current thread > isolate->Enter(); > > And the example worked as expected. Thanks for this very useful tip. > > I still dont understand why ghci is not using the default thread to > run the binding, but from now on I will be more alert when binding to > libraries that uses threads. > > Theres something else I also dont understood about FFI: When trying to > debug the problem I've written many printf statements but none of > them showed on the screen, but now that the example is working I've > notice that all printed text appears once I exit ghci. Why is that > happening? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From allbery.b at gmail.com Tue Nov 19 17:17:12 2013 From: allbery.b at gmail.com (Brandon Allbery) Date: Tue, 19 Nov 2013 12:17:12 -0500 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: <1384877210.15424.5.camel@shum-lt> <1384879803.15424.11.camel@shum-lt> Message-ID: On Tue, Nov 19, 2013 at 12:13 PM, Thiago Padilha wrote: > I still dont understand why ghci is not using the default thread to > run the binding, but from now on I will be more alert when binding to > libraries that uses threads. > -fno-default-sandbox ? (this changes in upcoming ghci, I believe) > Theres something else I also dont understood about FFI: When trying to > debug the problem I've written many printf statements but none of > them showed on the screen, but now that the example is working I've > notice that all printed text appears once I exit ghci. Why is that > happening? > Because C/C++ stdio buffers by default, as does Haskell's --- but they are independent buffers, so the state of the Haskell buffering mode is not relevant to C/C++ or vice versa and flushing in one does not affect the other. Evidently the C one is only getting flushed in an atexit() hook. (You may want to look at setvbuf().) -- brandon s allbery kf8nh sine nomine associates allbery.b at gmail.com ballbery at sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net -------------- next part -------------- An HTML attachment was scrubbed... URL: From svenpanne at gmail.com Tue Nov 19 19:02:22 2013 From: svenpanne at gmail.com (Sven Panne) Date: Tue, 19 Nov 2013 20:02:22 +0100 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: <1384879803.15424.11.camel@shum-lt> References: <1384877210.15424.5.camel@shum-lt> <1384879803.15424.11.camel@shum-lt> Message-ID: 2013/11/19 Yuras Shumovich : > [...] but I see only one not trivial difference with my code. I'm > creating isolate manually, and you are using the default one. Check that > Isolate::GetCurrent() returns anything. I can imaging that your code is > running in unbound green thread, or it is bound to OS thread other then > the main one. v8 use thread local storage, that can be the issue. Yes, v8 uses TLS to store the current Isolate (= VM instance) for historical reasons, and if you want to use the default Isolate (created even before main() is entered) things get tricky if you are not using it from the main thread. Furthermore, if you use an Isolate from various threads (sequentially, re-entry is not allowed) you have to use v8's Locker to tell v8 what's happening. Isolate::Scope has to be used to tell v8 when you are switching between several Isolates in a single thread. This is all sub-optimal (<- huge understatement) and we regret the introduction of TLS in v8 every single day, it is a constant source of bugs, confusion and complexity. Having said that, we are currently in the process of removing TLS and make the Isolate very explicit in v8's API. But this is easier said than done, given all the various complex embedders v8 has (Chrome, node.js, ...). In a bright future, v8 uses no TLS, all Isolates are explicit, there is no default Isolate and no "current Isolate", and Isolate::Scope and Locker are merged. Until then things are a bit tricky, but you can make your life easier by building a debug version of v8, which has tons of assertions, making stuff like a NULL Isolate blindingly obvious. Choosing a combination of 2 multi-threaded runtimes for learning purposes has a slightly masochistic touch... ;-) From tpadilha84 at gmail.com Tue Nov 19 20:22:54 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Tue, 19 Nov 2013 18:22:54 -0200 Subject: [Haskell-cafe] Need help with very simple C++ FFI call In-Reply-To: References: <1384877210.15424.5.camel@shum-lt> <1384879803.15424.11.camel@shum-lt> Message-ID: On Tue, Nov 19, 2013 at 4:02 PM, Sven Panne wrote: > Choosing a combination of 2 multi-threaded runtimes for learning > purposes has a slightly masochistic touch... ;-) Its as they say: "No pain, no gain". Anyway, thank you all for the help From targen at gmail.com Wed Nov 20 02:21:20 2013 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Tue, 19 Nov 2013 21:51:20 -0430 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? Message-ID: Hi list, I?m looking for a rather specific point in the design space for database access libraries in Haskell and I?m having some trouble figuring out whether any existing library covers my use cases. Specifically, I need to 1. get a Yesod application to access a PostgreSQL database without having to reinvent the universe to get them decently integrated, 2. write queries in an EDSL with a good approach to composability and decent static verification against some declared form of the database objects, 3. be able to perform joins 4. be able to specify the schema name for each database object used in queries These are the closest solutions I?ve found: * HaskellDB: seems like the best approach to the EDSL issue and it?s certainly capable of performing joins, and I haven?t looked into schema names, but it seems possible ? but it seems to be poorly maintained and somewhat abandoned, and comfortable Yesod integration doesn?t sound like a lot of fun. * Persistent: it?s perfectly integrated into Yesod, and together with Esqueleto, it provides a nice, typesafe and fully expressive EDSL ? but, as far as I can tell, there is no support for specifying schema names, which is essential for my use case. * Groundhog: Yesod integration is reasonable since Persistent borrowed a good bit of its design, and after a few weeks of experimenting, I?ve got it pretty much worked out by now, but while it certainly takes an interesting and solid approach to the EDSL issue, it seems completely incapable of performing joins, and hence its usability is very heavily limited ? I don?t fancy creating SQL views for each and every join I need. * postgresql-simple: minimal Yesod integration shouldn?t be too uncomfortable, since Persistent uses it internally anyway, and it can certainly do joins and use whatever fancy SQL magic I could ever want to write, certainly including schema names ? but it doesn?t really do anything for statically checking queries against a schema specification or for composability and code reuse, and I might as well just use Persistent to do raw SQL. I?ve breifly looked at modifying Persistent to add support for schema names, but I got lost in the source code very quickly, and I worry about the fact that it requires serial primary keys ? Groundhog is *very* nice in that it has a great approach to DBMS-specific syntax and other things I?ll probably need (non-numeric and composite keys), but it?s really a shame that it can?t do joins, and the workaround with views sort of defeats the purpose of SQL abstraction. I?m not sure what to do about this. Is there some grand unified relational database access library I just haven?t found, or is a pull request the only solution? From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Nov 20 02:42:05 2013 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 20 Nov 2013 02:42:05 +0000 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? In-Reply-To: References: Message-ID: <20131120024205.GO16302@weber> On Tue, Nov 19, 2013 at 09:51:20PM -0430, Manuel G?mez wrote: > I?m looking for a rather specific point in the design space for > database access libraries in Haskell and I?m having some trouble > figuring out whether any existing library covers my use cases. > > Specifically, I need to > > 1. get a Yesod application to access a PostgreSQL database without > having to reinvent the universe to get them decently integrated, > > 2. write queries in an EDSL with a good approach to composability and > decent static verification against some declared form of the database > objects, > > 3. be able to perform joins > > 4. be able to specify the schema name for each database object used in queries I'm working on a Haskell relational query EDSL similar in spirit to HaskellDB. It certainly satisfies your requirements 2 and 3. I'm not exactly sure what exactly your requirements 1 and 4 mean but feel free to contact me off list and we can discuss it further. Tom From mle+hs at mega-nerd.com Wed Nov 20 03:50:06 2013 From: mle+hs at mega-nerd.com (Erik de Castro Lopo) Date: Wed, 20 Nov 2013 14:50:06 +1100 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? In-Reply-To: References: Message-ID: <20131120145006.ddf8d130105a031a7f066841@mega-nerd.com> Manuel G?mez wrote: > Hi list, > > I?m looking for a rather specific point in the design space for > database access libraries in Haskell and I?m having some trouble > figuring out whether any existing library covers my use cases. > > Specifically, I need to > > 1. get a Yesod application to access a PostgreSQL database without > having to reinvent the universe to get them decently integrated, > > 2. write queries in an EDSL with a good approach to composability and > decent static verification against some declared form of the database > objects, > > 3. be able to perform joins > > 4. be able to specify the schema name for each database object used in queries > * Persistent: it?s perfectly integrated into Yesod, and together > with Esqueleto, it provides a nice, typesafe and fully expressive EDSL > ? but, as far as I can tell, there is no support for specifying schema > names, which is essential for my use case. I'm not sure of what you mean here. DO you mean that you already have a database and schema and you now want to connect Persisent/Esqueleto to it without changing the existing schema? Erik (a keen user of Persistent/Esqueleto) -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/ From targen at gmail.com Wed Nov 20 05:11:45 2013 From: targen at gmail.com (=?UTF-8?Q?Manuel_G=C3=B3mez?=) Date: Wed, 20 Nov 2013 00:41:45 -0430 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? In-Reply-To: <20131120145006.ddf8d130105a031a7f066841@mega-nerd.com> References: <20131120145006.ddf8d130105a031a7f066841@mega-nerd.com> Message-ID: On Tue, Nov 19, 2013 at 11:20 PM, Erik de Castro Lopo wrote: > Manuel G?mez wrote: >> * Persistent: it?s perfectly integrated into Yesod, and together >> with Esqueleto, it provides a nice, typesafe and fully expressive EDSL >> ? but, as far as I can tell, there is no support for specifying schema >> names, which is essential for my use case. > > I'm not sure of what you mean here. DO you mean that you already have > a database and schema and you now want to connect Persisent/Esqueleto > to it without changing the existing schema? Hi Erik, Indeed, that?s more or less the situation I?m facing. Perhaps the overloading of the term ?schema? is a problem here: what I specifically meant with this point is the namespacing mechanism present in (some implementations of) SQL databases: database object names are bound within namespaces called schemas, and a name can be qualified with the name of the schema, separated by a dot; hence a table named `"with spaces"` in a schema/namespace called `"some tables"` would be used qualified as `"some tables"."with spaces"`. I have an existing schema (read: database) with many schemas (read: namespaces) and I need to do joins between tables in them. The names have spaces and unusual bits of Unicode, and the dot that separates the schema name from the object name mustn?t be quoted, so it?s not simply a matter of specifying a complex name to Persistent, as escaping and quoting wouldn?t be done correctly. A workaround could be to put everything in a single namespace and use prefixes in names, but that causes other issues for me (other tools would break). The other issue I have with Persistent+Esqueleto is that the database I have to work with has some composite or otherwise non?serial-integer primary keys, and I understand Persistent requires a serial primary key. I could probably work around this, though. From alex.solla at gmail.com Wed Nov 20 06:57:44 2013 From: alex.solla at gmail.com (Alexander Solla) Date: Tue, 19 Nov 2013 22:57:44 -0800 Subject: [Haskell-cafe] QuickCheck-like tests with GHC.Generic deriving Message-ID: I am looking for a QuickCheck-like test framework which exposes data generators (like QuickCheck's Arbitrary class) with Generic defaults. I have seen that SmallCheck's Serial class has Generic defaults, but it isn't particularly good for my purpose (I'd like to use the generator to populate deeply nested data types, and SmallCheck's generator requires computing a few million values before I get any interesting ones) Something "random" would be more useful for my purpose. I know that the plan depends on my vaguely abusing the test-case generator, but I plan on doing some testing anyway, so I figured I should reuse the instance. That said, I'd be willing to use any random value type class with Generic-default instances. Does anybody have any suggestions? -------------- next part -------------- An HTML attachment was scrubbed... URL: From lucas.dicioccio at gmail.com Wed Nov 20 07:21:36 2013 From: lucas.dicioccio at gmail.com (lucas di cioccio) Date: Wed, 20 Nov 2013 08:21:36 +0100 Subject: [Haskell-cafe] QuickCheck-like tests with GHC.Generic deriving In-Reply-To: References: Message-ID: Hi I have seen that SmallCheck's Serial class has Generic defaults, but it > isn't particularly good for my purpose (I'd like to use the generator to > populate deeply nested data types, and SmallCheck's generator requires > computing a few million values before I get any interesting ones) > Something "random" would be more useful for my purpose. > Maybe you can make your data instances of Random http://hackage.haskell.org/package/random-1.0.0.2/docs/System-Random.html#t:Random and https://www.fpcomplete.com/school/starting-with-haskell/libraries-and-frameworks/randoms --Lucas > I know that the plan depends on my vaguely abusing the test-case > generator, but I plan on doing some testing anyway, so I figured I should > reuse the instance. > > That said, I'd be willing to use any random value type class with > Generic-default instances. > > Does anybody have any suggestions? > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpm at cs.uu.nl Wed Nov 20 08:02:00 2013 From: jpm at cs.uu.nl (=?ISO-8859-1?Q?Jos=E9_Pedro_Magalh=E3es?=) Date: Wed, 20 Nov 2013 08:02:00 +0000 Subject: [Haskell-cafe] QuickCheck-like tests with GHC.Generic deriving In-Reply-To: References: Message-ID: Hello, regular has a generic implementation of Arbitrary that even lets you specify size and give each constructor a particular frequency (see Generics.Regular.Functions.Arbitrary). If you find it useful, I'm sure it can be ported to the generic-derivingpackage, so that it works with GHC.Generics (or maybe to some generic-deriving-extras package to avoid making generic-deriving depend on QuickCheck). Cheers, Pedro On Wed, Nov 20, 2013 at 6:57 AM, Alexander Solla wrote: > I am looking for a QuickCheck-like test framework which exposes data > generators (like QuickCheck's Arbitrary class) with Generic defaults. > > I have seen that SmallCheck's Serial class has Generic defaults, but it > isn't particularly good for my purpose (I'd like to use the generator to > populate deeply nested data types, and SmallCheck's generator requires > computing a few million values before I get any interesting ones) > Something "random" would be more useful for my purpose. > > I know that the plan depends on my vaguely abusing the test-case > generator, but I plan on doing some testing anyway, so I figured I should > reuse the instance. > > That said, I'd be willing to use any random value type class with > Generic-default instances. > > Does anybody have any suggestions? > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jv at informatik.uni-bonn.de Wed Nov 20 12:06:50 2013 From: jv at informatik.uni-bonn.de (Janis Voigtlaender) Date: Wed, 20 Nov 2013 13:06:50 +0100 Subject: [Haskell-cafe] QuickCheck-like tests with GHC.Generic, deriving Message-ID: <528CA5DA.3020801@informatik.uni-bonn.de> Alexander Solla writes: > I am looking for a QuickCheck-like test framework which exposes data > generators (like QuickCheck's Arbitrary class) with Generic defaults. > > I have seen that SmallCheck's Serial class has Generic defaults, but it > isn't particularly good for my purpose (I'd like to use the generator to > populate deeply nested data types, and SmallCheck's generator requires > computing a few million values before I get any interesting ones) > Something "random" would be more useful for my purpose. > > I know that the plan depends on my vaguely abusing the test-case generator, > but I plan on doing some testing anyway, so I figured I should reuse the > instance. > > That said, I'd be willing to use any random value type class with > Generic-default instances. > > Does anybody have any suggestions? I think what you want is: http://hackage.haskell.org/package/testing-feat See also the paper: http://dx.doi.org/10.1145/2430532.2364515 Specifically, the technique solves the "populate deeply nested data types" issue. You can efficiently jump to the so-and-so-many-millionth value in the enumeration without having to create all smaller values. Best, Janis. From dag.odenhall at gmail.com Wed Nov 20 14:37:19 2013 From: dag.odenhall at gmail.com (Dag Odenhall) Date: Wed, 20 Nov 2013 15:37:19 +0100 Subject: [Haskell-cafe] QuickCheck-like tests with GHC.Generic deriving In-Reply-To: References: Message-ID: There?s a branch adding support for Generic deriving of Arbitrary, more than a year old. I always wondered why it was never merged into master and released on Hackage. On Wed, Nov 20, 2013 at 9:02 AM, Jos? Pedro Magalh?es wrote: > Hello, > > regular has a generic > implementation of Arbitrary that even lets you specify size and > give each constructor a particular frequency (see > Generics.Regular.Functions.Arbitrary). > If you find it useful, I'm sure it can be ported to the generic-derivingpackage, so that it > works with GHC.Generics (or maybe to some generic-deriving-extras package > to avoid > making generic-deriving depend on QuickCheck). > > > Cheers, > Pedro > > > On Wed, Nov 20, 2013 at 6:57 AM, Alexander Solla wrote: > >> I am looking for a QuickCheck-like test framework which exposes data >> generators (like QuickCheck's Arbitrary class) with Generic defaults. >> >> I have seen that SmallCheck's Serial class has Generic defaults, but it >> isn't particularly good for my purpose (I'd like to use the generator to >> populate deeply nested data types, and SmallCheck's generator requires >> computing a few million values before I get any interesting ones) >> Something "random" would be more useful for my purpose. >> >> I know that the plan depends on my vaguely abusing the test-case >> generator, but I plan on doing some testing anyway, so I figured I should >> reuse the instance. >> >> That said, I'd be willing to use any random value type class with >> Generic-default instances. >> >> Does anybody have any suggestions? >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk Wed Nov 20 16:57:44 2013 From: tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk (Tom Ellis) Date: Wed, 20 Nov 2013 16:57:44 +0000 Subject: [Haskell-cafe] Product Profunctor and Contravariant In-Reply-To: <20130929094415.GQ29628@weber> References: <20130929094415.GQ29628@weber> Message-ID: <20131120165744.GQ16302@weber> On Sun, Sep 29, 2013 at 10:44:15AM +0100, Tom Ellis wrote: > Does anyone recognise these typeclasses: > > import Data.Profunctor (Profunctor) > import Data.Functor.Contravariant (Contravariant) > > class Profunctor p => ProductProfunctor p where > empty :: p () () > (***!) :: p a b -> p a' b' -> p (a, a') (b, b') > > class Contravariant f => ProductContravariant f where > point :: f () > (***<) :: f a -> f b -> f (a, b) It now seems to me that these are equivalent to Profunctor with Applicative, and Contravariant with Monoid respectively: import Data.Profunctor import Control.Applicative hiding (empty) import Data.Functor.Contravariant import Data.Monoid empty :: (Applicative (p ())) => p () () empty = pure () (***!) :: (Applicative (p (a, a')), Profunctor p) => p a b -> p a' b' -> p (a, a') (b, b') p ***! p' = (,) <$> lmap fst p <*> lmap snd p' point :: Monoid (f ()) => f () point = mempty (***<) :: (Monoid (f (a, b)), Contravariant f) => f a -> f b -> f (a, b) p ***< p' = contramap fst p <> contramap snd p' So my question becomes: are there standard definitions of these somewhere? Thanks, Tom From lykahb at gmail.com Wed Nov 20 18:44:20 2013 From: lykahb at gmail.com (Boris Lykah) Date: Wed, 20 Nov 2013 13:44:20 -0500 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? In-Reply-To: References: <20131120145006.ddf8d130105a031a7f066841@mega-nerd.com> Message-ID: Hi all, As the author of Groundhog library I agree that it and Persistent/Esqueleto have strengths in different areas and none of them fully matches power of SQL. Grounhog has better support of SQL expressions and relational schemas (composite keys, schemas, indexes, etc.) Persistent cannot do a query with projections and nested function calls like: project (upper (FirstNameField `append` SecondNameField), toArith BalanceField * 10) $ lower UserNameField `like` "%smith%" On the other hand, while Groundhog can query only one table at a time, Persistent combined with Esqueleto gives relational query capabilities that match a lot of the SQL syntax (notably excluding column aliasing). I like Esqueleto and it seems to be easy to port to Groundhog. The ported codebase may be even smaller because Groundhog already has flexible functions and comparison operators which uniformly support fields and constant values. Alas, I don't have enough time to do this. If someone is interested in porting I will be happy to help. Thanks, Boris On Wed, Nov 20, 2013 at 12:11 AM, Manuel G?mez wrote: > On Tue, Nov 19, 2013 at 11:20 PM, Erik de Castro Lopo > wrote: >> Manuel G?mez wrote: >>> * Persistent: it?s perfectly integrated into Yesod, and together >>> with Esqueleto, it provides a nice, typesafe and fully expressive EDSL >>> ? but, as far as I can tell, there is no support for specifying schema >>> names, which is essential for my use case. >> >> I'm not sure of what you mean here. DO you mean that you already have >> a database and schema and you now want to connect Persisent/Esqueleto >> to it without changing the existing schema? > > Hi Erik, > > Indeed, that?s more or less the situation I?m facing. Perhaps the > overloading of the term ?schema? is a problem here: what I > specifically meant with this point is the namespacing mechanism > present in (some implementations of) SQL databases: database object > names are bound within namespaces called schemas, and a name can be > qualified with the name of the schema, separated by a dot; hence a > table named `"with spaces"` in a schema/namespace called `"some > tables"` would be used qualified as `"some tables"."with spaces"`. > > I have an existing schema (read: database) with many schemas (read: > namespaces) and I need to do joins between tables in them. The names > have spaces and unusual bits of Unicode, and the dot that separates > the schema name from the object name mustn?t be quoted, so it?s not > simply a matter of specifying a complex name to Persistent, as > escaping and quoting wouldn?t be done correctly. A workaround could > be to put everything in a single namespace and use prefixes in names, > but that causes other issues for me (other tools would break). > > The other issue I have with Persistent+Esqueleto is that the database > I have to work with has some composite or otherwise non?serial-integer > primary keys, and I understand Persistent requires a serial primary > key. I could probably work around this, though. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Regards, Boris From maarten.dungen at gmail.com Thu Nov 21 09:01:47 2013 From: maarten.dungen at gmail.com (Maarten Dungen) Date: Thu, 21 Nov 2013 10:01:47 +0100 Subject: [Haskell-cafe] Compiling to STG problem Message-ID: Dear all, While trying to retrieve the STG using ghc I bumped into the following problem: I try to compile the source file in a more or less standard way, found in many examples on the web: ... setTargets targets _ <- load LoadAllTargets mgraph <- depanal [] False mapM_ (compileModSummary) mgraph Then I compile the individual files through the following pipeline (also more or less standard, I thought): compileModSummary = do ... stg <- parseModule theMod >>= typecheckModule >>= desugarModule >>= liftIO . hscSimplify env . coreModule >>= liftIO . tidyProgram env >>= prepPgm env . fst >>= liftIO . coreToStg dynflags ? Then I do a dump to (just to check the results): writeFile ?filename? (show . showOutputable $ stg) The problem is, if I do a stg dump from the command line (like -ddump-stg --make Main.hs (where is the intended compiler program) the dump is different from the stg dump I do at writefile, to the extent that functions are missing, which gives problems when linking the results. They are numbered functions, like ?value1?, etc. I?m not very much into the ghcmake stuff, and I?m probably missing a lot, however I have been struggling with this for a couple of days now, and it is not getting any clearer. I guess my question would be, why is there a difference, and how could I avoid this? Any help or pointers appreciated. kind regards, Maarten p.s. This is just pseudo code. I necessary, I could probably strip my sources into a working example that displays the problem, if that would help. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tpadilha84 at gmail.com Thu Nov 21 16:56:46 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Thu, 21 Nov 2013 14:56:46 -0200 Subject: [Haskell-cafe] Dynamic package information with Setup.hs Message-ID: I'm writing a cabal package that provides bindings to a C library. I've written a shell script that will download and build this C library to a subdirectory of the user's HOME(~/.cabal-tmp/{lib,include}). Currently I have the following Setup.hs that automatically runs the script before installing: import Distribution.Simple import Distribution.Simple.Setup import Distribution.PackageDescription import System.Process main :: IO () main = defaultMainWithHooks simpleUserHooks { preConf = buildDeps } buildDeps :: Args -> ConfigFlags -> IO HookedBuildInfo buildDeps _ _ = do rawSystem "sh" ["./scripts/build-deps.sh"] return emptyHookedBuildInfo I've tried adding the following lines: extra-lib-dirs: ${HOME}/.cabal-tmp/lib include-dirs: ${HOME}/.cabal-tmp/include But it complains about syntax errors and I found no other way to expand the user's HOME directory in the .cabal file. If I use relative paths in the 'extra-lib-dirs' an error is reported(cabal 1.16). Full paths are also needed for linking against this package as ghc needs to know the linker flags for the native library. Obviously I cant know the full path the library will be installed in advance, as I dont know the HOME directory of the user installing the package until the Setup.hs script is running. My question: How can I use the Setup.hs hooks to update those two fields dynamically? From simons at cryp.to Thu Nov 21 20:10:45 2013 From: simons at cryp.to (Peter Simons) Date: Thu, 21 Nov 2013 21:10:45 +0100 Subject: [Haskell-cafe] Dynamic package information with Setup.hs References: Message-ID: <87a9gxqzwa.fsf@write-only.cryp.to> Hi Thiago, > I've written a shell script that will download and build this C > library to a subdirectory of the user's > HOME(~/.cabal-tmp/{lib,include}). please don't do that. It's notoriously hard to get this use case right so that it works for everybody. Some people may want that library built as a shared object; others may want it with profiling and/or debug information. The next guy may want that library compiled with a different version of GCC than the one GHC uses by default. Others may want to link bindings to a copy of that library that's installed in their system (under a path that you cannot guess). What you should do is to add Extra-Libraries: my-external-library to your Cabal file and trust that the user specifies appropriate flags at configure time to ensure that the compiler can find it if necessary. You can distribute a shell script that tries to build the C library and the Haskell library with convenient defaults, i.e. your script should call cabal configure --extra-include-dirs=PATH --extra-lib-dirs=PATH with appropriate paths after having built the C code, but please make sure that your Haskell package works fine for people who want to build the C library themselves without using your script. Take care, Peter From dagitj at gmail.com Thu Nov 21 21:20:39 2013 From: dagitj at gmail.com (Jason Dagit) Date: Thu, 21 Nov 2013 13:20:39 -0800 Subject: [Haskell-cafe] ANN: New Haskell.org committee members Message-ID: The Haskell.org committee has selected new members following the October self-nomination period. The new members are: * Adam Foltzer * Nicolas Wu * Andres Loeh Thank you to everyone who submitted a self-nomation. We had many very strong candidates and it was not easy for us to narrow the selection down to just three people. I would like to add, that if you've self-nominated in the past but not be picked, please self-nominate again in the future. Cheers, Jason -------------- next part -------------- An HTML attachment was scrubbed... URL: From tpadilha84 at gmail.com Thu Nov 21 21:25:34 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Thu, 21 Nov 2013 19:25:34 -0200 Subject: [Haskell-cafe] Dynamic package information with Setup.hs In-Reply-To: <87a9gxqzwa.fsf@write-only.cryp.to> References: <87a9gxqzwa.fsf@write-only.cryp.to> Message-ID: On Thu, Nov 21, 2013 at 5:10 PM, Peter Simons wrote: > You can distribute a shell script that tries to build the C library and > the Haskell library with convenient defaults, i.e. your script should > call > > cabal configure --extra-include-dirs=PATH --extra-lib-dirs=PATH > > with appropriate paths after having built the C code, but please make > sure that your Haskell package works fine for people who want to build > the C library themselves without using your script. Peter, My reason for taking this route is to simplify the installation by making the C library a transparent part of the package. This is similar to the haskell bindings to zlib( the difference is that it bundles zlib source code in the 'cbits' directory since zlib build is simple everything just works). This is common in package managers for other platforms(node.js, python) as it simplifies installation by users that have little experience with building C packages. The goal is to have a generic Setup.hs file that I can use for packaging haskell bindings to libraries that have non-trivial build procedures, and still have everything working after a simple 'cabal install LIB' With that said, I agree that allowing customization by advanced users is essential. Like you suggested, I already use the 'extra-libraries' field without specifying extra-lib-dirs/include-dirs. I still would like to follow the automatic build route with the following changes: - The Setup.hs file will only invoke the download/build script if the --extra-lib-dirs/--include-dirs weren't passed to cabal(I believe the Args argument for the preConf hook is suitable for that) - An additional flag could be provided for users wanting to build against the system's version of the library. This should hide the installation details by providing reasonable defaults (like a library version that is guaranteed to work with the binding) while still giving full control to advanced users. What do you think? From carter.schonwald at gmail.com Thu Nov 21 21:58:09 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Thu, 21 Nov 2013 16:58:09 -0500 Subject: [Haskell-cafe] Dynamic package information with Setup.hs In-Reply-To: References: <87a9gxqzwa.fsf@write-only.cryp.to> Message-ID: you should look at libs that have c libs embedded in them approach it. a good simple example would be lz4hs. Its really quite simple and doesn't require crazy hacks On Thu, Nov 21, 2013 at 4:25 PM, Thiago Padilha wrote: > On Thu, Nov 21, 2013 at 5:10 PM, Peter Simons wrote: > > You can distribute a shell script that tries to build the C library and > > the Haskell library with convenient defaults, i.e. your script should > > call > > > > cabal configure --extra-include-dirs=PATH --extra-lib-dirs=PATH > > > > with appropriate paths after having built the C code, but please make > > sure that your Haskell package works fine for people who want to build > > the C library themselves without using your script. > > Peter, > > My reason for taking this route is to simplify the installation by > making the > C library a transparent part of the package. This is similar to the haskell > bindings to zlib( the difference is that it bundles zlib source code in the > 'cbits' directory since zlib build is simple everything just works). > > This is common in package managers for other platforms(node.js, > python) as it simplifies installation by users that have little experience > with > building C packages. > > The goal is to have a generic Setup.hs file that I can use for packaging > haskell bindings to libraries that have non-trivial build procedures, and > still > have everything working after a simple 'cabal install LIB' > > With that said, I agree that allowing customization by advanced users is > essential. Like you suggested, I already use the 'extra-libraries' field > without > specifying extra-lib-dirs/include-dirs. > > I still would like to follow the automatic build route with the following > changes: > > - The Setup.hs file will only invoke the download/build script if the > --extra-lib-dirs/--include-dirs weren't passed to cabal(I believe the > Args > argument for the preConf hook is suitable for that) > - An additional flag could be provided for users wanting to build > against the > system's version of the library. > > This should hide the installation details by providing reasonable > defaults > (like a library version that is guaranteed to work with the binding) while > still > giving full control to advanced users. > > What do you think? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan.miljenovic at gmail.com Fri Nov 22 00:37:10 2013 From: ivan.miljenovic at gmail.com (Ivan Lazar Miljenovic) Date: Fri, 22 Nov 2013 11:37:10 +1100 Subject: [Haskell-cafe] Dynamic package information with Setup.hs In-Reply-To: <87a9gxqzwa.fsf@write-only.cryp.to> References: <87a9gxqzwa.fsf@write-only.cryp.to> Message-ID: On 22 November 2013 07:10, Peter Simons wrote: > Hi Thiago, > > > I've written a shell script that will download and build this C > > library to a subdirectory of the user's > > HOME(~/.cabal-tmp/{lib,include}). > > please don't do that. It's notoriously hard to get this use case right > so that it works for everybody. Some people may want that library built > as a shared object; others may want it with profiling and/or debug > information. The next guy may want that library compiled with a > different version of GCC than the one GHC uses by default. Others may > want to link bindings to a copy of that library that's installed in > their system (under a path that you cannot guess). Not to mention that it doesn't work well for people wanting to build it on a distro level (or even to compile and distribute across multiple machines). > > What you should do is to add > > Extra-Libraries: my-external-library > > to your Cabal file and trust that the user specifies appropriate flags > at configure time to ensure that the compiler can find it if necessary. > > You can distribute a shell script that tries to build the C library and > the Haskell library with convenient defaults, i.e. your script should > call > > cabal configure --extra-include-dirs=PATH --extra-lib-dirs=PATH > > with appropriate paths after having built the C code, but please make > sure that your Haskell package works fine for people who want to build > the C library themselves without using your script. > > Take care, > Peter > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe -- Ivan Lazar Miljenovic Ivan.Miljenovic at gmail.com http://IvanMiljenovic.wordpress.com From konn.jinro at gmail.com Sat Nov 23 09:49:39 2013 From: konn.jinro at gmail.com (Hiromi ISHII) Date: Sat, 23 Nov 2013 18:49:39 +0900 Subject: [Haskell-cafe] Is there any "purely algebraic" Linear Algebra library? Message-ID: Hi, I'm recently implementing computational algebra library (available on http://hackage.haskell.org/package/computational-algebra ), build on top of ekmett's `algebra` library. My `computational-algebra` library currently provides very basic functionalities which is rather slow. There are many techniques to speeding up calculation utilizing linear algebra. So I want to implement those efficient algorithms. But, I couldn't find any *purely algebraic* linear-algebra library. As for the most famous library `hmatrix`, this library requires "Field" to be convertible between Double or Real numbers, and due to such constraints, it cannot treat genral coefficient fields, such as Rational (which is not closed under sin or exponentials) or finite fields. So I have to give up using this library. I noticed there are some additional candidates such as: * `linear` by Edward Kmett * `vector-space` by Conal Elliot But neither of them provides necessary functionalities which is available in `hmatrix`, such as determinant for arbitrary dimensional matrices and rank function , etc. Is there any other library providing the functionalities like above which can be used with general coefficient fields? Or is there any good document on the efficient implementation for linear algebra on Haskell? -- Hiromi ISHII konn.jinro at gmail.com From edgar.klerks at gmail.com Sat Nov 23 11:09:23 2013 From: edgar.klerks at gmail.com (Edgar Klerks) Date: Sat, 23 Nov 2013 12:09:23 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: If you use conque, you can run a GHCI session in vim: http://code.google.com/p/conque/ That works pretty well. Neocomplcache +ghcmod + neco-ghc delivers good support for auto-completion. Syntastic will annotate errors in your source file. Gundo for reverting and viewing local changes, vim stores internally a tree with changes. With some configuration it can remember changes for days. The only drawback is that you can always hit u, because your last weeks changes are still remembered. For searching in files, I use ack.vim. And for moving to files, I use ctrl-p, which let you open files with little typing. You should also look into sessions (a vim feature). With this you can save your current development environment and start from there. Bundle 'neocomplcache' Bundle 'surround.vim' Bundle 'eagletmt/neco-ghc' Bundle "eagletmt/ghcmod-vim" Bundle 'ctrlp.vim' Bundle 'ack.vim' Bundle 'Gundo' Bundle 'scrooloose/syntastic' Bundle "Shougo/vimproc" There are a lot of different plugins I use, but these have proven themselves useful, also for general development. I miss a program for creating tagfiles for haskell. This would be handy, because you can jump quickly to definition file with this. Greets, Edgar On Fri, Nov 8, 2013 at 8:44 PM, Corentin Dupont wrote: > Hi cafe, > I would like to know which IDE are you using? > I use Leksah, I like the GUI design and constant compilation process. > However, the development seems to be slowing down: last version date from > early 2012. The installation process is very painful. > > There is FPComplete IDE coming up, but it's commercial. > I'm experimenting with it, anyway: how to compile using cabal files? It > doesn't seem to recognize them. Will there be an off-line version? > > I'm interested to know if you are using vim to develop: which extension > are you using? I'm interested in continuous compilation, project files > browsing, code completion, search-in-files. > > Best, > Corentin > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.dupont at gmail.com Sat Nov 23 11:45:12 2013 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Sat, 23 Nov 2013 12:45:12 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: Hi all! Thanks for you responses. Here is a sum-up so far. The vertical bars is the number of persons using this one among the replies. - Emacs + haskell-mode IIIII - sublime with sublime-haskell I - vim IIII (see tips from ????????? ???????, Marc Weber, Schell Scivally, Edgar Klerks) - EclipseFP II - Leksah III - WinEdt + MikTex Please tell me if I missed something :) Best, Corentin On Sat, Nov 23, 2013 at 12:09 PM, Edgar Klerks wrote: > If you use conque, you can run a GHCI session in vim: > http://code.google.com/p/conque/ That works pretty well. > > Neocomplcache +ghcmod + neco-ghc delivers good support for auto-completion. > > Syntastic will annotate errors in your source file. > > Gundo for reverting and viewing local changes, vim stores internally a > tree with changes. With some configuration it can remember changes for > days. The only drawback is that you can always hit u, because your last > weeks changes are still remembered. > > For searching in files, I use ack.vim. > > And for moving to files, I use ctrl-p, which let you open files with > little typing. > > You should also look into sessions (a vim feature). With this you can save > your current development environment and start from there. > > Bundle 'neocomplcache' > Bundle 'surround.vim' > Bundle 'eagletmt/neco-ghc' > Bundle "eagletmt/ghcmod-vim" > Bundle 'ctrlp.vim' > Bundle 'ack.vim' > Bundle 'Gundo' > Bundle 'scrooloose/syntastic' > Bundle "Shougo/vimproc" > > There are a lot of different plugins I use, but these have proven > themselves useful, also for general development. > > > I miss a program for creating tagfiles for haskell. This would be handy, > because you can jump quickly to definition file with this. > > Greets, > > Edgar > > > On Fri, Nov 8, 2013 at 8:44 PM, Corentin Dupont > wrote: > >> Hi cafe, >> I would like to know which IDE are you using? >> I use Leksah, I like the GUI design and constant compilation process. >> However, the development seems to be slowing down: last version date from >> early 2012. The installation process is very painful. >> >> There is FPComplete IDE coming up, but it's commercial. >> I'm experimenting with it, anyway: how to compile using cabal files? It >> doesn't seem to recognize them. Will there be an off-line version? >> >> I'm interested to know if you are using vim to develop: which extension >> are you using? I'm interested in continuous compilation, project files >> browsing, code completion, search-in-files. >> >> Best, >> Corentin >> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ramsdell0 at gmail.com Sat Nov 23 16:05:43 2013 From: ramsdell0 at gmail.com (John D. Ramsdell) Date: Sat, 23 Nov 2013 11:05:43 -0500 Subject: [Haskell-cafe] Hackage home page content should feature cabal install instructions Message-ID: As I read the content at hackage.haskell.org, I thought about what a new user interesting in using the site would like to know. The most important question is how to use the programs and libraries provided by the site. Thus, the content that should be featured is how to install packages using cabal install assuming Haskell platform has been installed. Exploring the site might be the next topic, followed by the support section and the other topics. In short, most users want to know how to use the packages provided by the site, and not so much about the server that powers the site. John -------------- next part -------------- An HTML attachment was scrubbed... URL: From KAction at gnu.org Sat Nov 23 16:44:43 2013 From: KAction at gnu.org (Dmitry Bogatov) Date: Sat, 23 Nov 2013 20:44:43 +0400 Subject: [Haskell-cafe] Stacked return Message-ID: <87fvqnvzic.fsf@gnu.org> Hi, list! I want to write function, that will stack `return` as much times, as necessery. In code, I want <$> magicLift 2 :: IO Int <$> magicLift 2 :: Maybe [Int] both be valid. My best approach is following (not work) {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE UndecidableInstances #-} class Monad m => MonadS m where liftS :: a -> m a instance (Monad m) => MonadS m where liftS = return but <$> :t liftS 2 liftS 2 :: (Monad m, Num a) => m a What would you suggest? -- Best regards, Dmitry Bogatov , Free Software supporter and netiquette guardian. git clone git://kaction.name/rc-files.git --depth 1 GPG: 54B7F00D Html mail and proprietary format attachments are forwarded to /dev/null. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From carter.schonwald at gmail.com Sat Nov 23 17:06:53 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Sat, 23 Nov 2013 12:06:53 -0500 Subject: [Haskell-cafe] Hackage home page content should feature cabal install instructions In-Reply-To: References: Message-ID: Good idea! I'm sure pull requests are welcome for thst! On Saturday, November 23, 2013, John D. Ramsdell wrote: > As I read the content at hackage.haskell.org, I thought about what a new > user interesting in using the site would like to know. The most important > question is how to use the programs and libraries provided by the site. > Thus, the content that should be featured is how to install packages using > cabal install assuming Haskell platform has been installed. > > Exploring the site might be the next topic, followed by the support > section and the other topics. In short, most users want to know how to use > the packages provided by the site, and not so much about the server that > powers the site. > > John > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickolay.kudasov at gmail.com Sat Nov 23 17:21:33 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 23 Nov 2013 21:21:33 +0400 Subject: [Haskell-cafe] Stacked return In-Reply-To: <87fvqnvzic.fsf@gnu.org> References: <87fvqnvzic.fsf@gnu.org> Message-ID: Hi Dmitry, Perhaps you just want monad transformers [1, 2]. If you're not familiar with them, you should probably read [3]. With transformers you'd be able to do this (and more): $ return 2 :: IO Int $ return 2 :: ListT Maybe Int -- this works like Maybe [Int] $ return 2 :: MaybeT [] Int -- this works like [Maybe Int] $ runListT $ return 2 :: Maybe [Int] Just [2] [1] http://hackage.haskell.org/package/transformers [2] http://hackage.haskell.org/package/mtl [3] http://web.cecs.pdx.edu/~mpj/pubs/springschool.html 2013/11/23 Dmitry Bogatov > > Hi, list! > > I want to write function, that will stack `return` as much times, as > necessery. In code, I want > <$> magicLift 2 :: IO Int > <$> magicLift 2 :: Maybe [Int] > both be valid. > > My best approach is following (not work) > > {-# LANGUAGE FlexibleInstances #-} > {-# LANGUAGE UndecidableInstances #-} > > class Monad m => MonadS m where > liftS :: a -> m a > > instance (Monad m) => MonadS m where > liftS = return > > but > <$> :t liftS 2 > liftS 2 :: (Monad m, Num a) => m a > > What would you suggest? > > -- > Best regards, Dmitry Bogatov , > Free Software supporter and netiquette guardian. > git clone git://kaction.name/rc-files.git --depth 1 > GPG: 54B7F00D > Html mail and proprietary format attachments are forwarded to /dev/null. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From KAction at gnu.org Sat Nov 23 17:30:23 2013 From: KAction at gnu.org (Dmitry Bogatov) Date: Sat, 23 Nov 2013 21:30:23 +0400 Subject: [Haskell-cafe] Stacked return In-Reply-To: References: <87fvqnvzic.fsf@gnu.org> Message-ID: <87eh67vxe8.fsf@gnu.org> > Perhaps you just want monad transformers [1, 2]. If you're not familiar > with them, you should probably read [3]. > > With transformers you'd be able to do this (and more): > > $ return 2 :: IO Int > $ return 2 :: ListT Maybe Int -- this works like Maybe [Int] > $ return 2 :: MaybeT [] Int -- this works like [Maybe Int] In fact, I read and used transformers a bit. If I understand correctly, I can only do such things for monads, supported by transformers. So, I cant get (return 2) :: MyWierdMonad (MyAnotherMonad 2) Yes, I know, it have little practical use, but I am insterested about teoretical part of question, magic of ghc. -- Best regards, Dmitry Bogatov , Free Software supporter and netiquette guardian. git clone git://kaction.name/rc-files.git --depth 1 GPG: 54B7F00D Html mail and proprietary format attachments are forwarded to /dev/null. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From nickolay.kudasov at gmail.com Sat Nov 23 17:49:58 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 23 Nov 2013 21:49:58 +0400 Subject: [Haskell-cafe] Stacked return In-Reply-To: <87eh67vxe8.fsf@gnu.org> References: <87fvqnvzic.fsf@gnu.org> <87eh67vxe8.fsf@gnu.org> Message-ID: You could perhaps write MyWierdMonadT and MyAnotherMonadT. Also, probably layers package [1] is related to what you ask. But if you actually want arbitrary nested monads like m1 (m2 (m3 (m4 a))), there's no simple way. Consider Maybe [MyType Int]. MyType may have or may not have a Monadinstance. Even more: it can have instance in one module, but not have in another. But suppose MyType has a Num instance. Then how this should work: return 2 :: Maybe [MyType Int]? Should 2 be of type Int or MyType Int? Note that you can make an instance Num a => Num [a] which makes sense (lists as polynoms). So the same question arises even for Maybe [Int]. If you **really want to do it** (which I doubt), you can use TH (do determine how many return's to use, though it's ambiguous anyway). [1] http://hackage.haskell.org/package/layers-0.1/docs/Documentation-Layers-Overview.html 2013/11/23 Dmitry Bogatov > > > Perhaps you just want monad transformers [1, 2]. If you're not familiar > > with them, you should probably read [3]. > > > > With transformers you'd be able to do this (and more): > > > > $ return 2 :: IO Int > > $ return 2 :: ListT Maybe Int -- this works like Maybe [Int] > > $ return 2 :: MaybeT [] Int -- this works like [Maybe Int] > > In fact, I read and used transformers a bit. If I understand correctly, > I can only do such things for monads, supported by transformers. So, > > I cant get (return 2) :: MyWierdMonad (MyAnotherMonad 2) > > Yes, I know, it have little practical use, but I am insterested about > teoretical part of question, magic of ghc. > > -- > Best regards, Dmitry Bogatov , > Free Software supporter and netiquette guardian. > git clone git://kaction.name/rc-files.git --depth 1 > GPG: 54B7F00D > Html mail and proprietary format attachments are forwarded to /dev/null. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Sat Nov 23 18:20:49 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Sat, 23 Nov 2013 10:20:49 -0800 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: Edgar, for tags I use ctags (exuberant) with the following tag file: --langdef=haskell --langmap=haskell:.hs --regex-haskell=/^module[ \s]([a-zA-Z0-9]*)[ \s]where/\1/m,module/ --regex-haskell=/^import[ \s](.*)/\1/i,import/ --regex-haskell=/^class[ \s](.*)where/\1/t,typeclasses/ --regex-haskell=/^instance[ \s](.*)where/\1/c,classes/ --regex-haskell=/^data[ \s]([a-zA-Z0-9]*)[ \s]/\1/d,data/ --regex-haskell=/^([ \sa-zA-Z0-9]*)[ \s]::[ \s](.*)$/\1/f,functions/ And then using tagbar I customize my .vimrc with: " TagBar nmap tb :TagbarOpenAutoClose let g:tagbar_type_haskell = { \ 'ctagstype' : 'Haskell', \ 'kinds' : [ \ 'm:module', \ 'i:import', \ 'd:data', \ 't:typeclasses', \ 'c:instances', \ 'f:functions', \ ] \ } It could probably be improved but it works well enough to jump around to symbols. On Sat, Nov 23, 2013 at 3:09 AM, Edgar Klerks wrote: > If you use conque, you can run a GHCI session in vim: > http://code.google.com/p/conque/ That works pretty well. > > Neocomplcache +ghcmod + neco-ghc delivers good support for auto-completion. > > Syntastic will annotate errors in your source file. > > Gundo for reverting and viewing local changes, vim stores internally a > tree with changes. With some configuration it can remember changes for > days. The only drawback is that you can always hit u, because your last > weeks changes are still remembered. > > For searching in files, I use ack.vim. > > And for moving to files, I use ctrl-p, which let you open files with > little typing. > > You should also look into sessions (a vim feature). With this you can save > your current development environment and start from there. > > Bundle 'neocomplcache' > Bundle 'surround.vim' > Bundle 'eagletmt/neco-ghc' > Bundle "eagletmt/ghcmod-vim" > Bundle 'ctrlp.vim' > Bundle 'ack.vim' > Bundle 'Gundo' > Bundle 'scrooloose/syntastic' > Bundle "Shougo/vimproc" > > There are a lot of different plugins I use, but these have proven > themselves useful, also for general development. > > > I miss a program for creating tagfiles for haskell. This would be handy, > because you can jump quickly to definition file with this. > > Greets, > > Edgar > > > On Fri, Nov 8, 2013 at 8:44 PM, Corentin Dupont > wrote: > >> Hi cafe, >> I would like to know which IDE are you using? >> I use Leksah, I like the GUI design and constant compilation process. >> However, the development seems to be slowing down: last version date from >> early 2012. The installation process is very painful. >> >> There is FPComplete IDE coming up, but it's commercial. >> I'm experimenting with it, anyway: how to compile using cabal files? It >> doesn't seem to recognize them. Will there be an off-line version? >> >> I'm interested to know if you are using vim to develop: which extension >> are you using? I'm interested in continuous compilation, project files >> browsing, code completion, search-in-files. >> >> Best, >> Corentin >> >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From magnus at therning.org Sat Nov 23 21:28:15 2013 From: magnus at therning.org (Magnus Therning) Date: Sat, 23 Nov 2013 22:28:15 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: <20131123212815.GA1136@mteis.lan> On Sat, Nov 23, 2013 at 12:09:23PM +0100, Edgar Klerks wrote: > I miss a program for creating tagfiles for haskell. This would be handy, > because you can jump quickly to definition file with this. There are a few of those on hackage: http://hackage.haskell.org/packages/search?terms=hasktags I've tried hasktags in the past and it's worked well for me. /M -- Magnus Therning OpenPGP: 0xAB4DFBA4 email: magnus at therning.org jabber: magnus at therning.org twitter: magthe http://therning.org/magnus I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. -- Alan Kay -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: not available URL: From me at lelf.lu Sat Nov 23 21:39:14 2013 From: me at lelf.lu (Antonio) Date: Sun, 24 Nov 2013 01:39:14 +0400 Subject: [Haskell-cafe] Stacked return References: <87fvqnvzic.fsf@gnu.org> Message-ID: {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, FlexibleContexts, OverlappingInstances, TypeFamilies #-} class Monad m => Ret a m b where returnN :: a -> m b instance (Monad m, a ~ b) => Ret a m b where returnN = return instance (Monad m, Monad n, Ret a m b) => Ret a n (m b) where returnN = return . returnN boo :: [[[Maybe [Either () [Int]]]]] boo = returnN 0 Dmitry Bogatov writes: > Hi, list! > > I want to write function, that will stack `return` as much times, as > necessery. In code, I want > <$> magicLift 2 :: IO Int > <$> magicLift 2 :: Maybe [Int] > both be valid. > > My best approach is following (not work) > > {-# LANGUAGE FlexibleInstances #-} > {-# LANGUAGE UndecidableInstances #-} > > class Monad m => MonadS m where > liftS :: a -> m a > > instance (Monad m) => MonadS m where > liftS = return > > but > <$> :t liftS 2 > liftS 2 :: (Monad m, Num a) => m a > > What would you suggest? > > -- > Best regards, Dmitry Bogatov , > Free Software supporter and netiquette guardian. > git clone git://kaction.name/rc-files.git --depth 1 > GPG: 54B7F00D > Html mail and proprietary format attachments are forwarded to /dev/null. > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From edsoares110 at gmail.com Sun Nov 24 03:40:59 2013 From: edsoares110 at gmail.com (Ed Soares) Date: Sun, 24 Nov 2013 01:40:59 -0200 Subject: [Haskell-cafe] Lista de emails cadastro email lista emails gratis Message-ID: <1385002033d619e1095b3915ef43c7ea495456622d@gmail.com> Lista de emails cadastro email lista emails gratis lista emails que inclui lista de emails, listagem de empresas listagem de empresas: http://www.maladiretaemails.com sabemos que mala direta em casa, ? fant?stico para quase todos. listas de emails envio de email tamb?m lista de emails, mailing marketing digital, ? realmente a fun??o de nosso Site. se voc? deseja email marketing, o que mala direta e, al?m disso lista com emails: http://www.maladiretaemails.com ? uma boa email mailing al?m de trabalho com mala direta, listas de emails envio de email. ? um maravilhoso email lista gratis al?m de email de empresas. enderecos de email endereco de email, mail marketing. no momento presente email lista que cont?m Enviar email, lista de empresas ? otimo. a inten??o de nosso website: listagem de empresas, Enviar email, bem como email mailing. o mais eficaz em email lista email mailing, enderecos de email. From KAction at gnu.org Sun Nov 24 06:03:15 2013 From: KAction at gnu.org (Dmitry Bogatov) Date: Sun, 24 Nov 2013 10:03:15 +0400 Subject: [Haskell-cafe] Stacked return In-Reply-To: References: <87fvqnvzic.fsf@gnu.org> Message-ID: <87hab2bal8.fsf@gnu.org> Antonio writes: > {-# LANGUAGE MultiParamTypeClasses, FlexibleInstances, > FlexibleContexts, OverlappingInstances, TypeFamilies #-} > > > class Monad m => Ret a m b where > returnN :: a -> m b > > instance (Monad m, a ~ b) => Ret a m b where > returnN = return > > instance (Monad m, Monad n, Ret a m b) => Ret a n (m b) where > returnN = return . returnN > > > boo :: [[[Maybe [Either () [Int]]]]] > boo = returnN 0 Great! Now I know what I do not know. Thanks! -- Best regards, Dmitry Bogatov , Free Software supporter and netiquette guardian. git clone git://kaction.name/rc-files.git --depth 1 GPG: 54B7F00D Html mail and proprietary format attachments are forwarded to /dev/null. -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 835 bytes Desc: not available URL: From hoerdegen at funktional.info Sun Nov 24 16:52:21 2013 From: hoerdegen at funktional.info (=?ISO-8859-15?Q?Heinrich_H=F6rdegen?=) Date: Sun, 24 Nov 2013 17:52:21 +0100 Subject: [Haskell-cafe] Munich Haskell Meeting Message-ID: <52922EC5.1080608@funktional.info> Dear all, on Wed, 27th of November, once again, our monthly Haskell meeting will take place in Munich at 19h30 at Cafe Puck. If you plan to join, please go to: http://www.haskell-munich.de/dates and hit the button. Have a nice week! Heinrich From mgajda at mimuw.edu.pl Sun Nov 24 23:18:16 2013 From: mgajda at mimuw.edu.pl (Michal J Gajda) Date: Mon, 25 Nov 2013 00:18:16 +0100 Subject: [Haskell-cafe] [ANNOUNCE]hPDB - Is it the fastest parallel PDB parser? Part of structural bioinformatics library collection... Message-ID: Dear Haskellers, I would like to present a benchmark of Protein Databank parsers that indicates that one written in Haskell seems to outpace all others when using 4 or more of parallel cores: hPDB - Haskell library for processing atomic biomolecular structures in Protein Data Bank format -- Michal Jan Gajda BMC Research Notes.2013, 6:483. DOI: 10.1186/1756-0500-6-483 URL: http://www.biomedcentral.com/1756-0500/6/483 Please let me know if you know of any other parsers that could be added to this benchmark. Along with hTalos, and parseSTAR parser libraries for nuclear magnetic resonance data it adds to growing collection of bioinformatic libraries written in Haskell. Together with CloudHaskell and modern 48-core machines, they allow to process multigigabyte bioinformatic databases in a matter of few minutes (slightly over 8 minutes in case of over 10GB of PDB.) If interested, please see: http://biohaskell.org/. -- Best regards Micha? J. Gajda -------------- next part -------------- An HTML attachment was scrubbed... URL: From tpadilha84 at gmail.com Mon Nov 25 00:20:34 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Sun, 24 Nov 2013 22:20:34 -0200 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: For most languages/platform I've worked with, the following combo always served me very well: - zsh: very powerful bourne-compatible shell - tmux: terminal multiplexer with powerful scripting features, this provides highly flexible session management for software projects or any other admin task done through terminal - vim: one of the best text editors ever, with a very active community and thousands of plugins for most programming languages(a nice selection of haskell plugins) Using these tools as an IDE might seem strange/hard at first(especially for users of single-program IDEs), but once the initial learning curve is passed you will find yourself with a very flexible environment that you can adapt for basically any kind of programming language. After installing the following vim plugins I had a full-featured haskell IDE: General-purpose plugins: - UltiSnips: best snippets plugin for vim - Syntastic: show syntax errors and hlint warnings everytime you save - Slimux: Control tmux panes from vim. I use this with a scratchpad to quicky test code in ghci Haskell-specific plugins: - vim2hs: many haskell-related features, see github page for description - nego-ghc: smart code completion - ghcmod-vim: ghcmod integration - vim-hoogle: easily make hoogle queries from vim And for those who think terminal applications are ugly, here's a screenshot of my IDE in action: https://www.dropbox.com/s/ia3hm69vkxdvcsf/haskell-ide.png From sean at functionaljobs.com Mon Nov 25 07:00:03 2013 From: sean at functionaljobs.com (Functional Jobs) Date: Mon, 25 Nov 2013 02:00:03 -0500 Subject: [Haskell-cafe] New Functional Programming Job Opportunities Message-ID: <5292f5765aa14@functionaljobs.com> Here are some functional programming job opportunities that were posted recently: Software Developer - Functional Programming at Genetec http://functionaljobs.com/jobs/8660-software-developer-functional-programming-at-genetec Cheers, Sean Murphy FunctionalJobs.com From adam at bergmark.nl Mon Nov 25 08:16:12 2013 From: adam at bergmark.nl (Adam Bergmark) Date: Mon, 25 Nov 2013 09:16:12 +0100 Subject: [Haskell-cafe] Typesafe multi-table PostgreSQL queries in Yesod with schema names? In-Reply-To: References: <20131120145006.ddf8d130105a031a7f066841@mega-nerd.com> Message-ID: Hi Manuel, I'm currently in the same position as you are, except I'm not using Yesod. I've spent some time trying to migrate our current DB setup to use persistent. It's not really built to handle existing schemas. There's no inherent mismatch here, it just needs to be implemented. The main things I've found are missing: * The ability to declare foreign relations across different QQ blocks and verifying them with migrations. * There is no support for non-int primary keys (support for omitting a pk for join tables was recently merged, but I need support for other types of primary keys on normal tables, such as postgres uuid). * It's not possible to define foreign keys on uniqueness constraints. I might not care about this anymore because of the join table patch I mentioned above. * It's not flexible in column types, Text maps to character varying (but not text), and serial to int8. This isn't wrong but you cannot use aliases for these types. This should be fairly straight forward to fix I think. I also think persistent is too backend agnostic :) I only really care about postgres, and I think it would simplify a lot of things if there was a library built only for it. So unless you are willing to modify your schemas or patch persistent it doesn't seem to be a viable alternative. The good news is that Michael and Greg are very helpful and I'm sure they'd happily accept these changes, and esqueleto is a very nice EDSL. I have the same impression of HaskellDB as you have, but I haven't tested using it yet. I also need joins so groundhog is currently off the table too. Tom's library seems interesting but I haven't had the chance to try it out yet. I'm currently using HDBC which is middleware like the -simple packages, but without the static guarantees you mention maintenance has become a pain. We haven't decided how to proceed on this, but I'll try to write a summary once we have something up and running. Please let me know if you find a good solution too! - Adam On Wed, Nov 20, 2013 at 7:44 PM, Boris Lykah wrote: > Hi all, > > As the author of Groundhog library I agree that it and > Persistent/Esqueleto have strengths in different areas and none of > them fully matches power of SQL. Grounhog has better support of SQL > expressions and relational schemas (composite keys, schemas, indexes, > etc.) Persistent cannot do a query with projections and nested > function calls like: > > project (upper (FirstNameField `append` SecondNameField), toArith > BalanceField * 10) $ lower UserNameField `like` "%smith%" > > On the other hand, while Groundhog can query only one table at a time, > Persistent combined with Esqueleto gives relational query capabilities > that match a lot of the SQL syntax (notably excluding column > aliasing). > > I like Esqueleto and it seems to be easy to port to Groundhog. The > ported codebase may be even smaller because Groundhog already has > flexible functions and comparison operators which uniformly support > fields and constant values. Alas, I don't have enough time to do > this. If someone is interested in porting I will be happy to help. > > Thanks, > Boris > > On Wed, Nov 20, 2013 at 12:11 AM, Manuel G?mez wrote: > > On Tue, Nov 19, 2013 at 11:20 PM, Erik de Castro Lopo > > wrote: > >> Manuel G?mez wrote: > >>> * Persistent: it?s perfectly integrated into Yesod, and together > >>> with Esqueleto, it provides a nice, typesafe and fully expressive EDSL > >>> ? but, as far as I can tell, there is no support for specifying schema > >>> names, which is essential for my use case. > >> > >> I'm not sure of what you mean here. DO you mean that you already have > >> a database and schema and you now want to connect Persisent/Esqueleto > >> to it without changing the existing schema? > > > > Hi Erik, > > > > Indeed, that?s more or less the situation I?m facing. Perhaps the > > overloading of the term ?schema? is a problem here: what I > > specifically meant with this point is the namespacing mechanism > > present in (some implementations of) SQL databases: database object > > names are bound within namespaces called schemas, and a name can be > > qualified with the name of the schema, separated by a dot; hence a > > table named `"with spaces"` in a schema/namespace called `"some > > tables"` would be used qualified as `"some tables"."with spaces"`. > > > > I have an existing schema (read: database) with many schemas (read: > > namespaces) and I need to do joins between tables in them. The names > > have spaces and unusual bits of Unicode, and the dot that separates > > the schema name from the object name mustn?t be quoted, so it?s not > > simply a matter of specifying a complex name to Persistent, as > > escaping and quoting wouldn?t be done correctly. A workaround could > > be to put everything in a single namespace and use prefixes in names, > > but that causes other issues for me (other tools would break). > > > > The other issue I have with Persistent+Esqueleto is that the database > > I have to work with has some composite or otherwise non?serial-integer > > primary keys, and I understand Persistent requires a serial primary > > key. I could probably work around this, though. > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > -- > Regards, > Boris > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joastbg at gmail.com Mon Nov 25 10:40:39 2013 From: joastbg at gmail.com (Johan Astborg) Date: Mon, 25 Nov 2013 11:40:39 +0100 Subject: [Haskell-cafe] Master thesis project - Haskell STM Message-ID: Dear Haskellers, I found Haskell and became enlightened for the first time in many years. I choose to continue on this path, and choose Haskell for my master thesis. I got some nice ideas from people on the #haskell channel . Altogether, I have elaborated a topic: "Evaluating Intel TSX in a MVCC based STM implementation for Haskell" The idea is to investigate whether the "new" Intel TSX can bring any value in terms of performance and saftey when implemented in a MVCC based STM to be used in the Haskell runtime system (GHC). The MVCC based STM using TSX will be evaluated and compared to the existing implementation, compiled with the two settings STM_CG_LOCK and STM_FG_LOCKS respectively. The biggest challange still, is to convince Lund University, LTH, to accept my own master thesis project. I have to present a detailed synopsis about the project, for them to choose an examinator and supervisor. As they put it, the examinator "must have time" and it's up to that person to decide whether or not this project can be reality. Feedback on any of these is highly appreciated: 1) Ideas and thoughts about this topic 2) Anyone interested in supervising (mainly formal) the project outside of LTH Thanks, Johan Astborg -------------- next part -------------- An HTML attachment was scrubbed... URL: From evohunz at gmail.com Mon Nov 25 10:57:41 2013 From: evohunz at gmail.com (Thiago Negri) Date: Mon, 25 Nov 2013 08:57:41 -0200 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: I'm using emacs just for basic text file editing, no auto-completion, no flymake, etc. I find it quite dificult to navigate between files of a project and have no time to configure emacs to work as an IDE. There are lots of plugins pointed out in the wiki and such, but there's a lack of step-by-step tutorials or packages that works out of the box. I always need to search the entire web for the lines I need to punch into .emacs file. It's already hard to maintain brain's memory for other stuff, having to learn my way thru emacs was time consuming and yet if I would start a fresh-install of it, I probably would need to search the entire web again. -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexander.kjeldaas at gmail.com Mon Nov 25 11:02:11 2013 From: alexander.kjeldaas at gmail.com (Alexander Kjeldaas) Date: Mon, 25 Nov 2013 12:02:11 +0100 Subject: [Haskell-cafe] Master thesis project - Haskell STM In-Reply-To: References: Message-ID: I remember Simon Marlow mentoined that there should be a lot of low hanging fruit in the STM implementation when I started looking at optimization opportunities in the MVar implementation. The STM implementation could probably be optimized even if you don't win with the TSX implementation, so the probability of success with your thesis could be quite high. http://www.haskell.org/pipermail/ghc-devs/2013-February/000496.html Alexander On Mon, Nov 25, 2013 at 11:40 AM, Johan Astborg wrote: > Dear Haskellers, > > I found Haskell and became enlightened for the first time in many years. I > choose to continue on this path, and choose Haskell for my master thesis. I > got some nice ideas from people on the #haskell channel . Altogether, I > have elaborated a topic: > > "Evaluating Intel TSX in a MVCC based STM implementation for Haskell" > > The idea is to investigate whether the "new" Intel TSX can bring any value > in terms of performance and saftey when implemented in a MVCC based STM to > be used in the Haskell runtime system (GHC). The MVCC based STM using TSX > will be evaluated and compared to the existing implementation, compiled > with the two settings STM_CG_LOCK and STM_FG_LOCKS respectively. > > The biggest challange still, is to convince Lund University, LTH, to > accept my own master thesis project. I have to present a detailed synopsis > about the project, for them to choose an examinator and supervisor. As they > put it, the examinator "must have time" and it's up to that person to > decide whether or not this project can be reality. > > Feedback on any of these is highly appreciated: > > 1) Ideas and thoughts about this topic > 2) Anyone interested in supervising (mainly formal) the project outside of > LTH > > Thanks, > Johan Astborg > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fuuzetsu at fuuzetsu.co.uk Mon Nov 25 11:05:21 2013 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Mon, 25 Nov 2013 11:05:21 +0000 Subject: [Haskell-cafe] IDE In-Reply-To: References: Message-ID: <52932EF1.5010407@fuuzetsu.co.uk> On 25/11/13 10:57, Thiago Negri wrote: > I'm using emacs just for basic text file editing, no auto-completion, no > flymake, etc. > I find it quite dificult to navigate between files of a project and have no > time to configure emacs to work as an IDE. You're almost certainly wasting more time by not using any IDE-ish features that you could set up than you would take setting it up. > > There are lots of plugins pointed out in the wiki and such, but there's a > lack of step-by-step tutorials or packages that works out of the box. I > always need to search the entire web for the lines I need to punch into > .emacs file. Nowadays, with a recent-enough emacs you can do ?M-x install-package? which does everything for you. There's also ?M-x customize? which allows you to change all the various package options in an interface. > > It's already hard to maintain brain's memory for other stuff, having to > learn my way thru emacs was time consuming and yet if I would start a > fresh-install of it, I probably would need to search the entire web again. > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- Mateusz K. From rendel at informatik.uni-marburg.de Mon Nov 25 12:57:06 2013 From: rendel at informatik.uni-marburg.de (Tillmann Rendel) Date: Mon, 25 Nov 2013 13:57:06 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: <52932EF1.5010407@fuuzetsu.co.uk> References: <52932EF1.5010407@fuuzetsu.co.uk> Message-ID: <52934922.6040502@informatik.uni-marburg.de> Hi, Mateusz Kowalczyk wrote: > Nowadays, with a recent-enough emacs you can do ?M-x install-package? > which does everything for you. Which packages should I install this way to get decent Haskell support? Tillmann From berdario at gmail.com Mon Nov 25 13:13:10 2013 From: berdario at gmail.com (Dario Bertini) Date: Mon, 25 Nov 2013 14:13:10 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: <52932EF1.5010407@fuuzetsu.co.uk> References: <52932EF1.5010407@fuuzetsu.co.uk> Message-ID: On Mon, Nov 25, 2013 at 12:05 PM, Mateusz Kowalczyk wrote: > You're almost certainly wasting more time by not using any IDE-ish > features that you could set up than you would take setting it up. > as long as haskell is your go-to language, and barely use anything else... and you don't have a non standard setup (like, non-posix shell)... and you don't stumble upon some bugs in IDE-ish functionality that barely anyone use I agree otherwise, emacs is the triumph of yak-shaving :/ >> > Nowadays, with a recent-enough emacs you can do ?M-x install-package? > which does everything for you. There's also ?M-x customize? which allows > you to change all the various package options in an interface. > just a small note to other haskell+emacs newbs like myself: to get the same functionality by installing haskell-mode from inside emacs as you get by installing the haskell-mode ubuntu package, you'll probably need to add to your init.el the following: (add-hook 'haskell-mode-hook 'turn-on-haskell-indentation) (add-hook 'haskell-mode-hook 'turn-on-haskell-doc-mode) while we are at it, is there any way to get the doc-mode working correctly with value outside Prelude? for example, after hiding try from the Prelude and importing Text.Parsec, in the minibuffer I get try :: IO a -> IO (Either IOErrror a) instead of the correct try :: ParsecT s u m a -> ParsecT s u m a thanks From evohunz at gmail.com Mon Nov 25 13:21:26 2013 From: evohunz at gmail.com (Thiago Negri) Date: Mon, 25 Nov 2013 11:21:26 -0200 Subject: [Haskell-cafe] IDE In-Reply-To: References: <52932EF1.5010407@fuuzetsu.co.uk> Message-ID: I've installed haskell-mode and some others from the package manager. Yet I have no auto-completion, no go-to-definition, no overview, no function lookup/search. I use Eclipse for Java, and it works out of the box. The lack of an easy-to-setup IDE is something I really miss in "Haskell environment". How much time would it take to setup emacs as an IDE for Haskell? Considering I'm pretty newby as emacs. -------------- next part -------------- An HTML attachment was scrubbed... URL: From trupill at gmail.com Mon Nov 25 13:29:47 2013 From: trupill at gmail.com (Alejandro Serrano Mena) Date: Mon, 25 Nov 2013 14:29:47 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: <52932EF1.5010407@fuuzetsu.co.uk> Message-ID: Well, you have EclipseFP as a Haskell plug-in for Eclipse. You may give it a try :) 2013/11/25 Thiago Negri > I've installed haskell-mode and some others from the package manager. > Yet I have no auto-completion, no go-to-definition, no overview, no > function lookup/search. > > I use Eclipse for Java, and it works out of the box. > The lack of an easy-to-setup IDE is something I really miss in "Haskell > environment". > > How much time would it take to setup emacs as an IDE for Haskell? > Considering I'm pretty newby as emacs. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jpmoresmau at gmail.com Mon Nov 25 13:31:50 2013 From: jpmoresmau at gmail.com (JP Moresmau) Date: Mon, 25 Nov 2013 14:31:50 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: <52932EF1.5010407@fuuzetsu.co.uk> Message-ID: If you're used to Eclipse, why don't you give EclipseFP a try? I'm not saying it's perfect and of course it's not out of the box in Eclipse, but maybe it could suit you better. Feel free to post issues on the Github issues tracker or the sourceforge discussion. Thanks JP On Mon, Nov 25, 2013 at 2:21 PM, Thiago Negri wrote: > I've installed haskell-mode and some others from the package manager. > Yet I have no auto-completion, no go-to-definition, no overview, no > function lookup/search. > > I use Eclipse for Java, and it works out of the box. > The lack of an easy-to-setup IDE is something I really miss in "Haskell > environment". > > How much time would it take to setup emacs as an IDE for Haskell? > Considering I'm pretty newby as emacs. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- JP Moresmau http://jpmoresmau.blogspot.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From 0slemi0 at gmail.com Mon Nov 25 13:54:33 2013 From: 0slemi0 at gmail.com (Andras Slemmer) Date: Mon, 25 Nov 2013 13:54:33 +0000 Subject: [Haskell-cafe] Witnessing lifted types? Message-ID: Hi, not sure whether this has been addressed before. Basically the goal is to have a standardised way of witnessing lifted types (=simulating pattern matching on type indices). A particular problem this would be useful for: Given a standard natural-indexed vector (Vec n) provide an Applicative instance for it with n left polymorphic. The issue is that we don't have a way of pattern matching on n, therefore we cannot implement pure/<*>. The way I addressed situations like this before was to have two Applicative instances, one for Vec Zero and one for Vec (Succ n), however I think there is a way to decouple this way of "pattern matching on types" by introducing a GADT: data WNat n where WZero :: WNat Zero WSucc :: WNat n -> WNat (Succ n) and a class class WNatClass n where witness :: WNat n instance WNatClass Zero where witness = WZero instance (WNatClass n) => WNatClass (Succ n) where witness = WSucc witness Now whenever we need to pattern match on a natural index we can just put a WNatClass restriction on it and pattern match on the automatically constructed witness. For the Vec example: instance (WNatClass n) => Applicative (Vec n) where pure = pure' witness where pure' :: WNat n -> a -> Vec n a pure' WZero _ = VecNil pure' (WSucc w) a = a ::: pure' w a (<*>) = app' witness where app' :: WNat n -> Vec n (a -> b) -> Vec n a -> Vec n b app' WZero _ _ = VecNil app' (WSucc w) (f ::: fs) (a ::: as) = f a ::: app' w fs as We can also generalise this concept to any index type with PolyKinds, although I'm not 100% sure why it works in general: class Construct (a :: k) where data Wit a :: * class (Construct a) => Witness a where witness :: Wit a The idea is that each instance of Construct will leave the type 'a' polymorphic and will only bind the kind 'k' and provide an indexed witness: instance Construct (n :: Nat) where data Wit n where WZero :: Wit Zero WSucc :: Wit n -> Wit (Succ n) and the Witness instances will be the same as with WNatClass. We need two classes because one will define the witness type, the other will do the "pattern matching". The part I don't understand is that together with the (n :: Nat) instance we can also have instance Construct (a :: SomeOtherType) where ... without triggering any 'overlapping' diagnostic, even though both instances are "fully polymorphic". I am assuming this is because internally the compiler adds a kind parameter to the class that disambiguates the instances? If so then I think this is a nice uniform way of handling lifted type witnesses. (The instances can be generated automatically too). What do you think? Is there a better way of doing this? Is the decoupling even worth the trouble? Is the performance hit big compared to the explicit instance splitting? -------------- next part -------------- An HTML attachment was scrubbed... URL: From corentin.dupont at gmail.com Mon Nov 25 15:37:54 2013 From: corentin.dupont at gmail.com (Corentin Dupont) Date: Mon, 25 Nov 2013 16:37:54 +0100 Subject: [Haskell-cafe] IDE In-Reply-To: References: <52932EF1.5010407@fuuzetsu.co.uk> Message-ID: Leksah is also a good all-in-one standalone solution. If you have it in your distribution, it should install fine (apt-get install leksah). On Mon, Nov 25, 2013 at 2:31 PM, JP Moresmau wrote: > If you're used to Eclipse, why don't you give EclipseFP a try? I'm not > saying it's perfect and of course it's not out of the box in Eclipse, but > maybe it could suit you better. Feel free to post issues on the Github > issues tracker or the sourceforge discussion. > > Thanks > > JP > > > On Mon, Nov 25, 2013 at 2:21 PM, Thiago Negri wrote: > >> I've installed haskell-mode and some others from the package manager. >> Yet I have no auto-completion, no go-to-definition, no overview, no >> function lookup/search. >> >> I use Eclipse for Java, and it works out of the box. >> The lack of an easy-to-setup IDE is something I really miss in "Haskell >> environment". >> >> How much time would it take to setup emacs as an IDE for Haskell? >> Considering I'm pretty newby as emacs. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > JP Moresmau > http://jpmoresmau.blogspot.com/ > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eir at cis.upenn.edu Mon Nov 25 16:01:57 2013 From: eir at cis.upenn.edu (Richard Eisenberg) Date: Mon, 25 Nov 2013 11:01:57 -0500 Subject: [Haskell-cafe] Witnessing lifted types? In-Reply-To: References: Message-ID: Hi Andras, The road you're walking down leads to wonderful places, and your design ideas are right on. This general direction of programming is addressed in my `singletons` library. That library uses Template Haskell to generate a lot of the necessary definitions. So, you would just define plain old, non-GADT `Nat`, and you get your `WNat` and `WNatClass` for free. And, it even uses the the same `Wit` data family -- I call it `Sing`. If you want the cutting edge, you may want to look at the version of singletons on my github repo, at github.com/goldfirere/singletons. That contains the (relatively stable) implementation of v. 0.9 of the library -- the biggest (only?) missing piece is documentation. Feel free to email if you have questions, though. Even if you don't use the library, I can say that the design you have below works out fairly well, so just keep going! :) Richard On Nov 25, 2013, at 8:54 AM, Andras Slemmer wrote: > Hi, not sure whether this has been addressed before. > Basically the goal is to have a standardised way of witnessing lifted types (=simulating pattern matching on type indices). > > A particular problem this would be useful for: > Given a standard natural-indexed vector (Vec n) provide an Applicative instance for it with n left polymorphic. > The issue is that we don't have a way of pattern matching on n, therefore we cannot implement pure/<*>. The way I addressed situations like this before was to have two Applicative instances, one for Vec Zero and one for Vec (Succ n), however I think there is a way to decouple this way of "pattern matching on types" by introducing a GADT: > > data WNat n where > WZero :: WNat Zero > WSucc :: WNat n -> WNat (Succ n) > > and a class > > class WNatClass n where > witness :: WNat n > instance WNatClass Zero where > witness = WZero > instance (WNatClass n) => WNatClass (Succ n) where > witness = WSucc witness > > Now whenever we need to pattern match on a natural index we can just put a WNatClass restriction on it and pattern match on the automatically constructed witness. > > For the Vec example: > > instance (WNatClass n) => Applicative (Vec n) where > pure = pure' witness > where > pure' :: WNat n -> a -> Vec n a > pure' WZero _ = VecNil > pure' (WSucc w) a = a ::: pure' w a > (<*>) = app' witness > where > app' :: WNat n -> Vec n (a -> b) -> Vec n a -> Vec n b > app' WZero _ _ = VecNil > app' (WSucc w) (f ::: fs) (a ::: as) = f a ::: app' w fs as > > We can also generalise this concept to any index type with PolyKinds, although I'm not 100% sure why it works in general: > > class Construct (a :: k) where > data Wit a :: * > > class (Construct a) => Witness a where > witness :: Wit a > > The idea is that each instance of Construct will leave the type 'a' polymorphic and will only bind the kind 'k' and provide an indexed witness: > > instance Construct (n :: Nat) where > data Wit n where > WZero :: Wit Zero > WSucc :: Wit n -> Wit (Succ n) > > and the Witness instances will be the same as with WNatClass. > We need two classes because one will define the witness type, the other will do the "pattern matching". > > The part I don't understand is that together with the (n :: Nat) instance we can also have > > instance Construct (a :: SomeOtherType) where ... > > without triggering any 'overlapping' diagnostic, even though both instances are "fully polymorphic". I am assuming this is because internally the compiler adds a kind parameter to the class that disambiguates the instances? If so then I think this is a nice uniform way of handling lifted type witnesses. (The instances can be generated automatically too). > > What do you think? Is there a better way of doing this? Is the decoupling even worth the trouble? Is the performance hit big compared to the explicit instance splitting? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe From carter.schonwald at gmail.com Mon Nov 25 16:35:01 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Mon, 25 Nov 2013 11:35:01 -0500 Subject: [Haskell-cafe] Master thesis project - Haskell STM In-Reply-To: References: Message-ID: I believe Ryan Yates is actively working on at least some part of this problem, worth asking him . Likewise, any successful experimentation will depend on some level of comfort with ghc hackig. On Monday, November 25, 2013, Alexander Kjeldaas wrote: > I remember Simon Marlow mentoined that there should be a lot of low > hanging fruit in the STM implementation when I started looking at > optimization opportunities in the MVar implementation. > > The STM implementation could probably be optimized even if you don't win > with the TSX implementation, so the probability of success with your thesis > could be quite high. > > http://www.haskell.org/pipermail/ghc-devs/2013-February/000496.html > > Alexander > > On Mon, Nov 25, 2013 at 11:40 AM, Johan Astborg > > wrote: > >> Dear Haskellers, >> >> I found Haskell and became enlightened for the first time in many years. >> I choose to continue on this path, and choose Haskell for my master thesis. >> I got some nice ideas from people on the #haskell channel . Altogether, I >> have elaborated a topic: >> >> "Evaluating Intel TSX in a MVCC based STM implementation for Haskell" >> >> The idea is to investigate whether the "new" Intel TSX can bring any >> value in terms of performance and saftey when implemented in a MVCC based >> STM to be used in the Haskell runtime system (GHC). The MVCC based STM >> using TSX will be evaluated and compared to the existing implementation, >> compiled with the two settings STM_CG_LOCK and STM_FG_LOCKS respectively. >> >> The biggest challange still, is to convince Lund University, LTH, to >> accept my own master thesis project. I have to present a detailed synopsis >> about the project, for them to choose an examinator and supervisor. As they >> put it, the examinator "must have time" and it's up to that person to >> decide whether or not this project can be reality. >> >> Feedback on any of these is highly appreciated: >> >> 1) Ideas and thoughts about this topic >> 2) Anyone interested in supervising (mainly formal) the project outside >> of LTH >> >> Thanks, >> Johan Astborg >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org > 'Haskell-Cafe at haskell.org');> >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bryanvick at gmail.com Mon Nov 25 22:54:20 2013 From: bryanvick at gmail.com (Bryan Vicknair) Date: Mon, 25 Nov 2013 14:54:20 -0800 Subject: [Haskell-cafe] Writer + log each computation to stdout Message-ID: <20131125225420.GC5516@bry-m6300> Hello, I have a bunch of little database IO functions. Each does something to the database, and returns a log string describing what it did, and possibly a meaningful result from the database. query :: IO (String, a) update :: a -> IO (String, ()) ...and a few functions that orchestrate all the little functions into doing useful work. syncWeek :: Week -> IO () syncAll : : IO () I don't want the individual functions to know what is done with the log string describing what they did. Top-level orchestrating functions should make that decision, which can be one of: 1) Collect and print all to a log once all computations are done. 2) Print to stdout *as each computation is run*. 3) Ignore them. Here is my understanding of how common monads would handle these requirements: Writer: 1 and 3 are easy. This is what I originally attempted to use, but I couldn't figure out how to accomplish #2. Reader: 2 and 3 can be accomplished if each function reads a shouldLog config variable from the reader and does a putStrLn depending on the value. Very ugly, as now each function has to know how to log output. State: Not sure, but the Writer docs in the transformers package points to this monad as maybe solving requirement #2 above. The use case is that when I call the top-level functions from a command line script, I want to see logging happening in real-time to stdout, but I may call the same top-level functions from a larger application that may be logging to somewhere other than stdout, and may call the top-level functions from yet another larger application which doesn't want anything to be logged. How can I glue together a bunch of smaller computations, which may call each other, and decide at a higher level what to do with the logging result of each computation? Seems like a perfect fit for Writer, except for the requirement to be able to print to stdout at each step. Bryan Vicknair From rendel at informatik.uni-marburg.de Tue Nov 26 02:34:47 2013 From: rendel at informatik.uni-marburg.de (Tillmann Rendel) Date: Tue, 26 Nov 2013 03:34:47 +0100 Subject: [Haskell-cafe] Writer + log each computation to stdout In-Reply-To: <20131125225420.GC5516@bry-m6300> References: <20131125225420.GC5516@bry-m6300> Message-ID: <529408C7.5000003@informatik.uni-marburg.de> Hi, Bryan Vicknair wrote: > I have a bunch of little database IO functions. Each does something to the > database, and returns a log string describing what it did, and possibly a > meaningful result from the database. > > query :: IO (String, a) > update :: a -> IO (String, ()) > > ...and a few functions that orchestrate all the little functions into doing > useful work. > > syncWeek :: Week -> IO () > syncAll : : IO () > > I don't want the individual functions to know what is done with the log string > describing what they did. Top-level orchestrating functions should make that > decision, which can be one of: > > 1) Collect and print all to a log once all computations are done. > 2) Print to stdout *as each computation is run*. > 3) Ignore them. Instead of using an existing monad transformer, I would consider to write my own set of logging monad transformers. This could give you this interface: class MonadLog m where log :: String -> m () query :: (MonadIO m, MonadLog m) => m a update :: (MonadIO m, MonadLog m) => a -> m () And then you can provide different implementations for MonadLog: newtype IgnoreLogT m a = IgnoreLogT { runIgnoreLogT :: m a } instance MonadLog (IgnoreLogT m) where log _ = return () newtype ConsoleLogT m a = ConsoleLogT { runConsoleLogT :: m a } instance MonadIO m => MonadLog (ConsoleLogT m) where log msg = liftIO (putStrLn msg) newtype StringLogT m a = StringLogT { runStringLogT :: WriterT String m a } instance MonadLog (StringLogT m) where log msg = StringLogT $ tell msg Tillmann From alex at lagoa.com Tue Nov 26 05:27:09 2013 From: alex at lagoa.com (Alex Vieth) Date: Tue, 26 Nov 2013 00:27:09 -0500 Subject: [Haskell-cafe] Writer + log each computation to stdout In-Reply-To: <529408C7.5000003@informatik.uni-marburg.de> References: <20131125225420.GC5516@bry-m6300> <529408C7.5000003@informatik.uni-marburg.de> Message-ID: I have very little experience with monad transformers, so I took this opportunity to learn by implementing one that will (hopefully!) solve your problem. Here goes: import Data.Monoid import Control.Monad import Control.Monad.Trans -- Needed for an example stdout logger. import System.IO.Unsafe -- | LoggerT monad transformer. -- runLoggerT demands a logging function of type a -> b (where b is a monoid). -- It returns a monad-wrapped tuple, where the first entry is the logs and the -- second is some value. -- So, a is the log input type, b the log output type (probably [a]), m a monad, -- and c some arbitrary type. newtype LoggerT a b m c = LogT { runLoggerT :: (a -> b) -> m (b, c) } instance (Monoid b, Monad m) => Monad (LoggerT a b m) where -- return is straightforward: ignore the log function and give mempty as the -- partial log. return x = LogT $ \_ -> return (mempty, x) -- Follow the steps for bind... (>>=) x k = LogT $ \l -> -- First we run the logger against the supplied logging function to get a -- base monad value let y = runLoggerT x l -- Now we exploit the base monad's bind twice: in y >>= (\(log0, v) -> -- First to feed a value to k and run the produced logger... let z = log0 `seq` runLoggerT (k v) l -- And again to concatenate the logs. in z >>= (\(log1, w) -> -- Note the use of seq here and above; without this, the stdout logger -- that we define later will not work. return $ log1 `seq` (log0 `mappend` log1, w))) instance Monoid b => MonadTrans (LoggerT a b) where lift x = LogT $ \l -> x >>= (\v -> return (mempty, v)) -- | This function will put a message in the log. putLog :: (Monoid b, Monad m) => a -> LoggerT a b m () putLog msg = LogT $ \l -> let msg' = l msg in return (msg', ()) -- | Give this to (runLoggerT m) and you'll get a list log. runListLog action = runLoggerT action (\x -> [x]) -- | Give this to (runLoggerT m) and you'll get logs printed -- to stdout. runStdoutLog action = runLoggerT action spitString where spitString = unsafePerformIO . print stupidExample :: Monoid b => LoggerT String b IO () stupidExample = do l <- lift getLine putLog $ "Got line: " ++ l m <- lift getLine putLog $ "Got another: " ++ m Try loading it up and evaluating runStdoutLog stupidExample and runListLog stupidExample. If you don't like the use of unsafePerformIO, you could import Debug.Trace instead and use runTraceLog action = runLoggerT action (\x -> trace x ()) Alex On 11/25/13, Tillmann Rendel wrote: > Hi, > > Bryan Vicknair wrote: >> I have a bunch of little database IO functions. Each does something to >> the >> database, and returns a log string describing what it did, and possibly a >> meaningful result from the database. >> >> query :: IO (String, a) >> update :: a -> IO (String, ()) >> >> ...and a few functions that orchestrate all the little functions into >> doing >> useful work. >> >> syncWeek :: Week -> IO () >> syncAll : : IO () >> >> I don't want the individual functions to know what is done with the log >> string >> describing what they did. Top-level orchestrating functions should make >> that >> decision, which can be one of: >> >> 1) Collect and print all to a log once all computations are done. >> 2) Print to stdout *as each computation is run*. >> 3) Ignore them. > > Instead of using an existing monad transformer, I would consider to > write my own set of logging monad transformers. This could give you this > interface: > > class MonadLog m where > log :: String -> m () > > query :: (MonadIO m, MonadLog m) => m a > update :: (MonadIO m, MonadLog m) => a -> m () > > And then you can provide different implementations for MonadLog: > > newtype IgnoreLogT m a = IgnoreLogT { runIgnoreLogT :: m a } > > instance MonadLog (IgnoreLogT m) where > log _ = return () > > > newtype ConsoleLogT m a = ConsoleLogT { runConsoleLogT :: m a } > > instance MonadIO m => MonadLog (ConsoleLogT m) where > log msg = liftIO (putStrLn msg) > > > newtype StringLogT m a = > StringLogT { runStringLogT :: WriterT String m a } > > instance MonadLog (StringLogT m) where > log msg = StringLogT $ tell msg > > Tillmann > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From miroslav.karpis at gmail.com Tue Nov 26 08:58:18 2013 From: miroslav.karpis at gmail.com (Miro Karpis) Date: Tue, 26 Nov 2013 09:58:18 +0100 Subject: [Haskell-cafe] btc-e interfacing + bot Message-ID: Am thinking to inteface btc-e + make a bot. Anybody willing to join forces? m. -------------- next part -------------- An HTML attachment was scrubbed... URL: From trupill at gmail.com Tue Nov 26 09:36:51 2013 From: trupill at gmail.com (Alejandro Serrano Mena) Date: Tue, 26 Nov 2013 10:36:51 +0100 Subject: [Haskell-cafe] free vs. operational vs. free-operational Message-ID: Dear Caf?, I've been reading lately about the relation between the 'free' package and the 'operational' package for rolling your own monads [1] [2]. Furthermore, I've discovered that the 'free-operational' package, which is some sort of bridge between the two worlds, and provides not only Monad but also Applicative and Alternative instances for ProgramT. The problem is that right now everything is a little confused in my head. In particular, I have the following questions: - I've read that free allows you to 'bake algebraic laws' in the resulting monad. How does this work? Why doesn't operational offer that feature? - One of the things I really like from the free package is that it provides support for many monad transformer stacks, whereas operational does not? Is there any special restriction why operational cannot do this? Would it be possible to provide similar instances for free-operational? - It seems that free gives more features (Alternative, Applicative) with the same work. In which situations should I prefer operational to free? I really like the separation between providing a data type and then a interpretation that operational embodies... - Should I replace my usage of operational with free-operational altogether? Thanks for the help :) [1] http://www.reddit.com/r/haskell/comments/17a33g/free_functors_the_reason_free_and_operational_are/ [2] http://stackoverflow.com/questions/14263363/is-operational-really-isomorphic-to-a-free-monad -------------- next part -------------- An HTML attachment was scrubbed... URL: From haskell at nand.wakku.to Tue Nov 26 09:50:44 2013 From: haskell at nand.wakku.to (Niklas Haas) Date: Tue, 26 Nov 2013 10:50:44 +0100 Subject: [Haskell-cafe] Writer + log each computation to stdout In-Reply-To: <20131125225420.GC5516@bry-m6300> References: <20131125225420.GC5516@bry-m6300> Message-ID: <20131126105044.GA3549@nanodesu.talocan.mine.nu> On Mon, 25 Nov 2013 14:54:20 -0800, Bryan Vicknair wrote: > Hello, > > I have a bunch of little database IO functions. Each does something to the > database, and returns a log string describing what it did, and possibly a > meaningful result from the database. > > query :: IO (String, a) > update :: a -> IO (String, ()) > > ...and a few functions that orchestrate all the little functions into doing > useful work. > > syncWeek :: Week -> IO () > syncAll : : IO () > > > I don't want the individual functions to know what is done with the log string > describing what they did. Top-level orchestrating functions should make that > decision, which can be one of: > > 1) Collect and print all to a log once all computations are done. > 2) Print to stdout *as each computation is run*. > 3) Ignore them. > > Here is my understanding of how common monads would handle these requirements: > > Writer: 1 and 3 are easy. This is what I originally attempted to use, but I > couldn't figure out how to accomplish #2. > Reader: 2 and 3 can be accomplished if each function reads a shouldLog config > variable from the reader and does a putStrLn depending on the value. > Very ugly, as now each function has to know how to log output. > State: Not sure, but the Writer docs in the transformers package points to > this monad as maybe solving requirement #2 above. > > The use case is that when I call the top-level functions from a command line > script, I want to see logging happening in real-time to stdout, but I may call > the same top-level functions from a larger application that may be logging to > somewhere other than stdout, and may call the top-level functions from yet > another larger application which doesn't want anything to be logged. > > How can I glue together a bunch of smaller computations, which may call > each other, and decide at a higher level what to do with the logging result of > each computation? Seems like a perfect fit for Writer, except for the > requirement to be able to print to stdout at each step. > > > Bryan Vicknair > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe Looks like a free monad construction should work: {-# LANGUAGE DeriveFunctor #-} import Prelude hiding (log) import Control.Monad.Free data LogF a = LogF { log :: String, act :: IO a } deriving Functor type Log = Free LogF test :: Log () test = liftF $ LogF "logging" (putStrLn "acting") interactLog :: Log a -> IO a interactLog (Pure x) = return x interactLog (Free l) = do putStrLn $ "[Log] " ++ log l act l >>= interactLog >>> interactLog $ replicateM_ 3 test [Log] logging acting [Log] logging acting [Log] logging acting From oleg at okmij.org Tue Nov 26 10:25:17 2013 From: oleg at okmij.org (oleg at okmij.org) Date: 26 Nov 2013 10:25:17 -0000 Subject: [Haskell-cafe] Writer + log each computation to stdout Message-ID: <20131126102517.40535.qmail@www1.g3.pair.com> Bryan Vicknair wrote: > I have a bunch of little database IO functions. Each does something to the > database, and returns a log string describing what it did, and possibly a > meaningful result from the database. > ...and a few functions that orchestrate all the little functions into doing > useful work. > > I don't want the individual functions to know what is done with the log string > describing what they did. Top-level orchestrating functions should make that > decision, which can be one of: > > 1) Collect and print all to a log once all computations are done. > 2) Print to stdout *as each computation is run*. > 3) Ignore them. What an excellent case for extensible effects! Many thanks to Ben Foppa for making the package available on hackage, as extensible-effects. Extensible Effects designed specifically to separate a client (the requestor of an action) from a handler, the executor of an action. A logging client merely requests a string to be logged. It has no idea what happens when that request is executed. Therefore, the same client can be used with several handlers, even within the same expression. One can also build various interceptors, such as logIntercept, which is similar to Unix' tee. The following file illustrates how to solve the problem with all three scenarios. http://okmij.org/ftp/ The extensible effects package actually defines a very similar function, calls trace. For illustration and clarity, the file develops the Logging effect from scratch. After all, Extensible Effects encourages developing effects to suit the problem at hand. Defining a new effect is as simple as -- The request to log a string -- The request carries the String to log. It seems no particular -- reply is needed for the request (other than the simple acknowledgment), -- so we set the reply to be unit. data Log v = Log String (() -> v) deriving (Typeable, Functor) Clients use the function logit :: Member Log r => [Char] -> Eff r () (this signature, as all signatures in the code, are inferred). The signature says that the function request Log effect to be done. It does not concern itself how this effect its to be done. The file shows three handlers: runLogCollect, runLogTrace, runLogIgnore. There is also another handler, logIntercept, that like Unix 'tee', prints out the log message immediately while still propagating it. It can be used with any of the three handlers. From oleg at okmij.org Tue Nov 26 10:51:46 2013 From: oleg at okmij.org (oleg at okmij.org) Date: 26 Nov 2013 10:51:46 -0000 Subject: [Haskell-cafe] free vs. operational vs. free-operational Message-ID: <20131126105146.49662.qmail@www1.g3.pair.com> Alejandro Serrano Mena wrote: > I really like the separation between providing a data type and then a > interpretation that operational embodies... Then perhaps you may like extensible effects then. They are designed around the separation of requestors and their interpreters. However, the set of requests is open (and can be extended at any time without recompiling the program). Likewise the interpreters can be extended incrementally. One can add an interpreter for an effect without caring what other effects are there -- unless one has some reason for caring about other effects (e.g.,m for finalization). One may then snoop on other effects while interpreting. Moreover, the handlers may be scattered around program; they don't have to be all at the very top. Crucially, unlike data types a la carte, extensible effects provide effect encapsulation: one can not only add effects but subtract them, by completely handling the effects. The type system ensures that all effects must be completely handled at the end. From nickolay.kudasov at gmail.com Tue Nov 26 12:20:15 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Tue, 26 Nov 2013 16:20:15 +0400 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: <20131126105146.49662.qmail@www1.g3.pair.com> References: <20131126105146.49662.qmail@www1.g3.pair.com> Message-ID: Hi Oleg, These extensible effects are great, thank you for bringing them up! However it seems that the code is still under early development. Could you please elaborate on the current state of the project? Can it be considered stable? Where should I look for the uses of extensible effects? Thanks in advance, Nick 2013/11/26 > > Alejandro Serrano Mena wrote: > > I really like the separation between providing a data type and then a > > interpretation that operational embodies... > > Then perhaps you may like extensible effects then. They are designed > around the separation of requestors and their interpreters. However, the > set of requests is open (and can be extended at any time without > recompiling the program). Likewise the interpreters can be extended > incrementally. One can add an interpreter for an effect without caring > what other effects are there -- unless one has some reason for caring > about other effects (e.g.,m for finalization). One may then snoop on > other effects while interpreting. Moreover, the handlers may be > scattered around program; they don't have to be all at the very top. > > Crucially, unlike data types a la carte, extensible effects provide > effect encapsulation: one can not only add effects but subtract them, > by completely handling the effects. The type system ensures that all > effects must be completely handled at the end. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.bleijenberg at lijbrandt.nl Tue Nov 26 16:06:32 2013 From: k.bleijenberg at lijbrandt.nl (Kees Bleijenberg) Date: Tue, 26 Nov 2013 17:06:32 +0100 Subject: [Haskell-cafe] using external instance declarations Message-ID: <001901ceeac1$79109280$6b31b780$@bleijenberg@lijbrandt.nl> I have a Building with a field glass: Glass. I want to use quickcheck. Therefor I wrote a TestGlass.hs with the Arbitrary instance declaration for Glass. I also want to make Building an instance of Arbitrary. For the field glass in the Building I need the arbitrary :: Gen Glass function out of TestGlass.hs. How do I export and use the instance declarations from TestGlass.hs? Glass.hs module Glass( Glass(..)) where data Glass = Glass Int TestGlass.hs module TestGlass() where import Test.QuickCheck import Test.QuickCheck.Gen import Glass instance Arbitrary Glass where arbitrary = do n <- choose (1,8) :: Gen Int return $ Glass n Building.hs module Building () where import Glass import TestGlass import Test.QuickCheck import Test.QuickCheck.Gen data Building = Building { glass :: Glass } instance Arbitrary Building where arbitrary = do g <- arbitrary :: (Gen Glass) return Building { glass = g} When I compile Building I get: Building.hs:13:23: Ambiguous occurrence `arbitrary' It could refer to either `Building.arbitrary', defined at Building.hs:12:1 or `Test.QuickCheck.arbitrary', imported from `Test.QuickCheck' at Building.hs:5:1-22 (and originally defined in `Test.QuickCheck.Arbitrary') It looks like the compiler doesn't look at the instance declarations in the TestGlass module. What is wrong in my code? I want to split the testcode as much as possible from the non-test code and I don't want to merge the modules Building and Glass (they are both already big). Kees -------------- next part -------------- An HTML attachment was scrubbed... URL: From lightquake at amateurtopologist.com Tue Nov 26 16:36:52 2013 From: lightquake at amateurtopologist.com (Kata) Date: Tue, 26 Nov 2013 11:36:52 -0500 Subject: [Haskell-cafe] using external instance declarations In-Reply-To: <5294c724.45230f0a.7369.1748SMTPIN_ADDED_BROKEN@mx.google.com> References: <5294c724.45230f0a.7369.1748SMTPIN_ADDED_BROKEN@mx.google.com> Message-ID: <2E52484D8ACC4D8EBFBE8DD15EB922C8@amateurtopologist.com> The problem is that your definition of arbitrary for the Building instance isn?t indented under the ?instance Arbitrary Building?, so it?s getting interpreted as two top-level statements: one that Building is an Arbitrary of Instance, and one that defines a value named ?arbitrary?. Hence the error message. To fix this, just indent the definition of arbitrary like you did in the Glass definition. On Tuesday, November 26, 2013 at 11:06 AM, Kees Bleijenberg wrote: > I have a Building with a field glass: Glass. > I want to use quickcheck. Therefor I wrote a TestGlass.hs with the Arbitrary instance declaration for Glass. I also want to make Building an instance of Arbitrary. For the field glass in the Building I need the arbitrary :: Gen Glass function out of TestGlass.hs. > How do I export and use the instance declarations from TestGlass.hs? > > Glass.hs > module Glass( > Glass(..)) > where > data Glass = Glass Int > > TestGlass.hs > module TestGlass() > where > import Test.QuickCheck > import Test.QuickCheck.Gen > import Glass > > instance Arbitrary Glass where > arbitrary = do > n <- choose (1,8) :: Gen Int > return $ Glass n > > > Building.hs > module Building () > where > import Glass > import TestGlass > import Test.QuickCheck > import Test.QuickCheck.Gen > > data Building = Building { > glass :: Glass > } > instance Arbitrary Building where > arbitrary = do > g <- arbitrary :: (Gen Glass) > return Building { glass = g} > > > When I compile Building I get: > Building.hs:13:23: > Ambiguous occurrence `arbitrary' > It could refer to either `Building.arbitrary', > defined at Building.hs:12:1 > or `Test.QuickCheck.arbitrary', > imported from `Test.QuickCheck' at Building.hs:5:1-22 > (and originally defined in `Test.QuickCheck.Arbitrary') > > It looks like the compiler doesn?t look at the instance declarations in the TestGlass module. > What is wrong in my code? > I want to split the testcode as much as possible from the non-test code and I don?t want to merge the modules Building and Glass (they are both already big). > > Kees > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org (mailto:Haskell-Cafe at haskell.org) > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atzeus at gmail.com Tue Nov 26 17:09:40 2013 From: atzeus at gmail.com (Atze van der Ploeg) Date: Tue, 26 Nov 2013 18:09:40 +0100 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated Message-ID: Dear all, Extensible records have been a long outstanding feature request for GHC. Using the new closed type families and type literals, it is actually possible to implement Daan Leijen's "`Extensible Records with Scoped Labels" system as a library. I have implemented this library at https://github.com/atzeus/openrec (the documentation is at http://homepages.cwi.nl/~ploeg/openrecvardocs/). The only thing it requires is the availability of a closed type family that compares two type level symbols (i.e. the ordering on strings): type family (m :: Symbol) <=.? (n :: Symbol) :: Bool patches to GHC that implement this built-in closed type family are also at the github site. I would like to generate some discussion about: * Is this the interface we would like for open records and variants? * Would it be worthwhile to invest in syntactic sugar for open record operations? * Any comments on the interface and or its implementation? Cheers! Atze van der Ploeg -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Tue Nov 26 17:20:54 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Tue, 26 Nov 2013 09:20:54 -0800 Subject: [Haskell-cafe] btc-e interfacing + bot In-Reply-To: References: Message-ID: Hi Miro - I'm interested. I've done a little work on the network-bitcoin package. Feel free to contact me. On Tue, Nov 26, 2013 at 12:58 AM, Miro Karpis wrote: > Am thinking to inteface btc-e + make a bot. Anybody willing to join forces? > > m. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From malarkannan.p at gmail.com Tue Nov 26 20:23:55 2013 From: malarkannan.p at gmail.com (Malar Kannan) Date: Wed, 27 Nov 2013 01:53:55 +0530 Subject: [Haskell-cafe] btc-e interfacing + bot In-Reply-To: References: Message-ID: count me in. On Tue, Nov 26, 2013 at 2:28 PM, Miro Karpis wrote: > Am thinking to inteface btc-e + make a bot. Anybody willing to join forces? > > m. > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vogt.adam at gmail.com Tue Nov 26 21:00:06 2013 From: vogt.adam at gmail.com (adam vogt) Date: Tue, 26 Nov 2013 16:00:06 -0500 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: Hi Atze, The following code I come up with using your variants is unsatisfying for a couple reasons I explain below: case inj (Label :: Label "x") 1 of v | Left one <- decomp (Label :: Label "x") v -> one :: Double _ -> 5 -- aside: any guarantees about this being unreachable? First, decomp is like lookup to me, so I expected the Right constructor for when that lookup succeeds. Second, (Label :: Label "x") is a pretty unacceptable way to write what is just x in other languages. One idea would be to follow and create values/labels which will do something like: x .=. 1 -- call to inj perhaps? v ^? x -- call to decomp Another idea is to make `x stand for (Label :: Label "x"), much like 'x and ''x in template haskell. Trying out a good syntax by using a quasiquoter or preprocessor before getting something into ghc is probably worth doing. One example that has not been as useful as originally thought it would be is: Third, I think the literal 1 needs a type annotation, but it should be possible for it to be constrained to Double. On a somewhat related note, would your strategy of having sorted labels give better compile times for for code which uses records that are a bit larger than a toy example: Regards, Adam Vogt On Tue, Nov 26, 2013 at 12:09 PM, Atze van der Ploeg wrote: > Dear all, > > Extensible records have been a long outstanding feature request for GHC. > Using the new closed type families and type literals, it is actually > possible to implement Daan Leijen's "`Extensible Records with Scoped Labels" > system as a library. > > I have implemented this library at https://github.com/atzeus/openrec (the > documentation is at http://homepages.cwi.nl/~ploeg/openrecvardocs/). The > only thing it requires is the availability of a closed type family that > compares two type level symbols (i.e. the ordering on strings): > type family (m :: Symbol) <=.? (n :: Symbol) :: Bool > patches to GHC that implement this built-in closed type family are also at > the github site. > > I would like to generate some discussion about: > * Is this the interface we would like for open records and variants? > * Would it be worthwhile to invest in syntactic sugar for open record > operations? > * Any comments on the interface and or its implementation? > > Cheers! > > Atze van der Ploeg > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From d.scheftelowitsch at gmail.com Tue Nov 26 21:43:53 2013 From: d.scheftelowitsch at gmail.com (Dimitri Scheftelowitsch) Date: Tue, 26 Nov 2013 22:43:53 +0100 Subject: [Haskell-cafe] btc-e interfacing + bot In-Reply-To: References: Message-ID: <20131126214353.GA63018@hermes.s13h.eu> Hi, I'd like to, too :) Cheers, Dimitri -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 275 bytes Desc: Digital signature URL: From benjamin.foppa at gmail.com Tue Nov 26 22:30:18 2013 From: benjamin.foppa at gmail.com (Ben Foppa) Date: Tue, 26 Nov 2013 14:30:18 -0800 (PST) Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: <20131126105146.49662.qmail@www1.g3.pair.com> Message-ID: Hi Nick, Uploader and current maintainer of the extensible-effects package here. Although I'm still confused myself about the more theoretical bits of extensible-effects, I think I might be able to shed some light on it from a user's and maintainer's perspective. extensible-effects is currently operational, and works quite well wherever I use it. That said, it's a new package and I'd expect some shifts before it settles down. In general, extensible-effects seems to be applicable in most cases where one might think "hey, I should make a Monad for this". The base extensible-effects package includes "translations" of Control.Monad.Fresh, as well as Control.Monad.State.Strict . Clark Gaebel has also created the system-random-effectpackage for (pure) random number generation via the extensible-effects interface. Although the implementations will generally differ from traditional monadic implementations, the usage is remarkably similar (by far the most common use I've had of extensible-effects is using do-notation). Hope this helps, Ben Foppa On Tuesday, 26 November 2013 07:20:15 UTC-5, Nickolay Kudasov wrote: > > Hi Oleg, > > These extensible effects are great, thank you for bringing them up! > > However it seems that the code is still under early development. > Could you please elaborate on the current state of the project? > Can it be considered stable? > Where should I look for the uses of extensible effects? > > Thanks in advance, > Nick > > > 2013/11/26 > > >> >> Alejandro Serrano Mena wrote: >> > I really like the separation between providing a data type and then a >> > interpretation that operational embodies... >> >> Then perhaps you may like extensible effects then. They are designed >> around the separation of requestors and their interpreters. However, the >> set of requests is open (and can be extended at any time without >> recompiling the program). Likewise the interpreters can be extended >> incrementally. One can add an interpreter for an effect without caring >> what other effects are there -- unless one has some reason for caring >> about other effects (e.g.,m for finalization). One may then snoop on >> other effects while interpreting. Moreover, the handlers may be >> scattered around program; they don't have to be all at the very top. >> >> Crucially, unlike data types a la carte, extensible effects provide >> effect encapsulation: one can not only add effects but subtract them, >> by completely handling the effects. The type system ensures that all >> effects must be completely handled at the end. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskel... at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From evohunz at gmail.com Wed Nov 27 00:34:49 2013 From: evohunz at gmail.com (Thiago Negri) Date: Tue, 26 Nov 2013 22:34:49 -0200 Subject: [Haskell-cafe] Need help: Cabal rejecting stringsearch, conflict in base Message-ID: I don't know what to do. :-( I can't install scotty or yesod. $ cabal install scotty cabal: Could not resolve dependencies: trying: scotty-0.5.0 (user goal) trying: base-4.7.0.0/installed-dc1... (dependency of scotty-0.5.0) trying: wai-extra-1.3.4.6 (dependency of scotty-0.5.0) trying: stringsearch-0.3.6.4 (dependency of wai-extra-1.3.4.6) rejecting: stringsearch-0.3.6.4:-base3 (conflict: base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=2 && <3) rejecting: stringsearch-0.3.6.4:+base3 (conflict: base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=3 && <4) Backjump limit reached (change with --max-backjumps). -------------- next part -------------- An HTML attachment was scrubbed... URL: From cgaebel at uwaterloo.ca Wed Nov 27 00:41:31 2013 From: cgaebel at uwaterloo.ca (Clark Gaebel) Date: Tue, 26 Nov 2013 19:41:31 -0500 Subject: [Haskell-cafe] Need help: Cabal rejecting stringsearch, conflict in base In-Reply-To: References: Message-ID: You've got two options: 1) (the easy way) rm -rf ~/.ghc ~/.cabal cabal update cabal install scotty 2) (the hard way, ghc 7.6+ only) Use a sandbox! cd path/to/my/project/that/uses/scotty cabal sandbox init cabal install --only-dependencies -j # make sure scotty is a dependency of your project cabal configure cabal build 3) use cabal-dev. similar to using sandboxes, but I don't have it any more so can't give you a step-by-step. On Tue, Nov 26, 2013 at 7:34 PM, Thiago Negri wrote: > I don't know what to do. :-( > I can't install scotty or yesod. > > $ cabal install scotty > cabal: Could not resolve dependencies: > trying: scotty-0.5.0 (user goal) > trying: base-4.7.0.0/installed-dc1... (dependency of scotty-0.5.0) > trying: wai-extra-1.3.4.6 (dependency of scotty-0.5.0) > trying: stringsearch-0.3.6.4 (dependency of wai-extra-1.3.4.6) > rejecting: stringsearch-0.3.6.4:-base3 (conflict: > base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=2 && > <3) > rejecting: stringsearch-0.3.6.4:+base3 (conflict: > base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=3 && > <4) > Backjump limit reached (change with --max-backjumps). > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Clark. Key ID : 0x78099922 Fingerprint: B292 493C 51AE F3AB D016 DD04 E5E3 C36F 5534 F907 -------------- next part -------------- An HTML attachment was scrubbed... URL: From efsubenovex at gmail.com Wed Nov 27 01:46:32 2013 From: efsubenovex at gmail.com (Schell Scivally) Date: Tue, 26 Nov 2013 17:46:32 -0800 Subject: [Haskell-cafe] Need help: Cabal rejecting stringsearch, conflict in base In-Reply-To: References: Message-ID: It looks like you're using ghc7.7 (soon 7.8) since you're on base-4.7. A lot of packages just aren't ready for ghc7.7. Either they need bumps to their dependencies or they need Typeable updates or...or... If you want to live in the future I'd suggest following the packages in question to their git repos, cloning them and using those (and possibly patching them). I've been doing as much of this as I can and it's been working! Though I may be misunderstanding your problem and in that case - ignore me! :) On Tue, Nov 26, 2013 at 4:41 PM, Clark Gaebel wrote: > You've got two options: > > 1) (the easy way) > > rm -rf ~/.ghc ~/.cabal > cabal update > cabal install scotty > > 2) (the hard way, ghc 7.6+ only) > > Use a sandbox! > > cd path/to/my/project/that/uses/scotty > cabal sandbox init > cabal install --only-dependencies -j # make sure scotty is a dependency of > your project > cabal configure > cabal build > > 3) use cabal-dev. similar to using sandboxes, but I don't have it any more > so can't give you a step-by-step. > > > On Tue, Nov 26, 2013 at 7:34 PM, Thiago Negri wrote: > >> I don't know what to do. :-( >> I can't install scotty or yesod. >> >> $ cabal install scotty >> cabal: Could not resolve dependencies: >> trying: scotty-0.5.0 (user goal) >> trying: base-4.7.0.0/installed-dc1... (dependency of scotty-0.5.0) >> trying: wai-extra-1.3.4.6 (dependency of scotty-0.5.0) >> trying: stringsearch-0.3.6.4 (dependency of wai-extra-1.3.4.6) >> rejecting: stringsearch-0.3.6.4:-base3 (conflict: >> base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=2 && >> <3) >> rejecting: stringsearch-0.3.6.4:+base3 (conflict: >> base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=3 && >> <4) >> Backjump limit reached (change with --max-backjumps). >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Clark. > > Key ID : 0x78099922 > Fingerprint: B292 493C 51AE F3AB D016 DD04 E5E3 C36F 5534 F907 > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Schell Scivally http://blog.efnx.com http://github.com/schell http://twitter.com/schellsan -------------- next part -------------- An HTML attachment was scrubbed... URL: From daniel.is.fischer at googlemail.com Wed Nov 27 01:55:31 2013 From: daniel.is.fischer at googlemail.com (Daniel Fischer) Date: Wed, 27 Nov 2013 02:55:31 +0100 Subject: [Haskell-cafe] Need help: Cabal rejecting stringsearch, conflict in base In-Reply-To: References: Message-ID: <5752667.W5DHS4R22y@linux-hpeb.site> On Tuesday 26 November 2013, 22:34:49, Thiago Negri wrote: > I don't know what to do. :-( > I can't install scotty or yesod. > > $ cabal install scotty > cabal: Could not resolve dependencies: > trying: scotty-0.5.0 (user goal) > trying: base-4.7.0.0/installed-dc1... (dependency of scotty-0.5.0) > trying: wai-extra-1.3.4.6 (dependency of scotty-0.5.0) > trying: stringsearch-0.3.6.4 (dependency of wai-extra-1.3.4.6) > rejecting: stringsearch-0.3.6.4:-base3 (conflict: > base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=2 && <3) > rejecting: stringsearch-0.3.6.4:+base3 (conflict: > base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=3 && <4) > Backjump limit reached (change with --max-backjumps). I've just uploaded 0.3.6.5 that allows array-0.5, which probably was the problem. Hopefully it will work now. From trupill at gmail.com Wed Nov 27 07:49:13 2013 From: trupill at gmail.com (Alejandro Serrano Mena) Date: Wed, 27 Nov 2013 08:49:13 +0100 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: <20131126105146.49662.qmail@www1.g3.pair.com> References: <20131126105146.49662.qmail@www1.g3.pair.com> Message-ID: Thanks for the pointer! :) The extensible-effects package seems very interesting. I would really like to have instances of all usual monads: Reader, Writer, State.Lazy and so on in the package. Maybe that's a project for the future :) Even so, I'm still interesting in understanding my original concerns with free vs. operational, specially the "baking algebraic laws" part and whether it's good to replace operational with free-operational altogether. 2013/11/26 > > Alejandro Serrano Mena wrote: > > I really like the separation between providing a data type and then a > > interpretation that operational embodies... > > Then perhaps you may like extensible effects then. They are designed > around the separation of requestors and their interpreters. However, the > set of requests is open (and can be extended at any time without > recompiling the program). Likewise the interpreters can be extended > incrementally. One can add an interpreter for an effect without caring > what other effects are there -- unless one has some reason for caring > about other effects (e.g.,m for finalization). One may then snoop on > other effects while interpreting. Moreover, the handlers may be > scattered around program; they don't have to be all at the very top. > > Crucially, unlike data types a la carte, extensible effects provide > effect encapsulation: one can not only add effects but subtract them, > by completely handling the effects. The type system ensures that all > effects must be completely handled at the end. > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickolay.kudasov at gmail.com Wed Nov 27 07:57:41 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Wed, 27 Nov 2013 11:57:41 +0400 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: <20131126105146.49662.qmail@www1.g3.pair.com> Message-ID: Hi Alejandro, I suspect that "baking algebraic laws" means "getting monad laws for free". There's a talk by Andres Loh [1] in which he explains some approaches to custom EDSLs in Haskell, namely, using GADTs and free monads. The former is actually what `operational` implements and the latter is the `free` package. [1] http://skillsmatter.com/podcast/home/monads-for-free/te-8320 2013/11/27 Alejandro Serrano Mena > Thanks for the pointer! :) > The extensible-effects package seems very interesting. I would really like > to have instances of all usual monads: Reader, Writer, State.Lazy and so on > in the package. Maybe that's a project for the future :) > > Even so, I'm still interesting in understanding my original concerns with > free vs. operational, specially the "baking algebraic laws" part and > whether it's good to replace operational with free-operational altogether. > > > 2013/11/26 > > >> Alejandro Serrano Mena wrote: >> > I really like the separation between providing a data type and then a >> > interpretation that operational embodies... >> >> Then perhaps you may like extensible effects then. They are designed >> around the separation of requestors and their interpreters. However, the >> set of requests is open (and can be extended at any time without >> recompiling the program). Likewise the interpreters can be extended >> incrementally. One can add an interpreter for an effect without caring >> what other effects are there -- unless one has some reason for caring >> about other effects (e.g.,m for finalization). One may then snoop on >> other effects while interpreting. Moreover, the handlers may be >> scattered around program; they don't have to be all at the very top. >> >> Crucially, unlike data types a la carte, extensible effects provide >> effect encapsulation: one can not only add effects but subtract them, >> by completely handling the effects. The type system ensures that all >> effects must be completely handled at the end. >> >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atzeus at gmail.com Wed Nov 27 08:08:04 2013 From: atzeus at gmail.com (Atze van der Ploeg) Date: Wed, 27 Nov 2013 09:08:04 +0100 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: Actually, after your email I played around with variants and it turns out they don't work at all. I'll rework the variants. The records work beatifully though. > First, decomp is like lookup to me, so I expected the Right > constructor for when that lookup succeeds. Agreed! > Second, (Label :: Label "x") is a pretty unacceptable way to write > what is just x in other languages. One idea would be to > follow < http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-Labelable.html > > and create values/labels which will do something like: > > x .=. 1 -- call to inj perhaps? > > v ^? x -- call to decomp > > Another idea is to make `x stand for (Label :: Label "x"), > much like 'x and ''x in template haskell. Trying out > a good syntax by using a quasiquoter or preprocessor > before getting something into ghc is probably worth doing. > One example that has not been as useful as originally > thought it would be is: > < http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-RecordPuns.html > Yes, that is currently the most painful bit of the syntax. It should be possible to adopt HList labelable. I would like a small syntactic extension that allows 'x for (Label :: Label "x") indeed. I'll probably hack this up later. > On a somewhat related note, would your strategy of > having sorted labels give better compile times for > for code which uses records that are a bit larger > than a toy example: > Depends, as far as I understand HList record sometimes require searching for a permutation of l such that l~l' which seems expensive to me. This is not necessary if we keep the row sorted. For projections and decompositions the performance is (theoretically) the same: linear searching in a list (sorted or unsorted list) is O(n). The real benefit of keeping the row sorted is that { x = 0 , y = 0 } and { y = 0, x = 0 } have the same type. When a row is not sorted, as in HList, then if we for example have an instance Eq for a row (because all elements support Eq) then for using (==) both arguments would have to the same order in the row or we need a manual call to a permutation function. When keeping the row ordered, this is not necessary. The same kind of problem occurs when we fix the type of a function to a specific row: ( using whishful syntax ) f :: Rec [ x = Int , y = Int ] -> Int If the row is not ordered, then f { y = 0 , x = 0 } will not typecheck and will require a manual call to permute the row. Cheers! Atze > > > > Regards, > Adam Vogt > > On Tue, Nov 26, 2013 at 12:09 PM, Atze van der Ploeg wrote: > > Dear all, > > > > Extensible records have been a long outstanding feature request for GHC. > > Using the new closed type families and type literals, it is actually > > possible to implement Daan Leijen's "`Extensible Records with Scoped Labels" > > system as a library. > > > > I have implemented this library at https://github.com/atzeus/openrec(the > > documentation is at http://homepages.cwi.nl/~ploeg/openrecvardocs/). The > > only thing it requires is the availability of a closed type family that > > compares two type level symbols (i.e. the ordering on strings): > > type family (m :: Symbol) <=.? (n :: Symbol) :: Bool > > patches to GHC that implement this built-in closed type family are also at > > the github site. > > > > I would like to generate some discussion about: > > * Is this the interface we would like for open records and variants? > > * Would it be worthwhile to invest in syntactic sugar for open record > > operations? > > * Any comments on the interface and or its implementation? > > > > Cheers! > > > > Atze van der Ploeg > > > > _______________________________________________ > > Haskell-Cafe mailing list > > Haskell-Cafe at haskell.org > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From trupill at gmail.com Wed Nov 27 08:34:32 2013 From: trupill at gmail.com (Alejandro Serrano Mena) Date: Wed, 27 Nov 2013 09:34:32 +0100 Subject: [Haskell-cafe] Monad classes and FreeT Message-ID: Dear Caf?, I'm continuing my travel through operational and free, and was wondering: which is the reason why there's no instance such as (Functor f, MonadReader e m) => MonadReader e (FreeT f m) included in the 'free' package? It seems reasonable to me to have those instances. At least, there's the corresponding one for MonadIO. Should Free be considered as some monad to have 'at the bottom of the stack' as IO is? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nickolay.kudasov at gmail.com Wed Nov 27 08:55:12 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Wed, 27 Nov 2013 12:55:12 +0400 Subject: [Haskell-cafe] Monad classes and FreeT In-Reply-To: References: Message-ID: Hi Alejandro, That instance (and others) should be in HEAD [1] and will be included in the next release. As for considering Free at ?the bottom of the stack?, I?m not sure I understand what you mean. Nonetheless, I think FreeT f m a can be considered as m actions *delimited* by f actions. Thus Free f a being simply FreeT f Identity a is just a ?sequence? of f actions to be interpreted. [1] https://github.com/ekmett/free 2013/11/27 Alejandro Serrano Mena > Dear Caf?, > I'm continuing my travel through operational and free, and was wondering: > which is the reason why there's no instance such as > > (Functor f, MonadReader e m) => MonadReader e (FreeT f m) > > included in the 'free' package? It seems reasonable to me to have those > instances. At least, there's the corresponding one for MonadIO. > > Should Free be considered as some monad to have 'at the bottom of the > stack' as IO is? > > Thanks in advance. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From trupill at gmail.com Wed Nov 27 09:00:00 2013 From: trupill at gmail.com (Alejandro Serrano Mena) Date: Wed, 27 Nov 2013 10:00:00 +0100 Subject: [Haskell-cafe] Monad classes and FreeT In-Reply-To: References: Message-ID: Great! When is the new package expected to be uploaded? Thanks very much :) 2013/11/27 Nickolay Kudasov > Hi Alejandro, > > That instance (and others) should be in HEAD [1] and will be included in > the next release. > > As for considering Free at ?the bottom of the stack?, I?m not sure I > understand what you mean. Nonetheless, I think FreeT f m a can be > considered as m actions *delimited* by f actions. Thus Free f a being > simply FreeT f Identity a is just a ?sequence? of f actions to be > interpreted. > > [1] https://github.com/ekmett/free > > > 2013/11/27 Alejandro Serrano Mena > >> Dear Caf?, >> I'm continuing my travel through operational and free, and was wondering: >> which is the reason why there's no instance such as >> >> (Functor f, MonadReader e m) => MonadReader e (FreeT f m) >> >> included in the 'free' package? It seems reasonable to me to have those >> instances. At least, there's the corresponding one for MonadIO. >> >> Should Free be considered as some monad to have 'at the bottom of the >> stack' as IO is? >> >> Thanks in advance. >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Wed Nov 27 09:24:55 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Wed, 27 Nov 2013 04:24:55 -0500 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: very cool work! Thanks for sharing! The ordering on symbols to get rid of the permutation issue is slick. you should perhaps also share on the ghc-devs list, or maybe throw your design ideas on a page on the ghc wiki, to document them? -Carter On Wed, Nov 27, 2013 at 3:08 AM, Atze van der Ploeg wrote: > Actually, after your email I played around with variants and it turns out > they don't work at all. I'll rework the variants. The records work > beatifully though. > > > First, decomp is like lookup to me, so I expected the Right > > constructor for when that lookup succeeds. > > Agreed! > > > Second, (Label :: Label "x") is a pretty unacceptable way to write > > what is just x in other languages. One idea would be to > > follow < > http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-Labelable.html > > > > and create values/labels which will do something like: > > > > x .=. 1 -- call to inj perhaps? > > > > v ^? x -- call to decomp > > > > Another idea is to make `x stand for (Label :: Label "x"), > > much like 'x and ''x in template haskell. Trying out > > a good syntax by using a quasiquoter or preprocessor > > before getting something into ghc is probably worth doing. > > One example that has not been as useful as originally > > thought it would be is: > > < > http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-RecordPuns.html > > > > Yes, that is currently the most painful bit of the syntax. It should be > possible to adopt HList labelable. I would like a small syntactic extension > that allows 'x for (Label :: Label "x") indeed. I'll probably hack this up > later. > > > On a somewhat related note, would your strategy of > > having sorted labels give better compile times for > > for code which uses records that are a bit larger > > than a toy example: > > > > Depends, as far as I understand HList record sometimes require searching > for a permutation of l such that l~l' which seems expensive to me. This is > not necessary if we keep the row sorted. For projections and decompositions > the performance is (theoretically) the same: linear searching in a list > (sorted or unsorted list) is O(n). > > The real benefit of keeping the row sorted is that { x = 0 , y = 0 } and { > y = 0, x = 0 } have the same type. When a row is not sorted, as in HList, > then if we for example have an instance Eq for a row (because all elements > support Eq) then for using (==) both arguments would have to the same order > in the row or we need a manual call to a permutation function. When keeping > the row ordered, this is not necessary. The same kind of problem occurs > when we fix the type of a function to a specific row: > ( using whishful syntax ) > f :: Rec [ x = Int , y = Int ] -> Int > > If the row is not ordered, then f { y = 0 , x = 0 } will not typecheck and > will require a manual call to permute the row. > > Cheers! > > Atze > > > > > > > > > Regards, > > Adam Vogt > > > > On Tue, Nov 26, 2013 at 12:09 PM, Atze van der Ploeg > wrote: > > > Dear all, > > > > > > Extensible records have been a long outstanding feature request for > GHC. > > > Using the new closed type families and type literals, it is actually > > > possible to implement Daan Leijen's "`Extensible Records with Scoped > Labels" > > > system as a library. > > > > > > I have implemented this library at https://github.com/atzeus/openrec(the > > > documentation is at http://homepages.cwi.nl/~ploeg/openrecvardocs/). > The > > > only thing it requires is the availability of a closed type family that > > > compares two type level symbols (i.e. the ordering on strings): > > > type family (m :: Symbol) <=.? (n :: Symbol) :: Bool > > > patches to GHC that implement this built-in closed type family are > also at > > > the github site. > > > > > > I would like to generate some discussion about: > > > * Is this the interface we would like for open records and variants? > > > * Would it be worthwhile to invest in syntactic sugar for open record > > > operations? > > > * Any comments on the interface and or its implementation? > > > > > > Cheers! > > > > > > Atze van der Ploeg > > > > > > _______________________________________________ > > > Haskell-Cafe mailing list > > > Haskell-Cafe at haskell.org > > > http://www.haskell.org/mailman/listinfo/haskell-cafe > > > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From atzeus at gmail.com Wed Nov 27 09:43:40 2013 From: atzeus at gmail.com (Atze van der Ploeg) Date: Wed, 27 Nov 2013 10:43:40 +0100 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: > very cool work! Thanks for sharing! The ordering on symbols to get rid of the permutation issue is slick. Thanks! > > you should perhaps also share on the ghc-devs list, or maybe throw your design ideas on a page on the ghc wiki, to document them? Good idea! I'll do that friday, i'll keep you posted. > > > On Wed, Nov 27, 2013 at 3:08 AM, Atze van der Ploeg wrote: >> >> Actually, after your email I played around with variants and it turns out they don't work at all. I'll rework the variants. The records work beatifully though. >> >> > First, decomp is like lookup to me, so I expected the Right >> > constructor for when that lookup succeeds. >> >> Agreed! >> >> > Second, (Label :: Label "x") is a pretty unacceptable way to write >> > what is just x in other languages. One idea would be to >> > follow < http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-Labelable.html > >> > and create values/labels which will do something like: >> > >> > x .=. 1 -- call to inj perhaps? >> > >> > v ^? x -- call to decomp >> > >> > Another idea is to make `x stand for (Label :: Label "x"), >> > much like 'x and ''x in template haskell. Trying out >> > a good syntax by using a quasiquoter or preprocessor >> > before getting something into ghc is probably worth doing. >> > One example that has not been as useful as originally >> > thought it would be is: >> > < http://hackage.haskell.org/package/HList-0.3.0.1/docs/Data-HList-RecordPuns.html > >> >> Yes, that is currently the most painful bit of the syntax. It should be possible to adopt HList labelable. I would like a small syntactic extension that allows 'x for (Label :: Label "x") indeed. I'll probably hack this up later. >> >> > On a somewhat related note, would your strategy of >> > having sorted labels give better compile times for >> > for code which uses records that are a bit larger >> > than a toy example: >> > >> >> Depends, as far as I understand HList record sometimes require searching for a permutation of l such that l~l' which seems expensive to me. This is not necessary if we keep the row sorted. For projections and decompositions the performance is (theoretically) the same: linear searching in a list (sorted or unsorted list) is O(n). >> >> The real benefit of keeping the row sorted is that { x = 0 , y = 0 } and { y = 0, x = 0 } have the same type. When a row is not sorted, as in HList, then if we for example have an instance Eq for a row (because all elements support Eq) then for using (==) both arguments would have to the same order in the row or we need a manual call to a permutation function. When keeping the row ordered, this is not necessary. The same kind of problem occurs when we fix the type of a function to a specific row: >> ( using whishful syntax ) >> f :: Rec [ x = Int , y = Int ] -> Int >> >> If the row is not ordered, then f { y = 0 , x = 0 } will not typecheck and will require a manual call to permute the row. >> >> Cheers! >> >> Atze >> >> >> > >> > >> > >> > Regards, >> > Adam Vogt >> > >> > On Tue, Nov 26, 2013 at 12:09 PM, Atze van der Ploeg wrote: >> > > Dear all, >> > > >> > > Extensible records have been a long outstanding feature request for GHC. >> > > Using the new closed type families and type literals, it is actually >> > > possible to implement Daan Leijen's "`Extensible Records with Scoped Labels" >> > > system as a library. >> > > >> > > I have implemented this library at https://github.com/atzeus/openrec(the >> > > documentation is at http://homepages.cwi.nl/~ploeg/openrecvardocs/). The >> > > only thing it requires is the availability of a closed type family that >> > > compares two type level symbols (i.e. the ordering on strings): >> > > type family (m :: Symbol) <=.? (n :: Symbol) :: Bool >> > > patches to GHC that implement this built-in closed type family are also at >> > > the github site. >> > > >> > > I would like to generate some discussion about: >> > > * Is this the interface we would like for open records and variants? >> > > * Would it be worthwhile to invest in syntactic sugar for open record >> > > operations? >> > > * Any comments on the interface and or its implementation? >> > > >> > > Cheers! >> > > >> > > Atze van der Ploeg >> > > >> > > _______________________________________________ >> > > Haskell-Cafe mailing list >> > > Haskell-Cafe at haskell.org >> > > http://www.haskell.org/mailman/listinfo/haskell-cafe >> > > >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nominolo at googlemail.com Wed Nov 27 09:46:48 2013 From: nominolo at googlemail.com (Thomas Schilling) Date: Wed, 27 Nov 2013 10:46:48 +0100 Subject: [Haskell-cafe] Compiling to STG problem In-Reply-To: References: Message-ID: Renaming to "value1" is introduced by tidyProgram. I don't think -ddump-stg does that (but I haven't checked). What are you trying to do? The -ddump output is not really designed to be parseable. If you want to do something with STG you should either work directly with the output of the GHC "API" calls, or take that and serialise it to a format defined by you. On 21 November 2013 10:01, Maarten Dungen wrote: > Dear all, > > > While trying to retrieve the STG using ghc I bumped into the following > problem: > > > I try to compile the source file in a more or less standard way, found in > many examples on the web: > > ... > > setTargets targets > > _ <- load LoadAllTargets > > mgraph <- depanal [] False > > mapM_ (compileModSummary) mgraph > > > Then I compile the individual files through the following pipeline (also > more or less standard, I thought): > > > compileModSummary = do > > ... > > stg <- parseModule theMod > > >>= typecheckModule > > >>= desugarModule > > >>= liftIO . hscSimplify env . coreModule > > >>= liftIO . tidyProgram env > > >>= prepPgm env . fst > > >>= liftIO . coreToStg dynflags > > ? > > Then I do a dump to (just to check the results): > > > writeFile ?filename? (show . showOutputable $ stg) > > > The problem is, if I do a stg dump from the command line (like > -ddump-stg --make Main.hs (where is the intended compiler > program) the dump is different from the stg dump I do at writefile, to the > extent that functions are missing, which gives problems when linking the > results. They are numbered functions, like ?value1?, etc. I?m not very much > into the ghcmake stuff, and I?m probably missing a lot, however I have been > struggling with this for a couple of days now, and it is not getting any > clearer. > > > I guess my question would be, why is there a difference, and how could I > avoid this? Any help or pointers appreciated. > > > kind regards, > > > Maarten > > > p.s. This is just pseudo code. I necessary, I could probably strip my > sources into a working example that displays the problem, if that would > help. > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From tpadilha84 at gmail.com Wed Nov 27 12:07:31 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Wed, 27 Nov 2013 10:07:31 -0200 Subject: [Haskell-cafe] Cannot find HS*.o linked object for loading into ghci after last update Message-ID: Hi After last update, cabal-install stopped generating an HSfoo-VERSION.o(assuming the package name is 'foo') in the dist/build directory. How can I force cabal to generate this file again? From vogt.adam at gmail.com Wed Nov 27 18:37:11 2013 From: vogt.adam at gmail.com (adam vogt) Date: Wed, 27 Nov 2013 13:37:11 -0500 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: On Wed, Nov 27, 2013 at 3:08 AM, Atze van der Ploeg wrote: > Yes, that is currently the most painful bit of the syntax. It should be > possible to adopt HList labelable. I would like a small syntactic extension > that allows 'x for (Label :: Label "x") indeed. I'll probably hack this up > later. Did you mean to type 'x as opposed to `x? Using the former is going to make -XLabelQuotes (or whatever you like to call it) conflict with -XTemplateHaskell. I suppose you could make a class to disambiguate: class LeadingPrime s a where fromLeadingPrime :: Either String Language.Haskell.TH.Name -> Label s -> a -- standard 'name instance (name ~ Name) => LeadingPrime s name where fromLeadingPrime x _ = either error id x instance (s ~ s', label ~ Label) => LeadingPrime s (label s') where fromLeadingPrime _ x = x -- | this instance might go in HList... still -- you could get problems if another library, -- say Vinyl, also wants to do the same thing -- that doesn't fit in with the current Labelable instance (Labelable l p f s t a b, x ~ (a -> f b), y ~ (Record s -> f (Record t))) => LeadingPrime l (p x y) where fromLeadingPrime _ x = hLens' x The compiler would then replace 'x with fromLeadingPrime (Left "x not in scope") (Label :: Label "x"), or the Right contains the usual Name. This might have gone overboard with extensions. But I'm not sure you would be able to mix the following: $(varE 'x) -- normal template haskell \ record -> record ! 'x ! 'y -- 2nd instance \ record -> record^.'x.'y -- Labelable Another option would be to steal the leading backquote ` for Label only, which adds quite a bit of noise when you can't accept just a Label: \ record -> record^.hLens `x.hLens `y >> On a somewhat related note, would your strategy of >> having sorted labels give better compile times for >> for code which uses records that are a bit larger >> than a toy example: >> > > Depends, as far as I understand HList record sometimes require searching for > a permutation of l such that l~l' which seems expensive to me. This is not > necessary if we keep the row sorted. For projections and decompositions the > performance is (theoretically) the same: linear searching in a list (sorted > or unsorted list) is O(n). I see. I did a bit of a benchmark on compiling a module that just creates one record of size N, . It's not exactly O(n^2) as residuals show. My guess is the check for duplicate labels is to blame for this bad performance. A record of size 100 might be absurd and probably most people have better CPUs than the Core(TM)2 Duo CPU T7100 @ 1.80GHz I used, but it's still an issue. I imagine your ordered labels will fix this slow compile issue, but I guess somebody actually has to try it out to see. The full code is something like Regards, Adam From anthony_clayden at clear.net.nz Wed Nov 27 21:24:35 2013 From: anthony_clayden at clear.net.nz (AntC) Date: Wed, 27 Nov 2013 21:24:35 +0000 (UTC) Subject: [Haskell-cafe] =?utf-8?q?Return_of_the_revenge_of_the_revisit_of_?= =?utf-8?q?the=09extensible_records=2C_reiterated?= References: Message-ID: > Atze van der Ploeg gmail.com> writes: > > Extensible records have been a long outstanding feature request for GHC. Yes, that's because getting it right is difficult -- even if there were strong agreement on the objectives. > Using the new closed type families and type literals, > it is actually possible to implement > Daan Leijen's "`Extensible Records with Scoped Labels" > system as a library.? Atze, I apologise for pouring cold water on your efforts, but the only merit of Leijen's proposal is that it's (relatively) easy to implement. It's been "actually possible" at least since HList showed the way. This from Leijen's abstract: "A novel aspect of this work is that records can contain duplicate labels, ..." tells why it's easy to implement. It also tells why it's completely pointless. So if [**] what you've implemented allows duplicate labels in a record, I do not want it. (In fact, I wouldn't call it a record system.) Please refer to text books on the Relational Model, as to why it's a BAD THING. It's a big weakness in SQL, for example, but SQL doesn't get it as badly wrong as Leijen's proposal. The difficult part of extensible records is exactly avoiding duplicate labels. TRex achieved it, but needed costly language extensions. HList achieves it, using a fragile combination of extensions (and giving impenetrable type errors if your program gets it wrong). I think our best hope of building something workable is when Richard's overlapping/closed type functions gets into the language (and we probably have to allow time for the wrinkles to get ironed out). [**] I can't see from the docos whether you do allow duplicate labels. Since you refer to Leijen, I assume so. If you don't, I suggest you avoid the reference. There's plenty of other (better) proposals out there. AntC From hhochleitner at gmail.com Wed Nov 27 21:29:57 2013 From: hhochleitner at gmail.com (Herwig Hochleitner) Date: Wed, 27 Nov 2013 22:29:57 +0100 Subject: [Haskell-cafe] Fwd: vector fails to build with ghc on arm-linux-androideabi In-Reply-To: References: Message-ID: Hello, I'm trying to build the openpgp libs for android. I can build and run HaskellActivity from the HelloWorld sample, but as when I try to install vector, I get the following build failure: ==================== $ arm-linux-androideabi-cabal install --reinstall --force-reinstall vector ... [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( Data/Vector/Fusion/Stream/Monadic.hs, dist/build/Data/Vector/Fusion/Stream/Monadic.o ) Loading package ghc-prim ... linking ... ghc: /home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.7.20130921/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: unhandled ELF relocation(Rel) type 28 ghc: unable to load package `ghc-prim' Failed to install vector-0.10.9.1 ... ==================== It seems somewhat related to this closed bug: https://ghc.haskell.org/trac/ghc/ticket/7824 Am I doing something stupid? Can I fix this? cheers -------------- next part -------------- An HTML attachment was scrubbed... URL: From vogt.adam at gmail.com Thu Nov 28 00:10:31 2013 From: vogt.adam at gmail.com (adam vogt) Date: Wed, 27 Nov 2013 19:10:31 -0500 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: On Wed, Nov 27, 2013 at 4:24 PM, AntC wrote: > The difficult part of extensible records is exactly avoiding duplicate > labels. TRex achieved it, but needed costly language extensions. > HList achieves it, using a fragile combination of extensions > (and giving impenetrable type errors if your program gets it wrong). Hi AntC, Why do you say that errors regarding duplicate instances are impenetrable? They are verbose, but the information you need is there if you ignore that "possible fix" stuff. That is the same issue with type classes you may be familiar with in haskell98. An example of that is what you get from: mean xs = sum xs / length xs The HList type error looks like: No instance for (Fail * (DuplicatedLabel Symbol "x")) arising from a use of `.*.' Possible fix: add an instance declaration for (Fail * (DuplicatedLabel Symbol "x")) In the expression: x .=. 1 .*. x .=. 2 .*. emptyRecord In an equation for `r': r = x .=. 1 .*. x .=. 2 .*. emptyRecord -- the file responsible: {-# LANGUAGE DataKinds #-} import Data.HList.CommonMain; import GHC.TypeLits x = Label :: Label "x" r = x .=. 1 .*. x .=. 2 .*. emptyRecord > I think our best hope of building something workable > is when Richard's overlapping/closed type functions gets into > the language (and we probably have to allow time > for the wrinkles to get ironed out). Atze's code uses them. Failing when you insert an element whose label already exists can be done by adding another case in the `type family Inject' (line 113 of OpenRecVar.hs) like: Inject l t (l := t ::: x) = Failure '("duplicated label", l) This Failure is the same trick as done with Fail in HList except translated to type families. Unfortunately the type family Failure only shows up when you use the `x' below, not when you define it (as happens in the previous example). {-# LANGUAGE DataKinds, TypeFamilies, PolyKinds, UndecidableInstances #-} import GHC.TypeLits -- accepted, but not usable x :: F Int Double x = undefined type family F a b where F a a = Bool F a b = Failure '("type",a, "should be equal to",b) type family Failure (a :: k) {- the "error" you get out of trying to use x is now something like: No instance for (Show (Failure ((,,,) Symbol * Symbol *) '("type", Int, "should be equal to", Double))) Or perhaps something like: Expected type: (blah blah) Actual type: Failure ( ... ) -} The same type error is also delayed if you make a closed type family for Failure, which might be a ghc bug. One promising idea is to make an infinite loop to bring the error to attention earlier: Context reduction stack overflow; size = 201 Use -fcontext-stack=N to increase stack size to N Fail ((,,,) Symbol * Symbol *) '("type", Int, "should be equal to", Double) (Fail Symbol "infinite loop to bring this to your attention: don't raise the context stack please" t0) ~ a0 In the expression: undefined In an equation for ?x?: x = undefined -- the above message comes from: type family Fail (x::k) (a :: *) where Fail x a = Fail x (Fail "infinite loop to bring this to your attention: don't raise the context stack please" a) which gets used like: F a b = Fail '("type",a, "should be equal to",b) () Regards, Adam From anthony_clayden at clear.net.nz Thu Nov 28 02:22:41 2013 From: anthony_clayden at clear.net.nz (AntC) Date: Thu, 28 Nov 2013 02:22:41 +0000 (UTC) Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated References: Message-ID: > adam vogt gmail.com> writes: > > > On Wed, Nov 27, 2013 at 4:24 PM, AntC wrote: > > The difficult part of extensible records is exactly avoiding duplicate > > labels. TRex achieved it, but needed costly language extensions. > > HList achieves it, using a fragile combination of extensions > > (and giving impenetrable type errors if your program gets it wrong). > > > Why do you say that errors regarding duplicate instances are impenetrable? Hi Adam, So do you think you're disproving me by showing a message "No instance for ..."? _Obviously_ "No instances" means duplicate instances -- NOT! Errm anyway, I didn't say "duplicate instances": I said errors re duplicate **labels**. And I'm talking about HList, not Atze's work. Yes, one of the (sources of) errors is alleged missing instances. Another is iresolvably undecidable instances. Another is type mis-matches. Often a single mistake in the program triggers a whole slew of errors. (There might be multiple different record types in the pgm, variously mashed together, as happens in real-life databases. Finding the one mistake can be hard work.) Don't get me wrong, HList is a hugely impressive piece of work. Especially given how 'primitive' was Haskell at the time. It relies on overlapping instances. And Oleg (at least) has repeatedly expressed doubts about the whole overlap business. (There's hints of that in the HList paper.) Whether or not you agree with him, as one of the authors, I think we should pay attention. > > ... Richard's overlapping/closed type functions ... > Atze's code uses them. OK, good. (I didn't look at the code so much as at the stated design.) I did notice that Atze uses FunDeps as well as type functions. But that he doesn't use OverlappingInstances. (Or perhaps they're smuggled in via some of the imports?) I'm puzzled by Atze also needing extensions to the compiler to support closed DataKinds. > Failing when you insert an element whose label already exists > can be done ... Then PLEASE implement that. ... > ... This Failure is the same trick as done with Fail in HList ... ... AND show that the resulting error handling is tractable. (If I remember, the authors of HList regarded that way of failing as a 'hack', and were not very happy. Using Richard's closed type functions it should be possible to avoid that hack -- which is why I was wanting to use them. So I'm more puzzled. OTOH, I did feed raise that unhappy hack with Richard at the time, as a counter-example that I couldn't understand how he'd handle. So perhaps he didn't.) And PLEASE say that records _can't_ contain duplicate labels. And PLEASE don't mention Leijen's paper. Instead: compare/contrast the semantics to TRex, and to MPJ/SPJ's 'Lightweight Extensible' proposal (which was found to be a bit too heavyweight to implement ;-) AntC From oleg at okmij.org Thu Nov 28 03:01:47 2013 From: oleg at okmij.org (oleg at okmij.org) Date: 28 Nov 2013 03:01:47 -0000 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: Message-ID: <20131128030147.52849.qmail@www1.g3.pair.com> > The extensible-effects package seems very interesting. I would really like > to have instances of all usual monads: Reader, Writer, State.Lazy and so on > in the package. Maybe that's a project for the future :) There is already a Reader and Writer, in Control.Eff.State. I guess Ben Foppa collected them there because they all deal with aspects of State (unlike say, non-determinism or coroutine). I must stress that thinking of extensible-effects effects as just another implementation of MTL is not productive. Not all effects can be decomposed into State, Reader, etc. layers. Manly, effects should not be decomposed into layers. The recently discussed Logger was an excellent example. The original poster wondered if Logger is a Writer, or a Reader + IO, or something else. I'd suggest that the answer is that a Logger does a logging effect. One may then think what sort of interaction with the external world executing this logging effect should cause. The original poster thought exactly in these terms and outlined three scenarios. With extensible effects, one implements these scenarios directly. It seems MTL wrought quite a round-about way of thinking about effects. First we specify the desired interactions with the world and then we start thinking of decomposing them into `usual monads'. Why not to implement the specification directly, without any decomposition? To make an analogy, it is believed that a mathematical proof can be traced back to ZFC axioms. Yet no mathematician (unless working specifically on foundations) actually thinks of ZFC when doing the proof. [The analogy is imperfect: there are effects that cannot in principle be represented as composition of monad transformer layers.] From vogt.adam at gmail.com Thu Nov 28 04:16:25 2013 From: vogt.adam at gmail.com (adam vogt) Date: Wed, 27 Nov 2013 23:16:25 -0500 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated In-Reply-To: References: Message-ID: On Wed, Nov 27, 2013 at 9:22 PM, AntC wrote: >> adam vogt gmail.com> writes: >> >> > On Wed, Nov 27, 2013 at 4:24 PM, AntC wrote: > So do you think you're disproving me by showing a message > "No instance for ..."? > _Obviously_ "No instances" means duplicate instances -- NOT! > > Errm anyway, I didn't say "duplicate instances": > I said errors re duplicate **labels**. Hi AntC, Sorry. I typed "duplicate instances" while I intended to write "duplicate labels". The example that follows is about error messages when you try to make a record with duplicate labels. > And I'm talking about HList, not Atze's work. Me too (at that point). I have not built a ghc with the necessary modifications to try out the openrec. >> Atze's code uses them. > > OK, good. (I didn't look at the code so much as at the stated design.) > I did notice that Atze uses FunDeps as well as type functions. > But that he doesn't use OverlappingInstances. > (Or perhaps they're smuggled in via some of the imports?) Closed type families (type family Foo a where Foo () = ..; ...) have equations that behave like overlapping instances. To use them you just need ghc-7.7 (or wait a few weeks for ghc-7.8) and just enable -XTypeFamilies. >> ... This Failure is the same trick as done with Fail in HList ... > > ... AND show that the resulting error handling is tractable. > (If I remember, the authors of HList regarded > that way of failing as a 'hack', and were not very happy. > Using Richard's closed type functions > it should be possible to avoid that hack > -- which is why I was wanting to use them. > So I'm more puzzled. > OTOH, I did feed raise that unhappy hack with Richard > at the time, as a counter-example > that I couldn't understand how he'd handle. > So perhaps he didn't.) Do you recall where that discussion was? The two versions of type family Failure I give are less satisfying than that the (class Fail a). I don't know of a type-level `error' besides the three approaches that have been named in this thread. Sometimes you might be able to re-work some things to get the type-level equivalent of a pattern match failure. Though it seems ghc isn't eager enough to point out "you're using a closed type family in a way that I will never be able to satisfy". For example: f x y | x == y = () -- becomes type family F x y where F x x = () But I'm not sure how to translate g x y | x /= y = () Besides re-writing it as g' x y | x == y = error "mistake" | otherwise = () Which translates to type family G' x y where G' x x = Failure "mistake" () G' x y = () > And PLEASE say that records _can't_ contain duplicate labels. I suppose there's one hole left. You're allowed to compile the following using HList: boom = boom :: Record [LVPair "x" Int, LVPair "x" Double] But I'm not sure that error is common enough to justify sticking a HRLabelSet constraint on every operation in the Record.hs. And even then you'd still be allowed boom in your program. Another idea is to copy the concept of a "smart constructor" for the type level. I don't think that is practical until HRLabelSet can be written as a type family. Doing the conversion means dropping ghc-7.6 support, since you can't write TypeEq as a type family without closed type families. I will wait until 7.8 is out (and a better Failure type family) before trying to re-write that bit. Regards, Adam From anthony_clayden at clear.net.nz Thu Nov 28 05:32:52 2013 From: anthony_clayden at clear.net.nz (AntC) Date: Thu, 28 Nov 2013 05:32:52 +0000 (UTC) Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated References: Message-ID: > adam vogt gmail.com> writes: > > > On Wed, Nov 27, 2013 at 9:22 PM, AntC wrote: > > Closed type families ... wait a few weeks for ghc-7.8) > Yes, I'm in eager anticipation! > > ... > > OTOH, I did feed raise that unhappy hack with Richard > > at the time, as a counter-example > > that I couldn't understand how he'd handle. > > So perhaps he didn't.) > > Do you recall where that discussion was? http://typesandkinds.wordpress.com/2013/04/29/coincident-overlap-in-type- families/ My message on June 24. (It also mentions discussion on GHC-Users.) This is exactly an example of a records mechanism with duplicate 'labels'. Actually being what the HList paper calls Type-Indexed Products. Note that the code I give there works beautifully with old-fashioned overlapping instances; and produces a helpful error message without any additional ancillary Fail classes. It works because my records are tuples, _not_ HLists. So instance resolution is working with a 'flat' structure where it can see all the types. Contrast that HCons effectively hides types in its tail. I suspect that Richard's implementation also effectively hides potential duplicates by putting them in a later 'case' of the type family. > ... Though it seems ghc isn't eager enough ... This is what I find most frustrating with ghc (as contrasted with dear old Hugs): instance failures are 'lazy'. You have to backtrack through a lot of code/other modules to figure out what's going wrong. I was hoping that with Richard's work, instance validation could be eager: reject the instance definition as overlapping _at_the_point_of_definition_. I think that a long time ago ghc took a wrong turn and allowed partially overlapping instances. It therefore has to wait until it finds a usage to see if it is actually ambiguous. I think that partially overlapping instances should be banned. Instances should be either disjunctive or wholly overlapping. (Note that you can always reorganise a partial overlap to fit this rule.) > ... > Which translates to > > type family G' x y where > G' x x = Failure "mistake" () > G' x y = () That's exactly the unhappy hack I was wanting to avoid. If you still have to do that with closed type families, then I'm disappointed. I wanted disequality restraints. (See the Sulzmann and Stuckey paper I mention earlier on Richard's discussion page.) Which would be one single stand-alone instance: type instance G'' x y | x /~ y = () (I also think this has more perspicuous type inference rules, and fits better with a mental model of all the instances 'competing' to be chosen at the use site; with type improvement progressing until exactly one matches. This does not involve instance search, which as SPJ points out would be death to coherence.) Cheers AntC From trupill at gmail.com Thu Nov 28 07:53:23 2013 From: trupill at gmail.com (Alejandro Serrano Mena) Date: Thu, 28 Nov 2013 08:53:23 +0100 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: <20131128030147.52849.qmail@www1.g3.pair.com> References: <20131128030147.52849.qmail@www1.g3.pair.com> Message-ID: Thanks for both the pointers and the discussion about extensible-effects. I had some time yesterday to look at the paper itself, and I found it really useful and clean. Even though, I still think that porting more monad transformers into extensible-effects could help the latter being used more widely. Right now MTL provides Reader, Writer, State, Cont, Error, RWS; and we have packages for random numbers, or monad-supply for a supply of unique values. I would be willing to use extensible-effects if I knew that I can do all of that within the framework. I still see the possibility of having a nice weekend projects in Haskell :) By the way, I'm also interested in knowing if extensible-effects have some relation to MonadPlus or Applicative in any way. Thanks again for the answers! I really liked the ideas! 2013/11/28 > > > The extensible-effects package seems very interesting. I would really > like > > to have instances of all usual monads: Reader, Writer, State.Lazy and so > on > > in the package. Maybe that's a project for the future :) > > There is already a Reader and Writer, in Control.Eff.State. I guess > Ben Foppa collected them there because they all deal with aspects of > State (unlike say, non-determinism or coroutine). > > I must stress that thinking of extensible-effects effects as just > another implementation of MTL is not productive. Not all effects can > be decomposed into State, Reader, etc. layers. Manly, effects should > not be decomposed into layers. > > The recently discussed Logger was an excellent example. The original > poster wondered if Logger is a Writer, or a Reader + IO, or something > else. I'd suggest that the answer is that a Logger does a logging > effect. One may then think what sort of interaction with the external > world executing this logging effect should cause. The original poster > thought exactly in these terms and outlined three scenarios. With > extensible effects, one implements these scenarios directly. > > It seems MTL wrought quite a round-about way of thinking about > effects. First we specify the desired interactions with the world and > then we start thinking of decomposing them into `usual monads'. Why > not to implement the specification directly, without any > decomposition? > > To make an analogy, it is believed that a mathematical proof can be > traced back to ZFC axioms. Yet no mathematician (unless working > specifically on foundations) actually thinks of ZFC when doing the > proof. [The analogy is imperfect: there are effects that cannot > in principle be represented as composition of monad transformer > layers.] > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg at okmij.org Thu Nov 28 10:30:40 2013 From: oleg at okmij.org (oleg at okmij.org) Date: 28 Nov 2013 10:30:40 -0000 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: Message-ID: <20131128103040.25745.qmail@www1.g3.pair.com> > Could you please elaborate on the current state of the project? > Can it be considered stable? > Where should I look for the uses of extensible effects? Ben Foppa has already answered most of these questions. I should add that although there are some improvements to be made (I'm thinking of a couple), they are either definitely or highly likely will preserve the existing interface. So, your code will not have to change. For example, closed type families in the upcoming GHC 7.8 will let us implement OpenUnions better. The interface shall be preserved, only the implementation will change. Most of the new development is writing more examples and more and better explanations. Recently, for example, I added committed choice (in Prolog terms, soft-cut) to the Choice effect. I was surprised how easy it was and how nothing had to be changed. I merely added a new handler. So, we get another implementation of LogicT, this time in terms of extensible effects. From oleg at okmij.org Thu Nov 28 11:44:51 2013 From: oleg at okmij.org (oleg at okmij.org) Date: 28 Nov 2013 11:44:51 -0000 Subject: [Haskell-cafe] Return of the revenge of the revisit of the extensible records, reiterated Message-ID: <20131128114451.48195.qmail@www1.g3.pair.com> First of all, I should point out that faster extensible records have already been developed, within the HList framework: Just Do It While Compiling! Fast Extensible Records In Haskell http://www.fing.edu.uy/~mviera/papers/pepm13.pdf The authors did it without needing the total order on labels. However, one of the encoding of labels described in the HList paper had total order. I guess we weren't motivated enough to exploit it. > The real benefit of keeping the row sorted is that { x = 0 , y = 0 } and { > y = 0, x = 0 } have the same type. When a row is not sorted, as in HList, > then if we for example have an instance Eq for a row (because all elements > support Eq) then for using (==) both arguments would have to the same order > in the row or we need a manual call to a permutation function. When keeping > the row ordered, this is not necessary. The same kind of problem > occurs > > The same kind of problem occurs when we fix the type of a function to > a specific row: ( using whishful syntax ) > > f :: Rec [ x = Int , y = Int] -> Int > > If the row is not ordered, then f { y = 0 , x = 0 } will not typecheck and > will require a manual call to permute the row. This is all very true. However, if we wish to pass the function f above the record {y=0, x=0} (with permuted fields), we most likely wish to pass that function a record {x=0, y=0, z='a'} with more fields. Most of the time when we deal with extensible records, we really wish to explore their extensibility. Keeping fields sorted does not help at all in the latter problem -- we must manually insert the call to the subtyping coercion function. Once we do that, the problem with the order of the fields disappears. I also would like to point out that there are two sorts of record types. One sort is Rec [x: Int, y:Bool] in the imagine syntax. Current HList types are uglier versions of the above. But there is another sort: (HasField r x Int, HasField r y Bool) => r It represents an extensible record type. Extensibility is build in, and the order of the fields is immaterial. Quite a few functions on records can be given the above type. Furthermore, the second sort can be used not only with structural subtyping but also with nominal subtyping. From cgaebel at uwaterloo.ca Thu Nov 28 12:59:41 2013 From: cgaebel at uwaterloo.ca (Clark Gaebel) Date: Thu, 28 Nov 2013 07:59:41 -0500 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: <20131128030147.52849.qmail@www1.g3.pair.com> Message-ID: Reader/Writer/State are handled in extensible-effects inside Control.Eff.State. Cont is handled in Control.Eff.Coroutine (although could use better documentation, patches welcome!). RWS isn't done, but I don't see why it can't be implemented in terms of State! Error is provided by Control.Eff.Exception, and a substitute for monad-supply is provided by Control.Eff.Fresh. Random numbers are in a new package: system-random-effect. Eff is an instance of applicative, but not MonadPlus. I don't immediately see a way to make it an instance of MonadPlus, especially since we can have an 'IO' effect. Hope that helps! - Clark On Thu, Nov 28, 2013 at 2:53 AM, Alejandro Serrano Mena wrote: > Thanks for both the pointers and the discussion about extensible-effects. > I had some time yesterday to look at the paper itself, and I found it > really useful and clean. > > Even though, I still think that porting more monad transformers into > extensible-effects could help the latter being used more widely. Right now > MTL provides Reader, Writer, State, Cont, Error, RWS; and we have packages > for random numbers, or monad-supply for a supply of unique values. I would > be willing to use extensible-effects if I knew that I can do all of that > within the framework. I still see the possibility of having a nice weekend > projects in Haskell :) > > By the way, I'm also interested in knowing if extensible-effects have some > relation to MonadPlus or Applicative in any way. > > Thanks again for the answers! I really liked the ideas! > > > 2013/11/28 > > >> > The extensible-effects package seems very interesting. I would really >> like >> > to have instances of all usual monads: Reader, Writer, State.Lazy and >> so on >> > in the package. Maybe that's a project for the future :) >> >> There is already a Reader and Writer, in Control.Eff.State. I guess >> Ben Foppa collected them there because they all deal with aspects of >> State (unlike say, non-determinism or coroutine). >> >> I must stress that thinking of extensible-effects effects as just >> another implementation of MTL is not productive. Not all effects can >> be decomposed into State, Reader, etc. layers. Manly, effects should >> not be decomposed into layers. >> >> The recently discussed Logger was an excellent example. The original >> poster wondered if Logger is a Writer, or a Reader + IO, or something >> else. I'd suggest that the answer is that a Logger does a logging >> effect. One may then think what sort of interaction with the external >> world executing this logging effect should cause. The original poster >> thought exactly in these terms and outlined three scenarios. With >> extensible effects, one implements these scenarios directly. >> >> It seems MTL wrought quite a round-about way of thinking about >> effects. First we specify the desired interactions with the world and >> then we start thinking of decomposing them into `usual monads'. Why >> not to implement the specification directly, without any >> decomposition? >> >> To make an analogy, it is believed that a mathematical proof can be >> traced back to ZFC axioms. Yet no mathematician (unless working >> specifically on foundations) actually thinks of ZFC when doing the >> proof. [The analogy is imperfect: there are effects that cannot >> in principle be represented as composition of monad transformer >> layers.] >> >> >> > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -- Clark. Key ID : 0x78099922 Fingerprint: B292 493C 51AE F3AB D016 DD04 E5E3 C36F 5534 F907 -------------- next part -------------- An HTML attachment was scrubbed... URL: From fryguybob at gmail.com Thu Nov 28 13:53:08 2013 From: fryguybob at gmail.com (Ryan Yates) Date: Thu, 28 Nov 2013 08:53:08 -0500 Subject: [Haskell-cafe] Master thesis project - Haskell STM In-Reply-To: References: Message-ID: Hi Johan, As Carter mentioned I am working on speeding up GHC's STM implementation using TSX. I can certainly give you some pointers on how the STM implementation works and on using TSX. I'm quite busy at the moment but feel free to ask me any questions. I think some of the difficulty in a project like this is coming up with good benchmarks. In a large amount of the real world use of GHC's STM, the STM part is not used heavily enough to be the bottleneck in performance. Benchmarks that would show improvements are largely uses of STM that are different from the typical use. Ryan On Mon, Nov 25, 2013 at 11:35 AM, Carter Schonwald < carter.schonwald at gmail.com> wrote: > I believe Ryan Yates is actively working on at least some part of this > problem, worth asking him . Likewise, any successful experimentation > will depend on some level of comfort with ghc hackig. > > > On Monday, November 25, 2013, Alexander Kjeldaas wrote: > >> I remember Simon Marlow mentoined that there should be a lot of low >> hanging fruit in the STM implementation when I started looking at >> optimization opportunities in the MVar implementation. >> >> The STM implementation could probably be optimized even if you don't win >> with the TSX implementation, so the probability of success with your thesis >> could be quite high. >> >> http://www.haskell.org/pipermail/ghc-devs/2013-February/000496.html >> >> Alexander >> >> On Mon, Nov 25, 2013 at 11:40 AM, Johan Astborg wrote: >> >>> Dear Haskellers, >>> >>> I found Haskell and became enlightened for the first time in many years. >>> I choose to continue on this path, and choose Haskell for my master thesis. >>> I got some nice ideas from people on the #haskell channel . Altogether, I >>> have elaborated a topic: >>> >>> "Evaluating Intel TSX in a MVCC based STM implementation for Haskell" >>> >>> The idea is to investigate whether the "new" Intel TSX can bring any >>> value in terms of performance and saftey when implemented in a MVCC based >>> STM to be used in the Haskell runtime system (GHC). The MVCC based STM >>> using TSX will be evaluated and compared to the existing implementation, >>> compiled with the two settings STM_CG_LOCK and STM_FG_LOCKS respectively. >>> >>> The biggest challange still, is to convince Lund University, LTH, to >>> accept my own master thesis project. I have to present a detailed synopsis >>> about the project, for them to choose an examinator and supervisor. As they >>> put it, the examinator "must have time" and it's up to that person to >>> decide whether or not this project can be reality. >>> >>> Feedback on any of these is highly appreciated: >>> >>> 1) Ideas and thoughts about this topic >>> 2) Anyone interested in supervising (mainly formal) the project outside >>> of LTH >>> >>> Thanks, >>> Johan Astborg >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ollie at ocharles.org.uk Thu Nov 28 15:15:08 2013 From: ollie at ocharles.org.uk (Oliver Charles) Date: Thu, 28 Nov 2013 15:15:08 +0000 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: <20131128103040.25745.qmail@www1.g3.pair.com> References: <20131128103040.25745.qmail@www1.g3.pair.com> Message-ID: <52975DFC.2090508@ocharles.org.uk> On 11/28/2013 10:30 AM, oleg at okmij.org wrote: > Most of the new development is writing more examples and more and > better explanations. Recently, for example, I added committed choice > (in Prolog terms, soft-cut) to the Choice effect. I was surprised how > easy it was and how nothing had to be changed. I merely added a new > handler. So, we get another implementation of LogicT, this time in > terms of extensible effects. This sounds very interesting - is this work available for us to look at anywhere? - ocharles -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: OpenPGP digital signature URL: From ollie at ocharles.org.uk Thu Nov 28 15:17:19 2013 From: ollie at ocharles.org.uk (Oliver Charles) Date: Thu, 28 Nov 2013 15:17:19 +0000 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: <20131128030147.52849.qmail@www1.g3.pair.com> Message-ID: <52975E7F.6000705@ocharles.org.uk> On 11/28/2013 12:59 PM, Clark Gaebel wrote: > Reader/Writer/State are handled in extensible-effects inside > Control.Eff.State. Cont is handled in Control.Eff.Coroutine (although > could use better documentation, patches welcome!). RWS isn't done, but > I don't see why it can't be implemented in terms of State! Error is > provided by Control.Eff.Exception, and a substitute for monad-supply > is provided by Control.Eff.Fresh. Random numbers are in a new package: > system-random-effect. > > Eff is an instance of applicative, but not MonadPlus. I don't > immediately see a way to make it an instance of MonadPlus, especially > since we can have an 'IO' effect. And if you do want MonadPlus-like stuff, you just add in the "Choice" effect - right? - ocharles -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: OpenPGP digital signature URL: From tpadilha84 at gmail.com Thu Nov 28 18:30:54 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Thu, 28 Nov 2013 16:30:54 -0200 Subject: [Haskell-cafe] Query information about a haskell source file from the command-line Message-ID: Is there any command-line tool that outputs information about a source haskell module? I'm looking for something like 'ghc-mod browse'(which displays all symbols exported by an installed module) but that works for plain haskell source files. Any ideas? From adam at bergmark.nl Thu Nov 28 18:51:39 2013 From: adam at bergmark.nl (Adam Bergmark) Date: Thu, 28 Nov 2013 19:51:39 +0100 Subject: [Haskell-cafe] Query information about a haskell source file from the command-line In-Reply-To: References: Message-ID: Hi Thiago, you can easily do this with haskell-src-exts + haskell-names, for instance: ([exports],_) <- HN.getInterfaces Haskell2010 extensions [hseModule] HTH - Adam On Thu, Nov 28, 2013 at 7:30 PM, Thiago Padilha wrote: > Is there any command-line tool that outputs information about a source > haskell module? I'm looking for something like 'ghc-mod browse'(which > displays all symbols exported by an installed module) but that works > for plain haskell source files. > > Any ideas? > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tpadilha84 at gmail.com Fri Nov 29 01:30:39 2013 From: tpadilha84 at gmail.com (Thiago Padilha) Date: Thu, 28 Nov 2013 23:30:39 -0200 Subject: [Haskell-cafe] Query information about a haskell source file from the command-line In-Reply-To: References: Message-ID: Seems promising, thanks On Thu, Nov 28, 2013 at 3:51 PM, Adam Bergmark wrote: > Hi Thiago, > > you can easily do this with haskell-src-exts + haskell-names, for instance: > > > ([exports],_) <- HN.getInterfaces Haskell2010 extensions [hseModule] > > HTH > - Adam > > > > On Thu, Nov 28, 2013 at 7:30 PM, Thiago Padilha > wrote: >> >> Is there any command-line tool that outputs information about a source >> haskell module? I'm looking for something like 'ghc-mod browse'(which >> displays all symbols exported by an installed module) but that works >> for plain haskell source files. >> >> Any ideas? >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe > > From cj at vdbonline.com Fri Nov 29 09:16:11 2013 From: cj at vdbonline.com (CJ van den Berg) Date: Fri, 29 Nov 2013 10:16:11 +0100 Subject: [Haskell-cafe] Fwd: vector fails to build with ghc on arm-linux-androideabi In-Reply-To: References: Message-ID: <52985B5B.7050701@vdbonline.com> Hi Herwig, I assume you?re using my ghc-android build script from github? Currently ghc-android still builds ghc with 'DYNAMIC_GHC_PROGRAMS = NO' which means that it doesn?t get to use the system linker. Hopefully, once we get ghc to use the system linker on Android problems like this will go away. I am currently waiting for the 7.8 release before doing a complete review of how ghc-android builds ghc and how the resulting binaries are best integrated into Android applications. I suggest you add a ticket to the github page for this specific issue. On 2013-11-27 22:29, Herwig Hochleitner wrote: > Hello, > > I'm trying to build the openpgp libs for android. I can build and run > HaskellActivity from the HelloWorld sample, but as when I try to install > vector, I get the following build failure: > > ==================== > > $ arm-linux-androideabi-cabal install --reinstall --force-reinstall vector > ... > [ 5 of 19] Compiling Data.Vector.Fusion.Stream.Monadic ( > Data/Vector/Fusion/Stream/Monadic.hs, > dist/build/Data/Vector/Fusion/Stream/Monadic.o ) > Loading package ghc-prim ... linking ... ghc: > /home/androidbuilder/.ghc/android-14/arm-linux-androideabi-4.8/lib/arm-unknown-linux-androideabi-ghc-7.7.20130921/ghc-prim-0.3.1.0/HSghc-prim-0.3.1.0.o: > unhandled ELF relocation(Rel) type 28 > > ghc: unable to load package `ghc-prim' > Failed to install vector-0.10.9.1 > ... > > ==================== > > It seems somewhat related to this closed bug: > https://ghc.haskell.org/trac/ghc/ticket/7824 > Am I doing something stupid? Can I fix this? > > cheers > > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -- CJ van den Berg mailto:cj at vdbonline.com xmpp:neurocyte at gmail.com From Graham.Hutton at nottingham.ac.uk Fri Nov 29 09:23:33 2013 From: Graham.Hutton at nottingham.ac.uk (Graham Hutton) Date: Fri, 29 Nov 2013 09:23:33 +0000 Subject: [Haskell-cafe] 10 PhD studentships in Nottingham Message-ID: Dear all, The School of Computer Science in Nottingham is advertising 10 fully-funded PhD studentships. Applicants in the area of the Functional Programming lab (fp.cs.nott.ac.uk) are encouraged! If you are interested in applying, please contact a potential academic supervisor in the FP lab prior to submitting your application. Best wishes, Graham +-----------------------------------------------------------+ 10 Fully-Funded PhD Studentships School of Computer Science University of Nottingham, UK Applications are invited for up to ten fully-funded PhD studentships in the School of Computer Science at the University of Nottingham, starting on 1st October 2014. The topics for the studentships are open, but should relate to the interests of one of the School?s research groups: Agents Lab; Automated Scheduling, Optimisation and Planning; Computer Vision Lab; Functional Programming Lab; Intelligent Modelling and Analysis; Mixed Reality Lab; Networked Systems. The studentships are for three years and include a stipend of ?13,726 per year and tuition fees, and are available to students of any nationality. Applicants are normally expected to have a first-class Undergraduate or Masters degree in Computer Science or a related discipline, and should discuss their interest and obtain the support of a potential supervisor in the School before applying. To apply, please submit the following items by email to : (1) a brief covering letter that describes your reasons for wishing to pursue a PhD, any ideas you have regarding possible areas or topics, and the name of a potential supervisor; (2) a copy of your CV, including your actual or expected degree class(es), and results of all University examinations; (3) an example of your technical writing, such as a project report or dissertation; (4) contact details for two academic referees. Closing date for applications: 10th January 2014 +-----------------------------------------------------------+ -- Prof Graham Hutton Functional Programming Lab School of Computer Science University of Nottingham, UK http://www.cs.nott.ac.uk/~gmh This message and any attachment are intended solely for the addressee and may contain confidential information. If you have received this message in error, please send it back to me, and immediately delete it. Please do not use, copy or disclose the information contained in this message or in any attachment. Any views or opinions expressed by the author of this email do not necessarily reflect the views of the University of Nottingham. This message has been checked for viruses but the contents of an attachment may still contain software viruses which could damage your computer system, you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation. From olivier.jeulin at gmail.com Fri Nov 29 13:58:36 2013 From: olivier.jeulin at gmail.com (Olivier JEULIN) Date: Fri, 29 Nov 2013 14:58:36 +0100 Subject: [Haskell-cafe] [ANN] XSLT2 for C/C++: alpha realease of Saxon-HE 9.5 (and soon Xpath2, Xquery) Message-ID: Hello, for those working with XML and XSLT/XQuery/XPath, you may be interested to know that Saxonica is releasing an alpha version of its free (and open source) XSLT2/Xquery engine Saxon-HE 9.5. (I'm not affiliated with Saxon, I'm just spreading the news :-) ) The good news is: this finally brings XSLT 2 to C/C++, instead of XSLT 1 (which is already supported by libxml2). XSLT 2 is a MUCH more mature version of XSLT, with cleaner definition of function and a nice functional approach. XSLT 3 will be even better (higher order functions) but may not be supported by the free version of Saxon. http://www.saxonica.com/saxon-c/index.xml I hope that someone will make a binding for haskell ^^, -------------- next part -------------- An HTML attachment was scrubbed... URL: From maydwell at gmail.com Fri Nov 29 14:16:08 2013 From: maydwell at gmail.com (Lyndon Maydwell) Date: Sat, 30 Nov 2013 01:16:08 +1100 Subject: [Haskell-cafe] [ANN] XSLT2 for C/C++: alpha realease of Saxon-HE 9.5 (and soon Xpath2, Xquery) In-Reply-To: References: Message-ID: Wow. This is great. Saxon's XSLT and XPath are extremely fully featured! On Sat, Nov 30, 2013 at 12:58 AM, Olivier JEULIN wrote: > Hello, > > for those working with XML and XSLT/XQuery/XPath, you may be interested to > know that Saxonica is releasing an alpha version of its free (and open > source) XSLT2/Xquery engine Saxon-HE 9.5. > (I'm not affiliated with Saxon, I'm just spreading the news :-) ) > > The good news is: this finally brings XSLT 2 to C/C++, instead of XSLT 1 > (which is already supported by libxml2). > XSLT 2 is a MUCH more mature version of XSLT, with cleaner definition of > function and a nice functional approach. XSLT 3 will be even better (higher > order functions) but may not be supported by the free version of Saxon. > > http://www.saxonica.com/saxon-c/index.xml > > I hope that someone will make a binding for haskell ^^, > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > From fuuzetsu at fuuzetsu.co.uk Fri Nov 29 16:10:57 2013 From: fuuzetsu at fuuzetsu.co.uk (Mateusz Kowalczyk) Date: Fri, 29 Nov 2013 16:10:57 +0000 Subject: [Haskell-cafe] [ANN] XSLT2 for C/C++: alpha realease of Saxon-HE 9.5 (and soon Xpath2, Xquery) In-Reply-To: References: Message-ID: <5298BC91.8020206@fuuzetsu.co.uk> On 29/11/13 13:58, Olivier JEULIN wrote: > Hello, > [snip] > > I hope that someone will make a binding for haskell ^^, Sounds like we have a volunteer ;) -- Mateusz K. From evohunz at gmail.com Fri Nov 29 23:36:42 2013 From: evohunz at gmail.com (Thiago Negri) Date: Fri, 29 Nov 2013 21:36:42 -0200 Subject: [Haskell-cafe] Need help: Cabal rejecting stringsearch, conflict in base In-Reply-To: References: Message-ID: I did the easy way and it worked! The bad thing is that after restarting my laptop, xmonad and xmobar were gone. I recompiled xmonad and it's ok, but xmobar is failing to build because "unix" package is failing because "Signals.h" is missing (used by System.Posix.Signals). :-( I guess my cabal environment is messed up. Is `rm -rf ~/.ghc ~/.cabal` supposed to reset cabal installation? How do I start a fresh cabal environment? 2013/11/26 Clark Gaebel > You've got two options: > > 1) (the easy way) > > rm -rf ~/.ghc ~/.cabal > cabal update > cabal install scotty > > 2) (the hard way, ghc 7.6+ only) > > Use a sandbox! > > cd path/to/my/project/that/uses/scotty > cabal sandbox init > cabal install --only-dependencies -j # make sure scotty is a dependency of > your project > cabal configure > cabal build > > 3) use cabal-dev. similar to using sandboxes, but I don't have it any more > so can't give you a step-by-step. > > > On Tue, Nov 26, 2013 at 7:34 PM, Thiago Negri wrote: > >> I don't know what to do. :-( >> I can't install scotty or yesod. >> >> $ cabal install scotty >> cabal: Could not resolve dependencies: >> trying: scotty-0.5.0 (user goal) >> trying: base-4.7.0.0/installed-dc1... (dependency of scotty-0.5.0) >> trying: wai-extra-1.3.4.6 (dependency of scotty-0.5.0) >> trying: stringsearch-0.3.6.4 (dependency of wai-extra-1.3.4.6) >> rejecting: stringsearch-0.3.6.4:-base3 (conflict: >> base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=2 && >> <3) >> rejecting: stringsearch-0.3.6.4:+base3 (conflict: >> base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=3 && >> <4) >> Backjump limit reached (change with --max-backjumps). >> >> >> _______________________________________________ >> Haskell-Cafe mailing list >> Haskell-Cafe at haskell.org >> http://www.haskell.org/mailman/listinfo/haskell-cafe >> >> > > > -- > Clark. > > Key ID : 0x78099922 > Fingerprint: B292 493C 51AE F3AB D016 DD04 E5E3 C36F 5534 F907 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From carter.schonwald at gmail.com Sat Nov 30 00:35:45 2013 From: carter.schonwald at gmail.com (Carter Schonwald) Date: Fri, 29 Nov 2013 19:35:45 -0500 Subject: [Haskell-cafe] Need help: Cabal rejecting stringsearch, conflict in base In-Reply-To: References: Message-ID: Just remove the .ghc. No need to touch .cabal. On Friday, November 29, 2013, Thiago Negri wrote: > I did the easy way and it worked! > The bad thing is that after restarting my laptop, xmonad and xmobar were > gone. > I recompiled xmonad and it's ok, but xmobar is failing to build because > "unix" package is failing because "Signals.h" is missing (used by > System.Posix.Signals). > :-( > > I guess my cabal environment is messed up. > Is `rm -rf ~/.ghc ~/.cabal` supposed to reset cabal installation? > How do I start a fresh cabal environment? > > > > > 2013/11/26 Clark Gaebel 'cgaebel at uwaterloo.ca');>> > >> You've got two options: >> >> 1) (the easy way) >> >> rm -rf ~/.ghc ~/.cabal >> cabal update >> cabal install scotty >> >> 2) (the hard way, ghc 7.6+ only) >> >> Use a sandbox! >> >> cd path/to/my/project/that/uses/scotty >> cabal sandbox init >> cabal install --only-dependencies -j # make sure scotty is a dependency >> of your project >> cabal configure >> cabal build >> >> 3) use cabal-dev. similar to using sandboxes, but I don't have it any >> more so can't give you a step-by-step. >> >> >> On Tue, Nov 26, 2013 at 7:34 PM, Thiago Negri >> > wrote: >> >>> I don't know what to do. :-( >>> I can't install scotty or yesod. >>> >>> $ cabal install scotty >>> cabal: Could not resolve dependencies: >>> trying: scotty-0.5.0 (user goal) >>> trying: base-4.7.0.0/installed-dc1... (dependency of scotty-0.5.0) >>> trying: wai-extra-1.3.4.6 (dependency of scotty-0.5.0) >>> trying: stringsearch-0.3.6.4 (dependency of wai-extra-1.3.4.6) >>> rejecting: stringsearch-0.3.6.4:-base3 (conflict: >>> base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=2 >>> && <3) >>> rejecting: stringsearch-0.3.6.4:+base3 (conflict: >>> base==4.7.0.0/installed-dc1..., stringsearch-0.3.6.4:base3 => base>=3 >>> && <4) >>> Backjump limit reached (change with --max-backjumps). >>> >>> >>> _______________________________________________ >>> Haskell-Cafe mailing list >>> Haskell-Cafe at haskell.org >> 'Haskell-Cafe at haskell.org');> >>> http://www.haskell.org/mailman/listinfo/haskell-cafe >>> >>> >> >> >> -- >> Clark. >> >> Key ID : 0x78099922 >> Fingerprint: B292 493C 51AE F3AB D016 DD04 E5E3 C36F 5534 F907 >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From oleg at okmij.org Sat Nov 30 09:01:26 2013 From: oleg at okmij.org (oleg at okmij.org) Date: 30 Nov 2013 09:01:26 -0000 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: Message-ID: <20131130090126.32324.qmail@www1.g3.pair.com> > By the way, I'm also interested in knowing if extensible-effects have some > relation to MonadPlus or Applicative in any way. The Eff monad is a genuine monad, and all monads are Applicatives. So, extensible-effects directly relates to Applicative. As Oliver Charles noted, the extensible-effects package provides the Choose effect, with the operation choose :: Member Choose r => [a] -> Eff r a to non-deterministically select an element from a list. It is easy to see that Choose is as alias of MonadPlus: given choose one can implement mplus and mzero (the latter is choose []). Conversely, MonadPlus lets us implement Choose. The signature of choose says the resulting computation will have the Choose effect -- and, since the effect label |r| is left polymorphic, the computation may have an unspecified number of other effects (including IO). > > handler. So, we get another implementation of LogicT, this time in > > terms of extensible effects. > > This sounds very interesting - is this work available for us to look at > anywhere? Actually yes, from the very slightly updated http://okmij.org/ftp/Haskell/extensible/Eff.hs Please search for 'Soft-cut'. The implementation is so trivial that it didn't seem worth mentioning before. The most interesting part is reflect :: VE a r -> Eff r a which is the inverse of admin (aka, reify). It is gratifying that monadic reification-reflection can be implemented with extensible-effects _generically_, once and for all. From apfelmus at quantentunnel.de Sat Nov 30 11:03:46 2013 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Sat, 30 Nov 2013 12:03:46 +0100 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: Message-ID: Alejandro Serrano Mena wrote: > Dear Caf?, > I've been reading lately about the relation between the 'free' package and > the 'operational' package for rolling your own monads [1] [2]. Furthermore, > I've discovered that the 'free-operational' package, which is some sort of > bridge between the two worlds, and provides not only Monad but also > Applicative and Alternative instances for ProgramT. > The problem is that right now everything is a little confused in my head. > In particular, I have the following questions: (Author of 'operational' here.) > - I've read that free allows you to 'bake algebraic laws' in the resulting > monad. How does this work? Why doesn't operational offer that feature? What I mean by 'baking in algebraic laws' is the following: Consider the free monad over the functor data F a = MZero | MPlus a a mzero :: Free F a mzero = Free MZero mplus :: Free F a -> Free F a -> Free F a mplus x y = Free (MPlus x y) For convenience, let me reproduce the relevant definitions for the free monad here data Free f a = Return a | Free (f (Free f a)) (>>=) :: Functor f => Free f a -> (a -> Free f b) -> Free f b (>>=) (Return a) k = k a (>>=) (Free x) k = Free (fmap (>>= k) x) Now, if you think about the definition of bind for a moment, you will see that it automatically guarantees a distributive law for mplus : mplus x y >>= k = mplus (x >>= k) (y >>= k) However, it turns out [1] that there is another law that you might want mplus to satisfy mplus (return a) y = return a but which is incompatible with the distributive law. So, if you want to implement a monad where mplus should obey the latter law, you have to start with a different functor type F (which one?). In the 'free' approach, I find it unpleasant that some laws are automatic from the functor type, while others have to be ensured by the interpreter. That's why 'operational' offers only one way to implement monads: everything has to be done in the interpreter. [1]: http://www.haskell.org/haskellwiki/MonadPlus > - One of the things I really like from the free package is that it provides > support for many monad transformer stacks, whereas operational does not? Is > there any special restriction why operational cannot do this? Would it be > possible to provide similar instances for free-operational? There is a good reason why 'operational' cannot do this: in general, it is impossible to mix different effects in a general way. Why would ProgramT SomeInstruction (State s) be a state monad as well even though SomeInstruction can introduce new effects? If you look at the monad transformer instances for Free , like MonadState, you will notice that they require the functor to be that monad, i.e. they make use of the "baking in laws" effect. This is quite useless in practice, as writing a MonadState instance of the instruction type F is the same work as writing a MonadState instance for the Free F monad. If you look at the transformer version Control.Monad.Trans.Free , you will see that there are no MonadState instances -- as expected, because you have to specify the interaction of effects. > - It seems that free gives more features (Alternative, Applicative) with > the same work. In which situations should I prefer operational to free? I > really like the separation between providing a data type and then a > interpretation that operational embodies... Well, the features may look good on screen, but once you check the preconditions for the class instances, you will find that fulfilling them is as much work as writing the instance from scratch. The only two things that a free monad can give you is: * A Monad instance. * A way to pattern match on instructions and write an interpreter. This is what operational does. Everything else just shuffles work around, but doesn't alleviate it for you. That said, as we saw, Free can give you some laws automatically. However, this also has a drawback: Program has an optimization that Free can never have. Namely, Program gives you a (>>=) that can be used in a left-associative way (Think (((x ++ y) ++ z) ++ w) ) while still allowing pattern matching. > - Should I replace my usage of operational with free-operational altogether? I would say no, but then again, I'm the author of the 'operational' package. :) Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From nickolay.kudasov at gmail.com Sat Nov 30 12:18:04 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sat, 30 Nov 2013 16:18:04 +0400 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: Message-ID: > > ?In the 'free' approach, I find it unpleasant that some laws are > automatic from the functor type, while others have to be ensured by the > interpreter. That's why 'operational' offers only one way to implement > monads: everything has to be done in the interpreter. ? As far as I know these instances are heavily used in practice, though they are inconvenient in a way. Perhaps they could be moved in a separate module. On the other hand one could use `FreeT` which derives instances in a different manner. > If you look at the transformer version Control.Monad.Trans.Free , you > will see that there are no MonadState instances -- as expected, because you > have to specify the interaction of effects. Some instances?? are present in HEAD [1], just not on hackage yet. Some other instances (MonadCont [2], MonadWriter [3]) are waiting for Edward Kmett's approval. Note that `Free` does not have "the true" set of mtl instances. While these instances (derived from underlying functor) are heavily used in practice for `Free`, `FreeT` suggests deriving instances from the transformed monad (not underlying functor). It turns out the latter can be done for the most part of MonadX instances (MonadWriter instance is somewhat questionable). See some comments in [4]. That said, as we saw, Free can give you some laws automatically. However, > this also has a drawback: Program has an optimization that Free can never > have. Namely, Program gives you a (>>=) that can be used in a > left-associative way (Think (((x ++ y) ++ z) ++ w) ) while still allowing > pattern matching. As far as I can tell, this corresponds to church encoded versions of `Free` and `FreeT`, namely `F` and `FT`??. This is possible due to the work "Asymptotic Improvement of Computations over Free Monads" by Janis Voightl?nder [5] and based on Edward Kmett's "Free Monads for Less" series of articles [6,7]. `F` is on hackage already and `FT` is in HEAD. Best, Nick [1] https://github.com/ekmett/free [2] https://github.com/ekmett/free/pull/33 [3] https://github.com/ekmett/free/issues/25 [4] https://github.com/ekmett/free/issues/31#issuecomment-28481426 [5] http://www.iai.uni-bonn.de/~jv/mpc08.pdf [6] http://comonad.com/reader/2011/free-monads-for-less/ [7] http://comonad.com/reader/2011/free-monads-for-less-2/ 2013/11/30 Heinrich Apfelmus > Alejandro Serrano Mena wrote: > >> Dear Caf?, >> I've been reading lately about the relation between the 'free' package and >> the 'operational' package for rolling your own monads [1] [2]. >> Furthermore, >> I've discovered that the 'free-operational' package, which is some sort of >> bridge between the two worlds, and provides not only Monad but also >> Applicative and Alternative instances for ProgramT. >> The problem is that right now everything is a little confused in my head. >> In particular, I have the following questions: >> > > (Author of 'operational' here.) > > > - I've read that free allows you to 'bake algebraic laws' in the resulting >> monad. How does this work? Why doesn't operational offer that feature? >> > > What I mean by 'baking in algebraic laws' is the following: Consider the > free monad over the functor > > data F a = MZero | MPlus a a > > mzero :: Free F a > mzero = Free MZero > > mplus :: Free F a -> Free F a -> Free F a > mplus x y = Free (MPlus x y) > > For convenience, let me reproduce the relevant definitions for the free > monad here > > data Free f a = Return a | Free (f (Free f a)) > > (>>=) :: Functor f => Free f a -> (a -> Free f b) -> Free f b > (>>=) (Return a) k = k a > (>>=) (Free x) k = Free (fmap (>>= k) x) > > Now, if you think about the definition of bind for a moment, you will see > that it automatically guarantees a distributive law for mplus : > > mplus x y >>= k = mplus (x >>= k) (y >>= k) > > However, it turns out [1] that there is another law that you might want > mplus to satisfy > > mplus (return a) y = return a > > but which is incompatible with the distributive law. So, if you want to > implement a monad where mplus should obey the latter law, you have to > start with a different functor type F (which one?). > > > In the 'free' approach, I find it unpleasant that some laws are automatic > from the functor type, while others have to be ensured by the interpreter. > That's why 'operational' offers only one way to implement monads: > everything has to be done in the interpreter. > > [1]: http://www.haskell.org/haskellwiki/MonadPlus > > > > - One of the things I really like from the free package is that it >> provides >> support for many monad transformer stacks, whereas operational does not? >> Is >> there any special restriction why operational cannot do this? Would it be >> possible to provide similar instances for free-operational? >> > > There is a good reason why 'operational' cannot do this: in general, it is > impossible to mix different effects in a general way. Why would > > ProgramT SomeInstruction (State s) > > be a state monad as well even though SomeInstruction can introduce new > effects? > > If you look at the monad transformer instances for Free , like > MonadState, you will notice that they require the functor to be that monad, > i.e. they make use of the "baking in laws" effect. This is quite useless in > practice, as writing a MonadState instance of the instruction type F is the > same work as writing a MonadState instance for the Free F monad. > > If you look at the transformer version Control.Monad.Trans.Free , you > will see that there are no MonadState instances -- as expected, because you > have to specify the interaction of effects. > > > - It seems that free gives more features (Alternative, Applicative) with >> the same work. In which situations should I prefer operational to free? I >> really like the separation between providing a data type and then a >> interpretation that operational embodies... >> > > Well, the features may look good on screen, but once you check the > preconditions for the class instances, you will find that fulfilling them > is as much work as writing the instance from scratch. > > The only two things that a free monad can give you is: > > * A Monad instance. > * A way to pattern match on instructions and write an interpreter. > > This is what operational does. Everything else just shuffles work around, > but doesn't alleviate it for you. > > That said, as we saw, Free can give you some laws automatically. However, > this also has a drawback: Program has an optimization that Free can never > have. Namely, Program gives you a (>>=) that can be used in a > left-associative way (Think (((x ++ y) ++ z) ++ w) ) while still allowing > pattern matching. > > > - Should I replace my usage of operational with free-operational >> altogether? >> > > I would say no, but then again, I'm the author of the 'operational' > package. :) > > > Best regards, > Heinrich Apfelmus > > -- > http://apfelmus.nfshost.com > > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: From apfelmus at quantentunnel.de Sat Nov 30 21:39:13 2013 From: apfelmus at quantentunnel.de (Heinrich Apfelmus) Date: Sat, 30 Nov 2013 22:39:13 +0100 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: Message-ID: Nickolay Kudasov wrote: >> ?In the 'free' approach, I find it unpleasant that some laws are >> automatic from the functor type, while others have to be ensured by the >> interpreter. That's why 'operational' offers only one way to implement >> monads: everything has to be done in the interpreter. > ? > As far as I know these instances are heavily used in practice, though they > are inconvenient in a way. Perhaps they could be moved in a separate > module. On the other hand one could use `FreeT` which derives instances in > a different manner. Well, that they are heavily used in practice does not mean that they are actually useful in practice. The thing is that as soon as your functor is a monad, I don't think you really need the Free type anymore -- your instruction type is already a monad. >> If you look at the transformer version Control.Monad.Trans.Free , you >> will see that there are no MonadState instances -- as expected, because you >> have to specify the interaction of effects. > > Some instances?? are present in HEAD [1], just not on hackage yet. Some > other instances (MonadCont [2], MonadWriter [3]) are waiting for Edward > Kmett's approval. Ah, I see now. Yes, it is possible for all classes that don't have control operations. (But I think it will be impossible for MonadCont). And looking at my 'operational' package, it appears that ProgramT already includes the desired MonadState and MonadIO instances! In other words, 'operational' had always included proper support for monad transformer stacks. (The MonadReader class has a control operation, local , but looking at the source for FreeT , it appears that it can actually be lifted. Amazing!) > Note that `Free` does not have "the true" set of mtl instances. While these > instances (derived from underlying functor) are heavily used in practice > for `Free`, `FreeT` suggests deriving instances from the transformed monad > (not underlying functor). It turns out the latter can be done for the most > part of MonadX instances (MonadWriter instance is somewhat questionable). > See some comments in [4]. > > That said, as we saw, Free can give you some laws automatically. However, >> this also has a drawback: Program has an optimization that Free can never >> have. Namely, Program gives you a (>>=) that can be used in a >> left-associative way (Think (((x ++ y) ++ z) ++ w) ) while still allowing >> pattern matching. > > As far as I can tell, this corresponds to church encoded versions of `Free` > and `FreeT`, namely `F` and `FT`??. > This is possible due to the work "Asymptotic Improvement of Computations > over Free Monads" by Janis Voightl?nder [5] and based on Edward Kmett's "Free > Monads for Less" series of articles [6,7]. `F` is on hackage already and > `FT` is in HEAD. Almost, but not quite. The key qualification is "while still allowing pattern matching". The church encoding is akin to difference lists: you get O(1) (++), but now head and tail are O(n) . In contrast, Program represents lists of instructions in a way similar to data List a = Nil | One a | Concat (List a) (List a) This gives you O(1) append and head / tail if used in an ephemeral fashion. (It is actually possible to turn this into a genuine O(1) head and tail, but it's not worth it.) You can't do this optimization in Free. To summarize, I currently don't see what 'free' offers that the 'operational' package can't do equally well with only 11 exported symbols. Best regards, Heinrich Apfelmus -- http://apfelmus.nfshost.com From nickolay.kudasov at gmail.com Sat Nov 30 22:33:03 2013 From: nickolay.kudasov at gmail.com (Nickolay Kudasov) Date: Sun, 1 Dec 2013 02:33:03 +0400 Subject: [Haskell-cafe] free vs. operational vs. free-operational In-Reply-To: References: Message-ID: > > ?? > Well, that they are heavily used in practice does not mean that they are > actually useful in practice. The thing is that as soon as your functor is a > monad, I don't think you really need the Free type anymore -- your > instruction type is already a monad. I don't?? use that myself, so I leave this for others to answer. But you should note that `Free m` is not the same as `m`: e.g. if `m` is a probability monad `newtype P a = P [(Double, a)]`, then `Free P` gives you much more: the whole tree of probabilities (not only probs of final results), so one could traverse that tree. So I believe `Free m` is rather useful (as is deriving instances for `Free m` the way it is). (But I think it will be impossible for MonadCont). It is. See https://github.com/ekmett/free/pull/33 for FreeT. FT has the instance in HEAD already. Almost, but not quite. The key qualification is "while still allowing > pattern matching". You're?? right. But I think it is unnecessary for a library user to pattern match on F's structure. It is pattern matching on supplied functor that matters. And that ability is not lost. To summarize, I currently don't see what 'free' offers that the > 'operational' package can't do equally well with only 11 exported symbols. As far as I can tell, while with operational you can certainly do more things, free provides more things for free (these "baked algebraic laws"). free also provides some other interesting things, like iterative (co)monad trasformers, cofree comonads and free applicatives/alternatives (which are out of operational/free common area). That all said, I don't feel myself concerned/experienced enough to state that one package should be preferred to another. Best, Nick 2013/12/1 Heinrich Apfelmus > Nickolay Kudasov wrote: > >> ?In the 'free' approach, I find it unpleasant that some laws are >>> automatic from the functor type, while others have to be ensured by the >>> interpreter. That's why 'operational' offers only one way to implement >>> monads: everything has to be done in the interpreter. >>> >> ? >> As far as I know these instances are heavily used in practice, though they >> are inconvenient in a way. Perhaps they could be moved in a separate >> module. On the other hand one could use `FreeT` which derives instances in >> a different manner. >> > > Well, that they are heavily used in practice does not mean that they are > actually useful in practice. The thing is that as soon as your functor is a > monad, I don't think you really need the Free type anymore -- your > instruction type is already a monad. > > > If you look at the transformer version Control.Monad.Trans.Free , you >>> will see that there are no MonadState instances -- as expected, because >>> you >>> have to specify the interaction of effects. >>> >> >> Some instances?? are present in HEAD [1], just not on hackage yet. Some >> other instances (MonadCont [2], MonadWriter [3]) are waiting for Edward >> Kmett's approval. >> > > Ah, I see now. Yes, it is possible for all classes that don't have control > operations. (But I think it will be impossible for MonadCont). > > And looking at my 'operational' package, it appears that ProgramT already > includes the desired MonadState and MonadIO instances! In other words, > 'operational' had always included proper support for monad transformer > stacks. > > (The MonadReader class has a control operation, local , but looking at > the source for FreeT , it appears that it can actually be lifted. Amazing!) > > Note that `Free` does not have "the true" set of mtl instances. While >> these >> instances (derived from underlying functor) are heavily used in practice >> for `Free`, `FreeT` suggests deriving instances from the transformed monad >> (not underlying functor). It turns out the latter can be done for the most >> part of MonadX instances (MonadWriter instance is somewhat questionable). >> See some comments in [4]. >> >> That said, as we saw, Free can give you some laws automatically. However, >> >>> this also has a drawback: Program has an optimization that Free can never >>> have. Namely, Program gives you a (>>=) that can be used in a >>> left-associative way (Think (((x ++ y) ++ z) ++ w) ) while still allowing >>> pattern matching. >>> >> >> As far as I can tell, this corresponds to church encoded versions of >> `Free` >> and `FreeT`, namely `F` and `FT`??. >> This is possible due to the work "Asymptotic Improvement of Computations >> over Free Monads" by Janis Voightl?nder [5] and based on Edward Kmett's >> "Free >> Monads for Less" series of articles [6,7]. `F` is on hackage already and >> `FT` is in HEAD. >> > > Almost, but not quite. The key qualification is "while still allowing > pattern matching". The church encoding is akin to difference lists: you get > O(1) (++), but now head and tail are O(n) . > > In contrast, Program represents lists of instructions in a way similar to > > data List a = Nil | One a | Concat (List a) (List a) > > This gives you O(1) append and head / tail if used in an ephemeral > fashion. (It is actually possible to turn this into a genuine O(1) head and > tail, but it's not worth it.) You can't do this optimization in Free. > > > To summarize, I currently don't see what 'free' offers that the > 'operational' package can't do equally well with only 11 exported symbols. > > > Best regards, > Heinrich Apfelmus > > -- > http://apfelmus.nfshost.com > > _______________________________________________ > Haskell-Cafe mailing list > Haskell-Cafe at haskell.org > http://www.haskell.org/mailman/listinfo/haskell-cafe > -------------- next part -------------- An HTML attachment was scrubbed... URL: