Re: [Haskell-cafe] building ghc on arch linux ARM?
On 04/ 9/12 01:03 AM, Francesco Mazzoli wrote: No, it is not possible to build GHC without GHC. Building GHC on ARM is going to be extremely tricky (I'm not sure anyone has ever done it). It's not that tricky at the end. Just install LLVM 3.0 and some OS supplied unregisterised GHC. Grab 7.4.1. sources and attempt to compile. This should produce even registerised build for you as a result of project initiated last summer by Stephen Blackheath. If you are curious about its history read some posts on http://ghcarm.wordpress.com/ Cheers, Karel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
On 04/ 9/12 10:35 AM, Graham Klyne wrote: It ships with Debian, along with the full Haskell Platform built for ARM and lots of other libraries. Other than speed, it's fine. Hmmm... I wonder if it will squeeze onto a Raspberry Pi :) It should, if not report a bug since I regularly test on ARMv7 (even GHC buildbot is using ARMv7) (side note: GHC HEAD currently broken), but Raspberry Pi provides just Broadcom BCM2835 which should be ARM1176JZFS, i.e. ARMv5. But rest assured, ARMv5 should be supported by GHC... Karel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
On 10/04/12 07:28, Karel Gardas wrote: On 04/ 9/12 01:03 AM, Francesco Mazzoli wrote: No, it is not possible to build GHC without GHC. Building GHC on ARM is going to be extremely tricky (I'm not sure anyone has ever done it). It's not that tricky at the end. Just install LLVM 3.0 and some OS supplied unregisterised GHC. Grab 7.4.1. sources and attempt to compile. This should produce even registerised build for you as a result of project initiated last summer by Stephen Blackheath. If you are curious about its history read some posts on http://ghcarm.wordpress.com/ Cheers, Karel Oh, I didn't notice that 7.4.1 shipped with this! Great stuff. Francesco. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Reconstructing a tree from a list of its paths (to leaves)
Hello, I am manipulating labeled multiway trees, some kind of lightweight XML notation. One thing I would like to be able to do is manipulating a tree as a list of (Path, Value). Generating such a list is easy but I am a little bit surprised to find it harder to reconstruct a tree, given such a list assuming some sensible properties (list is ordered, for example). I got the intuition this has already been tackled in one way or another in a functional setting in Haskell (I code in Java but using mostly functional constructs), but don't know where to look. Thanks for your pointers and help, Regards, Arnaud ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
Other than speed, it's fine. Do we know what speed issues are due to? Plus, I believed some had used GHC for smartphones? Le 9 avril 2012 01:45, Joey Hess j...@kitenet.net a écrit : Thomas DuBuisson wrote: On Sun, Apr 8, 2012 at 4:03 PM, Francesco Mazzoli f...@mazzo.li wrote: No, it is not possible to build GHC without GHC. Building GHC on ARM is going to be extremely tricky (I'm not sure anyone has ever done it). I used to use an unregistered build of GHC built by someone in the Debian community - it worked well enough. It ships with Debian, along with the full Haskell Platform built for ARM and lots of other libraries. Other than speed, it's fine. -- see shy jo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Reconstructing a tree from a list of its paths (to leaves)
On 10/04/12 09:55, Arnaud Bailly wrote: Hello, I am manipulating labeled multiway trees, some kind of lightweight XML notation. One thing I would like to be able to do is manipulating a tree as a list of (Path, Value). Generating such a list is easy but I am a little bit surprised to find it harder to reconstruct a tree, given such a list assuming some sensible properties (list is ordered, for example). I got the intuition this has already been tackled in one way or another in a functional setting in Haskell (I code in Java but using mostly functional constructs), but don't know where to look. The haskell solution would be to consider first how to turn a single (Path,Value) into a tree. Then you just combine these trees for all the paths by taking their union. I attached some code. Twan import qualified Data.Map as Map import Data.Map (Map) data Tree a b = Leaf b | Branch (Map a (Tree a b)) type Path a = [a] fromTree :: Tree a b - [(Path a,b)] fromTree (Leaf x) = [([],x)] fromTree (Branch xs) = [ (a:p,x) | (a,t) - Map.toList xs, (p,x) - fromTree t ] toTree :: Ord a = [(Path a,b)] - Tree a b toTree = foldr unionTree emptyTree . map (uncurry toTree1) toTree1 :: Ord a = Path a - b - Tree a b toTree1 [] b = Leaf b toTree1 (x:xs) b = Branch (Map.singleton x (toTree1 xs b)) emptyTree :: Tree a b emptyTree = Branch Map.empty unionTree :: Ord a = Tree a b - Tree a b - Tree a b unionTree (Branch xs) y | Map.null xs = y unionTree x (Branch ys) | Map.null ys = x unionTree (Branch xs) (Branch ys) = Branch (Map.unionWith unionTree xs ys) unionTree _ _ = error Can't have a leaf on the same level as something else ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
Hi, Am Dienstag, den 10.04.2012, 11:00 +0200 schrieb Yves Parès: Plus, I believed some had used GHC for smartphones? do you refer to http://www.joachim-breitner.de/blog/archives/300-Xmonad-on-my-mobile-phone.html or something more serious? Greetings, Joachim -- Joachim nomeata Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
For instance, yes. I think I had seen some times on this mailing list or on blog posts ( http://ghcarm.wordpress.com/) people having used GHC on ARM platform. I distinctly remember having seen on the mailing list that cross-compiling wasn't working but that we now can compile with GHC on ARM, which means GHC can be compiled for ARM. Le 10 avril 2012 12:27, Joachim Breitner m...@joachim-breitner.de a écrit : Hi, Am Dienstag, den 10.04.2012, 11:00 +0200 schrieb Yves Parès: Plus, I believed some had used GHC for smartphones? do you refer to http://www.joachim-breitner.de/blog/archives/300-Xmonad-on-my-mobile-phone.html or something more serious? Greetings, Joachim -- Joachim nomeata Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
Hi, Am Dienstag, den 10.04.2012, 12:36 +0200 schrieb Yves Parès: For instance, yes. I think I had seen some times on this mailing list or on blog posts (http://ghcarm.wordpress.com/) people having used GHC on ARM platform. I distinctly remember having seen on the mailing list that cross-compiling wasn't working but that we now can compile with GHC on ARM, which means GHC can be compiled for ARM. I’m not sure what the news are here: Debian has provided ghc6 on arm at least since Debian etch in 2006 (GHC 6.6), and the first Debian release with ghc6 (Debian sarge) ships it on alpha hppa i386 ia64 m68k powerpc s390 and sparc (GHC 6.2). All these are not cross-compiled, but natively compiled on the repective architecture, and I don’t think it is easily possible to cross-compile GHC itself even today. (All data from http://archive.debian.net/) Greetings, Joachim -- Joachim nomeata Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
All these are not cross-compiled, but natively compiled on the repective architecture, and I don’t think it is easily possible to cross-compile GHC itself even today. So how did they get compiled the first time? How do you get a GHC working on *or* for an ARM platform if you don't use Debian? And why was Joey Hess talking about performance issues? (I'll be eventually interested, as Graham Klyne suggested earlier, in compiling for Raspberry Pi, if the hardware suits). Le 10 avril 2012 12:49, Joachim Breitner m...@joachim-breitner.de a écrit : Hi, Am Dienstag, den 10.04.2012, 12:36 +0200 schrieb Yves Parès: For instance, yes. I think I had seen some times on this mailing list or on blog posts (http://ghcarm.wordpress.com/) people having used GHC on ARM platform. I distinctly remember having seen on the mailing list that cross-compiling wasn't working but that we now can compile with GHC on ARM, which means GHC can be compiled for ARM. I’m not sure what the news are here: Debian has provided ghc6 on arm at least since Debian etch in 2006 (GHC 6.6), and the first Debian release with ghc6 (Debian sarge) ships it on alpha hppa i386 ia64 m68k powerpc s390 and sparc (GHC 6.2). All these are not cross-compiled, but natively compiled on the repective architecture, and I don’t think it is easily possible to cross-compile GHC itself even today. (All data from http://archive.debian.net/) Greetings, Joachim -- Joachim nomeata Breitner m...@joachim-breitner.de | nome...@debian.org | GPG: 0x4743206C xmpp: nome...@joachim-breitner.de | http://www.joachim-breitner.de/ ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
Hi, Am Dienstag, den 10.04.2012, 13:04 +0200 schrieb Yves Parès: All these are not cross-compiled, but natively compiled on the repective architecture, and I don’t think it is easily possible to cross-compile GHC itself even today. So how did they get compiled the first time? How do you get a GHC working on or for an ARM platform if you don't use Debian? And why was Joey Hess talking about performance issues? (I'll be eventually interested, as Graham Klyne suggested earlier, in compiling for Raspberry Pi, if the hardware suits). well, GHC was more portable in version 6.8 and before (this is not cross-compiling, at least not really: http://hackage.haskell.org/trac/ghc/wiki/Building/Porting When I ported GHC to s390x half a year ago, I think I started with porting 6.8 and then kept building the next released version with the previous. It would be great, though, if porting current versions directly would become possible again. Most of these architectures do not have a native code generator (so they are compiled via C) and are unregisterized, i.e. GHC knows nothing about their registers. Both cause a performance penalty; I don’t know numbers. I assume this is what Joey refers to. But maybe also that ARM machines tend to be slower :-) I’m happily running git-annex on a NSLU2 (266MHz/23MB RAM ARM NAS device) and have done so before it was registerized, so it is definitely a useful target for Haskell. Greetings, Joachim -- Joachim Breitner e-Mail: m...@joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nome...@joachim-breitner.de signature.asc Description: This is a digitally signed message part ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Reconstructing a tree from a list of its paths (to leaves)
Hello Twan, I have a rather clear idea of how I would do it (in Haskell or in Java), but I feel this is something quite common that should have already been handled in other contexts (eg. XML/XPath stuff, JSon, CSS ?), hence my question which was admittedly not clear enough. Anyway, thanks a lot for your detailed answer and your code. Best regards, Arnaud On Tue, Apr 10, 2012 at 12:26 PM, Twan van Laarhoven twa...@gmail.com wrote: On 10/04/12 09:55, Arnaud Bailly wrote: Hello, I am manipulating labeled multiway trees, some kind of lightweight XML notation. One thing I would like to be able to do is manipulating a tree as a list of (Path, Value). Generating such a list is easy but I am a little bit surprised to find it harder to reconstruct a tree, given such a list assuming some sensible properties (list is ordered, for example). I got the intuition this has already been tackled in one way or another in a functional setting in Haskell (I code in Java but using mostly functional constructs), but don't know where to look. The haskell solution would be to consider first how to turn a single (Path,Value) into a tree. Then you just combine these trees for all the paths by taking their union. I attached some code. Twan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I Need a Better Functional Language!
Tillmann Rendel ren...@informatik.uni-marburg.de wrote: I am curious what are interesting use-cases for that? Symbolic analysis? self-compilers? Optimization. For example, imagine the following definition of function composition: map f . map g = map (f . g) f . g = \x - f (g x) In Haskell, we cannot write this, because we cannot pattern match on function calls. Static optimizations like this one can be done, when you have an abstraction layer above the actual functions. In fact you can even write efficient statically and dynamically self-organizing networks of functions, as long as there is an algebraic type to support it. Greets, Ertugrul -- nightmare = unsafePerformIO (getWrongWife = sex) http://ertes.de/ signature.asc Description: PGP signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
Okay, thanks for the explanation. But that does not completely answer the original question: now, using branch 7 of GHC what can you do to get a haskell program compiled on/for an ARM platform without using Debian? You have to use LLVM? So you have to compile your program on a regular x86/x64 PC for LLVM backend and then use that bytecode on your ARM platform, is that it? Is LLVM bytecode that portable? I don't much about LLVM, so sorry if those questions feel a bit dumb ;) ghcarm speaks about the Pandaboard and LLVM in a post: http://ghcarm.wordpress.com/2011/07/03/llvm-on-arm-testing And thanks for the information about git-annex, I'm checking that out, it looks interesting ;) Actually, bottomline I would be interested in running a web app (preferably using Yesod) on a Raspberry Pi (or similar, but more expensive), but this use case is cool too. Le 10 avril 2012 13:13, Joachim Breitner m...@joachim-breitner.de a écrit : Hi, Am Dienstag, den 10.04.2012, 13:04 +0200 schrieb Yves Parès: All these are not cross-compiled, but natively compiled on the repective architecture, and I don’t think it is easily possible to cross-compile GHC itself even today. So how did they get compiled the first time? How do you get a GHC working on or for an ARM platform if you don't use Debian? And why was Joey Hess talking about performance issues? (I'll be eventually interested, as Graham Klyne suggested earlier, in compiling for Raspberry Pi, if the hardware suits). well, GHC was more portable in version 6.8 and before (this is not cross-compiling, at least not really: http://hackage.haskell.org/trac/ghc/wiki/Building/Porting When I ported GHC to s390x half a year ago, I think I started with porting 6.8 and then kept building the next released version with the previous. It would be great, though, if porting current versions directly would become possible again. Most of these architectures do not have a native code generator (so they are compiled via C) and are unregisterized, i.e. GHC knows nothing about their registers. Both cause a performance penalty; I don’t know numbers. I assume this is what Joey refers to. But maybe also that ARM machines tend to be slower :-) I’m happily running git-annex on a NSLU2 (266MHz/23MB RAM ARM NAS device) and have done so before it was registerized, so it is definitely a useful target for Haskell. Greetings, Joachim -- Joachim Breitner e-Mail: m...@joachim-breitner.de Homepage: http://www.joachim-breitner.de Jabber-ID: nome...@joachim-breitner.de ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] I Need a Better Functional Language!
10.04.2012, 02:00, Ryan Ingram ryani.s...@gmail.com: A concurring opinion here, and an example. iff :: Bol - a - a - a iff True x _ = x iff False _ x = x f, g :: Bool - Bool f x = x g x = iff x True False Are these two functions equal? I would say yes, they are. Yet once you can pattern match on functions, you can easily tell these functions apart, and create a function h :: (Bool - Bool) - Bool such that h f = True but h g = False. -- ryan I've just remembered an interesting statement that there is a language where each equivalence class of programs Dan Doel mentioned (f = g iff forall x. f x = g x) has a single program in it. That is there is a one-to-one correspondence between programs and functions. Though as far as I understood one cannot construct a translator from this language to another language. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Call for Participation: Tests and Proofs (TAP 2012) in Prague
Apologies for duplicates. CALL FOR PARTICIPATION TESTS and PROOFS 2012 (TOOLS EUROPE 2012) 6th International Conference on Tests Proofs May 31 - June 1, 2012, Prague, Czech Republic http://lifc.univ-fcomte.fr/tap2012/ Co-located with: ICMT 2012, SC 2012, MSEPT 2012 as part of TOOLS 2012: http://toolseurope2012.fit.cvut.cz/ The TAP conference is devoted to the convergence of proofs and tests. It combines ideas from both sides for the advancement of software quality. Keynote Speakers * Andreas Kuehlmann http://www.eecs.berkeley.edu/%7Ekuehl/, Coverity The Technology and Psychology of Testing Your Code as You Develop It (abstract http://lifc.univ-fcomte.fr/tap2012/abstract_talk_Kuehlmann.pdf) * Corina Pasareanu http://ti.arc.nasa.gov/profile/pcorina/, NASA Ames Research Center Combining Model Checking and Symbolic Execution for Software Testing (abstract http://lifc.univ-fcomte.fr/tap2012/abstract_talk_Pasareanu.pdf) * Mehdi Jazayeri, University of Lugano. Software Composition: Why, what, and how Registration: = Early registration, at a reduced price, will be open until 25 April 2012. http://toolseurope2012.fit.cvut.cz/index.php/registration.html Organization: = Conference Chair Bertrand Meyer, ETH Zurich, Eiffel Software, and ITMO Program Chairs Achim D. Brucker, SAP Research, Germany Jacques Julliand, University of Franche-Comté Local Organization Pavel Tvrdik, CTU Prague Michal Valenta, CTU Prague Jindra Vojikova, CTU Prague Jan Chrastina, CTU Prague Program: Thursday 31th May, 09:00-10:30: Invited Talk * Andreas Kuehlmann, Coverity: The Technology and Psychology of Testing Your Code as You Develop It Thursday, 11:00-13:00: Paper session Model-Based Testing * Malte Lochau, Ina Schaefer, Jochen Kamischke and Sascha Lity. Incremental Model-based Testing of Delta-oriented Software Product Lines * Hernan Ponce De Leon, Stefan Haar and Delphine Longuet. Conformance Relations for Labeled Event Structures * Joseph Kiniry, Daniel M. Zimmerman and Ralph Hyland. Testing Library Specifications by Verifying Conformance Tests * Chedor Sebastien, Thierry J?ron and Morvan Christophe. Test generation from recursive tiles systems Thursday, 14:30-15:30: Paper session Scenario and UML-Based Testing * Nadia Creignou, Uwe Egly and Martina Seidl. A Framework for the Specification of Random SAT and QSAT Formulas * Jens Brüning, Martin Gogolla, Lars Hamann and Mirco Kuhlmann. Evaluating and Debugging OCL Expressions in UML Models * Uwe Egly, Sebastian Gabmeyer, Martina Seidl, Hans Tompits, Towards Scenario-Based Testing of UML Diagrams Thursday, 16:00-17:00: Tutorial * Nikolay Kosmatov, Nicky Williams. Automated Structural Testing with PathCrawler Friday 1st June, 09:00-10:30: Invited Talk of SC * Mehdi Jazayeri, University of Lugano. Software Composition: Why, what, and how Friday 11:00-13:00: Invited Talk of TAP * Corina Pasareanu. NASA. Combining Model Checking and Symbolic Execution for Software Testing Friday, 14:30-15:30: Paper session Test and Model-checking * Martin Sulzmann and Axel Zechner Constructive Finite Trace Analysis with Linear Temporal Logic * Alessandro Armando, Roberto Carbone, Giancarlo Pellegrino, Alessio Merlo and Davide Balzarotti. From Model-checking to Automated Testing of Security Protocols: Bridging the Gap Friday, 16:00-17:30: Paper session Test of Complex Data Structures * Valerio Senni and Fabio Fioravanti. Generation of test data structures using Constraint Logic Programming * Valeria Bengolea, Nazareno Aguirre, Darko Marinov and Marcelo Frias. Coverage Criteria on RepOK to Reduce Bounded Exhaustive Test Suites * Matthieu Carlier, Catherine Dubois and Arnaud Gotlieb. A first step in the design of a formally verified constraint-based testing tool: FocalTest -- Dr. Achim D. Brucker, SAP Research, Vincenz-Priessnitz-Str. 1, D-76131 Karlsruhe Phone: +49 6227 7-52595, http://www.brucker.ch ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.1.0
On 09/04/12 23:49, Paolo Capriotti wrote: I'm pleased to announce the release of version 0.1.0 of pipes-core, a library for efficient, safe and compositional IO, similar in scope to iteratee and conduits. http://hackage.haskell.org/package/pipes-core I have some issues with the function names used firstP :: Monad m = Pipe a b m r - Pipe (Either a c) (Either b c) m r secondP :: Monad m = Pipe a b m r - Pipe (Either c a) (Either c b) m r Why are firstP and secondP not called leftP and rightP? Those are the corresponding functions in Arrow. Similarly (***) should be called (+++). I also don't like `intersperse`, which does something completely different from its Data.List counterpart. intersperse :: Monad m = (a - Bool) - Pipe a (Maybe a) m r Data.List.intersperse :: a - [a] - [a] The documentation is also a bit misleading Yield Nothing when an input satisfying the predicate is received. To me this suggests that could behave like some kind of filter, intersperse p = pipe $ \x - if p x then Nothing else Just x A true intersperse analogue would be intersperse x = do y0 - await yield y0 forever $ do y - await yield x yield y The function you have defined is something like `yieldNothingBeforeMatching`. Do you have a use case for this function? Perhaps an interesting combinator would be -- | Run the first pipe until it yields a value, then run the second pipe until it yields, the the first pipe again, etc. alternate :: Pipe a b m r - Pipe a b m r - Pipe a b m r intersperse x = alternate idP (forever (yield x)) Although I have no idea if it is actually useful in practice. Twan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANNOUNCE: pipes-core 0.1.0
On Tue, Apr 10, 2012 at 4:50 PM, Twan van Laarhoven twa...@gmail.com wrote: I have some issues with the function names used firstP :: Monad m = Pipe a b m r - Pipe (Either a c) (Either b c) m r secondP :: Monad m = Pipe a b m r - Pipe (Either c a) (Either c b) m r Why are firstP and secondP not called leftP and rightP? Those are the corresponding functions in Arrow. Similarly (***) should be called (+++). firstP and secondP are the two components of the morphism function of the binoidal functor 'Either' on the Pipe category. I'm following the terminology of the 'categories' package here, as you can see from the newtype wrappers in Control.Pipe.Category. Since (pre-)monoidal categories are a generalization of Arrow, I think it's reasonable to extend the meaning of 'first' and 'second', instead of reusing the ArrowChoice method names, which are just another specialization of the same general concept. I also don't like `intersperse`, which does something completely different from its Data.List counterpart. intersperse :: Monad m = (a - Bool) - Pipe a (Maybe a) m r Data.List.intersperse :: a - [a] - [a] You're right. It was meant as a generalization of that, but I agree it needs a better name. The documentation is also a bit misleading Yield Nothing when an input satisfying the predicate is received. To me this suggests that could behave like some kind of filter, intersperse p = pipe $ \x - if p x then Nothing else Just x Yes, that is indeed confusing. A true intersperse analogue would be intersperse x = do y0 - await yield y0 forever $ do y - await yield x yield y You can define this using the current intersperse: intersperse' x = intersperse (const True) + (await pipe (fromMaybe x)) That's why I feel it's a generalization. The function you have defined is something like `yieldNothingBeforeMatching`. Do you have a use case for this function? Well, I wrote it for a project of mine, and then decided it was general enough to be included in Combinators. Maybe that wasn't such a good idea. Perhaps an interesting combinator would be -- | Run the first pipe until it yields a value, then run the second pipe until it yields, the the first pipe again, etc. alternate :: Pipe a b m r - Pipe a b m r - Pipe a b m r intersperse x = alternate idP (forever (yield x)) Although I have no idea if it is actually useful in practice. Neither do I. I think I'll just remove intersperse for the next release. Thanks a lot for your feedback! Paolo ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
Joachim Breitner wrote: Most of these architectures do not have a native code generator (so they are compiled via C) and are unregisterized, i.e. GHC knows nothing about their registers. Both cause a performance penalty; I don’t know numbers. I assume this is what Joey refers to. But maybe also that ARM machines tend to be slower :-) Both of course. The rare times I need to build a fairly big haskell program like git-annex on arm, it can easily take an hour or so with -O0. BTW, the other problem with Haskell on arm is that AFAIK there is no ghci, and so also no Template Haskell, and so if you're writing Real World utilities that you want to be maximally portable, this means you have to avoid using an increasing number of libraries. This rules Yesod right out; I've avoided using lenses as I'd have to write much manual boilerplate, etc. -- see shy jo signature.asc Description: Digital signature ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] building ghc on arch linux ARM?
On 04/10/12 07:03 PM, Joey Hess wrote: BTW, the other problem with Haskell on arm is that AFAIK there is no ghci, and so also no Template Haskell, and so if you're writing Real World utilities that you want to be maximally portable, this means you have to avoid using an increasing number of libraries. This rules Yesod right out; I've avoided using lenses as I'd have to write much manual boilerplate, etc. Ben Gamari already submitted his ARM/Linker support so GHCi is already kind of working, i.e. is built but at least on my setup still fails on majority of tests so there are still some outstanding issues probably. Anyway, things are moving forward... Karel ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Mixing Unboxed Mutable Vectors and Parsers
On 12-04-07 05:35 PM, Myles C. Maxfield wrote: So here are my questions: ... 3. Are there any parsers that support streaming semantics and being used as a monad transformer? This would require rewriting my whole program to use this new parser, but if that's what I have to do, then so be it. Have a look at the incremental-parser package. It's not a monad transformer, only a monad, but it's written with streaming in mind. In particular, it solves the problem of mismatch between the input chunk boundaries and the boundaries of the structures you're trying to parse. The current version supports ByteString, Text, and list inputs out of the box, but support for Vector and arrays can be added as outside instances. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Mixing Unboxed Mutable Vectors and Parsers
On 2012-04-07 23:35, Myles C. Maxfield wrote: CC: Maintainers of STMonadTrans, Vector, and JuicyPixels Hello, I am writing a Haskell Attoparsec parser which will modify 2-d arrays of small values (Word8, Int8, etc.). My first idea was to simply parse all the deltas, and later apply them to the input list. However, I can't do that because the value of the deltas depend on the value they're modifying. My first pass at this program used a function of the form: p :: [[Word8]] - Parser [[Word8]] This approach works, however, the program uses far too much memory. Does the parser really need the input to determine what to do? Or is the parse tree the same regardless? In the latter case, you could perhaps rewrite it to p :: Parser ([[Word8]] - [[Word8]]) or when working with mutable vectors p :: MVector s Word8 - Parser (ST s ()) So instead of explicit deltas, the deltas can just be the function that applies them. Twan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] ANN: Selenium WebDriver client for Haskell
The first release of the webdriver package has been uploaded to Hackage. Selenium is a test suite that allows you to automate web browsers on a variety of platforms. The webdriver package acts as a client library that speaks Selenium's WebDriver protocol, using a simple monadic interface. This alpha release has received a month of testing through my own usage, and has most of the capabilities of the official Selenium clients, with more to come. Future plans include utilizing the http-conduit and attoparsec-conduit packages for memory efficient JSON parsing, and using the reflection package to safely handle multiple versions of the WebDriver protocol through implicit configurations. For more information, see http://hackage.haskell.org/package/webdriver ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] ANN: Selenium WebDriver client for Haskell
That looks great, Adam, thanks for sharing! I've been using watir-webdriver but ruby tends to be a lot more painful to use than Haskell (even though I use ruby only for the tests!). Looking forward to see what I can do with your package =). Cheers, -- Felipe. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Reconstructing a tree from a list of its paths (to leaves)
On 10/04/2012, at 7:55 PM, Arnaud Bailly wrote: I am manipulating labeled multiway trees, some kind of lightweight XML notation. One thing I would like to be able to do is manipulating a tree as a list of (Path, Value). Generating such a list is easy but I am a little bit surprised to find it harder to reconstruct a tree, given such a list assuming some sensible properties (list is ordered, for example). Given a tree, there is a unique set of (Path, Value) pairs. Given a set of (Path, Value) pairs, there might be no trees, one, or infinitely many. For example, suppose we have data XM = XE String [XM] | XL String as a simplification of XML and paths :: XM - [([Int],String)] paths (XL s)= [([], s)] paths (XE _ ks) = [(i:p,v) | (i,k) - zip [1..] ks, (p,v) - paths k] as the function to reduce a tree to a list of (path,value) pairs. paths (XE foo [XE bar [XL zabbo], XE ugh [XL troppo]]) == [([1,1],zabbo),([2,1],troppo)] in which foo, bar, and ugh have been irretrievably lost. So you need to be rather more explicit about your sensible properties. (The list being ordered is not one of them; sorting is a solved problem.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] XMPP library recommendations
Hi folks, I'm looking for suggestions for XMPP libraries. So far I have found three on Hackage. Thanks to the authors of these - I think a lot of good can come from XMPP in Haskell. However, all of them appear to be minimally maintained, if at all: * XMPP - only one upload, over 2 years ago. Does not support TLS (required by many modern servers). Does not support SASL (also required by many modern servers). After finding the options on a test server to disable the requirements for TLS and SASL, it worked. * network-protocol-XMPP - uploaded recently to fix 7.4 build issue, not much other recent activity. Refuses to connect to a test account with Received empty challenge (this does not appear to be an accurate error message, but rather a bug in XML parsing). A bit more low-level than I'm looking for. * haskell-xmpp - only one upload, over 1 year ago. Connects and works. I like the design. Is hard-coded to write debug messages to stdout, making it a bit of a problem for programs that use stdout (though a one-liner mod to the code would fix that). Says it's alpha and work in progress. What experience do people have with these? Any recommendations? Thanks, -- John ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] process-conduit appears to hang on windows
Hi, I am trying to use process-conduit on windows, but it appears to hang when using the conduitCmd. Is there a reason why this doesn't work? Thanks for any help, Grant {-# LANGUAGE QuasiQuotes #-} import System.Process.QQ import Data.Conduit import qualified Data.Conduit.Binary as CB import qualified Data.Conduit.List as CL import Data.Conduit.Process import qualified Data.ByteString as B import System.IO main :: IO () main = runResourceT $ [scmd|dir *.txt|] $$ [ccmd|find /i help|] =$ CB.sinkHandle stderr main1::IO() main1 = runResourceT $ sourceCmd dir $= conduitCmd find /i \help\ $$ CB.sinkHandle stdout ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] GHCi runtime linker: fatal error (was Installing REPA)
Ben Lippmeier b...@ouroborus.net wrote: I pushed Repa 3.1 to Hackage on the weekend. It has a *much* cleaner API. I can't recommend continuing to use Repa 2. You will just run into all the problems that are now fixed in Repa 3. I was going to ask about the wiki page, and saw that you've posted a note there. Nice! Now only if someone would update it... :) http://www.haskell.org/haskellwiki/Numeric_Haskell:_A_Repa_Tutorial Is the differences between Repa 2 and Repa 3 documented somewhere? I'm having trouble with running examples from the Repa paper... Thanks, Sajith. -- the lyf so short, the craft so long to lerne. -- Chaucer. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Reconstructing a tree from a list of its paths (to leaves)
You are right, of course. By sensible properties I simply meant the list of (Path, Value) is assumed to represent a tree (eg. it has been generated by a traversal of some original tree). By ordered I meant Path(s) segments are lexicographically ordered and (Path, Value) are enumerated from a tree using depth-first traversal. Thanks, Arnaud On Wed, Apr 11, 2012 at 2:15 AM, Richard O'Keefe o...@cs.otago.ac.nz wrote: On 10/04/2012, at 7:55 PM, Arnaud Bailly wrote: I am manipulating labeled multiway trees, some kind of lightweight XML notation. One thing I would like to be able to do is manipulating a tree as a list of (Path, Value). Generating such a list is easy but I am a little bit surprised to find it harder to reconstruct a tree, given such a list assuming some sensible properties (list is ordered, for example). Given a tree, there is a unique set of (Path, Value) pairs. Given a set of (Path, Value) pairs, there might be no trees, one, or infinitely many. For example, suppose we have data XM = XE String [XM] | XL String as a simplification of XML and paths :: XM - [([Int],String)] paths (XL s) = [([], s)] paths (XE _ ks) = [(i:p,v) | (i,k) - zip [1..] ks, (p,v) - paths k] as the function to reduce a tree to a list of (path,value) pairs. paths (XE foo [XE bar [XL zabbo], XE ugh [XL troppo]]) == [([1,1],zabbo),([2,1],troppo)] in which foo, bar, and ugh have been irretrievably lost. So you need to be rather more explicit about your sensible properties. (The list being ordered is not one of them; sorting is a solved problem.) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Reconstructing a tree from a list of its paths (to leaves)
On 11/04/2012, at 4:23 PM, Arnaud Bailly wrote: You are right, of course. By sensible properties I simply meant the list of (Path, Value) is assumed to represent a tree (eg. it has been generated by a traversal of some original tree). By ordered I meant Path(s) segments are lexicographically ordered and (Path, Value) are enumerated from a tree using depth-first traversal. My main point was that there is a sensible property that you did not mention, and you still have not mentioned it, namely that *ALL* non-structural information about a node must be represented in the Value that corresponds to it (and of course, that all the nodes are actually listed somewhere). Given your constraints, the sequence of (Path,Value) pairs must begin with a ([],Value) representing the non-structural information about the root, then a sequence of (1:x11,v11) ... (1:x1k,v1k) (n:xn1,vn1) ... (n:xnm,vnm) pairs which you partition as (x11,v11) ... (x1k,v1k) ... (xn1,vn1) ... (xnm,vnm) and then process recursively to make the children. The initial lexicographic ordering is _not_ an important property because you can ensure that by sorting. As long as the paths are numbered correctly, the kind of traversal that was used to generate the initial list is not important either. But the no-missing-nodes and no-missing-non-structural- information properties are crucial. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe