Re: [Haskell-cafe] Cabal-install

2010-03-08 Thread Miguel Mitrofanov
MigMit:~ MigMit$ cabal --help This program is the command line interface to the Haskell Cabal infrastructure. See http://www.haskell.org/cabal/ for more information. ^ | + On 8 Mar 2010, at 19:51, Andrew Coppin wrote: OK, so

Re: [Haskell-cafe] Cabal-install

2010-03-08 Thread Andrew Coppin
Miguel Mitrofanov wrote: See http://www.haskell.org/cabal/ for more information. ^ | + Oh, sure, like I haven't already tried *that*. ;-) ___ Haskell-Cafe mailing list

Re: [Haskell-cafe] Cabal-install

2010-03-08 Thread Andrew Coppin
Peter Robinson wrote: On 8 March 2010 17:51, Andrew Coppin andrewcop...@btinternet.com wrote: Anyway, can anybody tell me how I can change the default settings so that I get profiling libraries built by default, and Haddock documentation built by default? (I'm on Windows, in case that makes

[Haskell-cafe] search Data.Tree.Zipper

2010-03-08 Thread Jian Fan
Hi, There doesn't seem to be a function to search the tree so I come up with following function: searchTree :: (a - Bool) - TreeLoc a - Maybe (TreeLoc a) searchTree pred rootLoc = if pred (getLabel rootLoc) then Just rootLoc else case firstChild rootLoc of Just loc - case

Re: [Haskell-cafe] search Data.Tree.Zipper

2010-03-08 Thread MightyByte
I haven't tested it, but I think you're looking for something like this: searchTree2 :: (a - Bool) - TreeLoc a - Maybe (TreeLoc a) searchTree2 pred rootLoc = if pred (getLabel rootLoc) then Just rootLoc else firstChild rootLoc = siblings where siblings loc = searchTree2 pred loc

[Haskell-cafe] file descriptors and handles

2010-03-08 Thread Mathijs Kwik
Hi all, Today I had a look at chapter 20 of RWH. The extended example (stripped down HSH) in the end is great. I think I understand it, but I have some questions left: the master process closes the client-sided FD's. it uses fdToHandle for the other sides of the pipe to get a handle to stdIn and

Re: [Haskell-cafe] search Data.Tree.Zipper

2010-03-08 Thread Dan Weston
I think you want find :: Foldable t = (a - Bool) - t a - Maybe a Jian Fan wrote: Hi, There doesn't seem to be a function to search the tree so I come up with following function: searchTree :: (a - Bool) - TreeLoc a - Maybe (TreeLoc a) searchTree pred rootLoc = if pred (getLabel rootLoc)

[Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Günther Schmidt
Hi all, and Oleg et al in particular. Yeah, subject Finally Tagless again, sorry, I'm just not done with it yet. In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. I wonder if

[Haskell-cafe] ptys and hGetContent problem

2010-03-08 Thread Mathijs Kwik
Hi all, I found this blogpost from Bryan O'Sullivan http://www.serpentine.com/blog/2008/09/30/unix-hacking-in-haskell-better-pseudoterminal-support/ and I wanted to try it out. Before moving to an interactive command (which needs pty), I just did a small test for ls -l / to see if it worked. I

[Haskell-cafe] Re: [Haskell] Recursive definition of fibonacci with Data.Vector

2010-03-08 Thread Henning Thielemann
On Sun, 7 Mar 2010, Edgar Z. Alvarenga wrote: Hello, why I can't define a recursive vector using Data.Vector, like in the example: import qualified Data.Vector as V let fib = 0 `V.cons` (1 `V.cons` V.zipWith (+) fib (V.tail v)) Since I liked to have both element-wise lazy construction and

[Haskell-cafe] Re: search Data.Tree.Zipper

2010-03-08 Thread Jian Fan
I somehow cannot figure this out. Tree is Foldable so I can use find on it. But how can I use find on TreeLoc? Am I missing something obvious? Dan Weston weston...@imageworks.com wrote: I think you want find :: Foldable t = (a - Bool) - t a - Maybe a Jian Fan wrote: Hi, There doesn't

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Tom Schrijvers
Yeah, subject Finally Tagless again, sorry, I'm just not done with it yet. In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. I wonder if it'd be possible to do the same without

Re: [Haskell-cafe] ptys and hGetContent problem

2010-03-08 Thread Ivan Lazar Miljenovic
And further... If I do want to use an interactive program which needs input, how do I send ctrl-d or ctrl-c? tail -f needs ctrl-c (or I need to kill the process) You want Ctrl-d in Unix-based OSs and Ctrl-z in Windows: http://en.wikipedia.org/wiki/End_of_File . Ctrl-c kills a program. --

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Stephen Tetley
Hi Günther The finally tagless style is an implementation of the TypeCase pattern (Bruno C. d. S. Oliveira and Jeremy Gibbons): http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/typecase.pdf TypeCase can be implemented via GADTs or type classes - typed printf in section 4.2 of the paper is

[Haskell-cafe] Mini-announce: AC-Color 1.1.3

2010-03-08 Thread Andrew Coppin
I just uploaded a new version of the ever-unpopular AC-Colour package. (Yes, there's a country where it's spelled that way.) What it already did: Provides a simple strict unboxed RGB colour type, with arithmetic. The three channels can be either Double or Word8. (And there's some low-level

[Haskell-cafe] Haskell Weekly News: Issue 152 - March 08, 2010

2010-03-08 Thread jfredett
--- Haskell Weekly News http://sequence.complete.org/hwn/20100308 Issue 152 - March 08, 2010 --- Welcome to issue 152 of HWN, a newsletter covering

[Haskell-cafe] generalized newtype deriving allows the definition of otherwise undefinable functions

2010-03-08 Thread Wolfgang Jeltsch
Hello, some time ago, it was pointed out that generalized newtype deriving could be used to circumvent module borders. Now, I found out that generalized newtype deriving can even be used to define functions that would be impossible to define otherwise. To me, this is surprising since I

Re: [Haskell-cafe] ptys and hGetContent problem

2010-03-08 Thread Nick Bowler
On 20:38 Mon 08 Mar , Mathijs Kwik wrote: Hi all, I found this blogpost from Bryan O'Sullivan http://www.serpentine.com/blog/2008/09/30/unix-hacking-in-haskell-better-pseudoterminal-support/ and I wanted to try it out. Before moving to an interactive command (which needs pty), I just

Re: [Haskell-cafe] Haskell course, training

2010-03-08 Thread Henning Thielemann
On Sun, 7 Mar 2010, G?nther Schmidt wrote: I think I've reached the point where I need some tutoring, so provided I've got money for travel and course fees, and time, where do I get it? I'm not a student so some courses aren't available to me. How about visiting our Haskell meeting in

Re: [Haskell-cafe] Num instance for Lazy ByteStrings (was: NumLazyByteString Package License)

2010-03-08 Thread Henning Thielemann
On Mon, 8 Mar 2010, Thomas DuBuisson wrote: Tristan and other interested parties on the Cafe, Answering your question first, Tristan: I was going to use BSD3 (if it isn't already) for the NumLazyByteString. Is NumLazyByteString a newtype around Bytestring.Lazy that interprets the bit

[Haskell-cafe] Re: Cabal dependency hell

2010-03-08 Thread Maciej Piechotka
On Mon, 2010-03-08 at 15:37 +0100, Marc Weber wrote: Hi Maciej, that's why I started hack-nix. You can patch dependencies easily. However you have to install the Nix package manager. It also works with lates versions only because the dependency solves is written in Nix itself.

Re: [Haskell-cafe] generalized newtype deriving allows the definition of otherwise undefinable functions

2010-03-08 Thread Wolfgang Jeltsch
Am Montag, 8. März 2010 22:45:19 schrieb Wolfgang Jeltsch: Hello, some time ago, it was pointed out that generalized newtype deriving could be used to circumvent module borders. Now, I found out that generalized newtype deriving can even be used to define functions that would be impossible

Re: [Haskell-cafe] ptys and hGetContent problem

2010-03-08 Thread Richard O'Keefe
On Mar 9, 2010, at 9:35 AM, Ivan Lazar Miljenovic wrote: And further... If I do want to use an interactive program which needs input, how do I send ctrl-d or ctrl-c? tail -f needs ctrl-c (or I need to kill the process) You want Ctrl-d in Unix-based OSs and Ctrl-z in Windows:

Re: [Haskell-cafe] Books for advanced Haskell

2010-03-08 Thread Tom Davies
On 04/03/2010, at 8:28 PM, Curt Sampson wrote: ... I recommend reading The Typeclassopedia,[1], which will introduce you to all of the monad's friends and family. [1]: http://byorgey.wordpress.com/2009/03/16/monadreader-13-is-out/ I'd love to read a book-length version of the

Re: [Haskell-cafe] Num instance for Lazy ByteStrings (was: NumLazyByteString Package License)

2010-03-08 Thread Thomas DuBuisson
Is NumLazyByteString a newtype around Bytestring.Lazy that interprets the bit stream represented by the ByteString as integer? Not exactly. There is not newtype wrapper. NumLazyByteString is: instance Num L.ByteString where ... instance Enum L.ByteString where ... instance Integral

Re: [Haskell-cafe] ptys and hGetContent problem

2010-03-08 Thread Mathijs Kwik
Ok, cool I got a bit further now. I'm not using handles anymore (they seem to break indeed for ptys). Just using executePseudoTerminalFd now (from the original blogpost) and fdRead/fdWrite. Now I can communicate with the process and all goes well. If I really want lazy-like behaviour, I can just

Re: [Haskell-cafe] ptys and hGetContent problem

2010-03-08 Thread Mathijs Kwik
And to reply to myself again... ta - getTerminalAttributes fd setTerminalAttributes fd (withoutMode ta EnableEcho) Immediately -- and to find the right EOF character: let Just eofChar = controlChar ta EndOfFile On Tue, Mar 9, 2010 at 12:23 AM, Mathijs Kwik bluescreen...@gmail.com wrote:

Re: [Haskell-cafe] file descriptors and handles

2010-03-08 Thread Brandon S. Allbery KF8NH
On Mar 8, 2010, at 14:26 , Mathijs Kwik wrote: it writes to the stdIn handle and closes it afterwards. - doesn't it need to close the fd as well? Once you've made a Handle from it, the Handle owns it; in particular, when the Handle is finalized it will close the fd. Also, attempting to

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Jacques Carette
Stephen Tetley wrote: The finally tagless style is an implementation of the TypeCase pattern (Bruno C. d. S. Oliveira and Jeremy Gibbons): One part of our work does that, yes. The authors of the Finally Tagless note in the long version of their paper that the GADT TypeCase had some

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Jacques Carette
Günther Schmidt wrote: In Olegs haskell implementation he is using classes mainly to model the syntax and instances to use for evaluators / compilers to allow multiple interpretations. When there are 3 authors on a paper (and in the implementation file), it is customary to acknowledge all 3,

Re: [Haskell-cafe] more thoughts on Finally tagless

2010-03-08 Thread Günther Schmidt
Dear Jacques, you are right, I should have done so and will do my best not to repeat this error. Please accept my sincere apologies to Ken and yourself for my negligence, no offense was meant. Best regards Günther Am 09.03.10 03:37, schrieb Jacques Carette: Günther Schmidt wrote:

Re: [Haskell-cafe] Re: Real-time garbage collection for Haskell

2010-03-08 Thread Curt Sampson
On 2010-03-06 12:42 + (Sat), Simon Marlow wrote: Usually I find keeping the nursery size (-A) close to the L2 cache size works best, although sometimes making it really big can be even better. Interesting to know. I got the impression that I was being encouraged to keep -A closer to the

Re: [Haskell-cafe] Real-time garbage collection for Haskell

2010-03-08 Thread Curt Sampson
On 2010-03-05 10:50 +0100 (Fri), Henning Thielemann wrote: Curt Sampson schrieb: Understanding the general techniques for this sort of thing and seeing where you're likely to need to apply them isn't all that difficult, once you understand the problem. (It's probably much easier if you don't

Re: [Haskell-cafe] generalized newtype deriving allows the definition of otherwise undefinable functions

2010-03-08 Thread Steffen Schuldenzucker
On 03/08/2010 10:45 PM, Wolfgang Jeltsch wrote: The point is, of course, that such conversions are not only possible for binary operations but for arbitrary values and that these conversions are done by a single generic function conv. I don’t think it would be possible to implement conv

Re: [Haskell-cafe] Haskell course, training

2010-03-08 Thread Ozgur Akgun
I was going to suggest the summer course in Utrecht, but I was concerned about whether it was exclusively for students or not. I've been to the first summer school last year, and it is particularly helpful if you didn't have the chance to take a proper functional programming (and Haskell) course

Re: [Haskell-cafe] ghc leaking memory?

2010-03-08 Thread Simon Marlow
On 06/03/2010 18:43, Antoine Latter wrote: Including ghc-users. On Sat, Mar 6, 2010 at 11:57 AM, Joachim Breitnernome...@debian.org wrote: Hi, in Debian, we are having some problems building large libraries (such as agda, highlighting-kate, xmonad-contrib) on weaker architectures (sparc,

[Haskell-cafe] how to write a function to send a string to a tuple

2010-03-08 Thread Pradeep Wickramanayake
Hi, Im having problems with sending a string to a tuple. My string contains integers and strings The whole string stay as (test,dfdf,3,dfsf) sortList2 :: String - String sortList2 (x:xs) | x == ',' = | otherwise = [x] ++ sortList2 xs The

Re: [Haskell-cafe] how to write a function to send a string to a tuple

2010-03-08 Thread Deniz Dogan
2010/3/8 Pradeep Wickramanayake prad...@talk.lk: Hi, Im having problems with sending a string to a tuple. My string contains integers and strings The whole string stay as (“test,dfdf”,3,”dfsf”) sortList2 :: String - String sortList2 (x:xs)     | x == ',' =   

Re: [Haskell-cafe] ghc leaking memory?

2010-03-08 Thread Joachim Breitner
Hi Simon, Am Montag, den 08.03.2010, 11:07 + schrieb Simon Marlow: On Sat, Mar 6, 2010 at 11:57 AM, Joachim Breitnernome...@debian.org wrote: Hi, in Debian, we are having some problems building large libraries (such as agda, highlighting-kate, xmonad-contrib) on weaker

[Haskell-cafe] Cabal dependency hell

2010-03-08 Thread Maciej Piechotka
While I love Haskell it's packaging system have some problems - especially with parsec. Currently I'm not able to install an practically anything using cabal due to version mismatches (or at least packages linking to both version of parsec). I found the following problems in various cabal

Re: [Haskell-cafe] ghc leaking memory?

2010-03-08 Thread Simon Marlow
On 08/03/2010 13:30, Joachim Breitner wrote: Hi Simon, Am Montag, den 08.03.2010, 11:07 + schrieb Simon Marlow: On Sat, Mar 6, 2010 at 11:57 AM, Joachim Breitnernome...@debian.org wrote: Hi, in Debian, we are having some problems building large libraries (such as agda,

Re: [Haskell-cafe] Cabal dependency hell

2010-03-08 Thread Bulat Ziganshin
Hello Maciej, Monday, March 8, 2010, 4:33:08 PM, you wrote: PS. I understand that content may be flame-gen. I am sorry in advance if such circumstances happen. However I believe that possible improvements in process are worth the risk. i was the author of this idea and i thought that 1)

Re: [Haskell-cafe] Cabal dependency hell

2010-03-08 Thread Marc Weber
Hi Maciej, that's why I started hack-nix. You can patch dependencies easily. However you have to install the Nix package manager. It also works with lates versions only because the dependency solves is written in Nix itself. Which package is causing trouble to you? We can't expect package

Re: [Haskell-cafe] Re: Books for advanced Haskell

2010-03-08 Thread Yusaku Hashimoto
On Sun, Mar 7, 2010 at 10:53 PM, Stephen Tetley stephen.tet...@gmail.com wrote: Hi All What is the state-of-the-practice in type-level programming? I know Günther started this thread about monads, but I seem to remember him having a long running problem with typeful database programming,

[Haskell-cafe] Cabal-install

2010-03-08 Thread Andrew Coppin
OK, so apparently my Google skills are lacking. I can't find anything but the most terse documentation of the cabal-install tool online. Somewhere there surely must be something which explains how to control this thing. Anyway, can anybody tell me how I can change the default settings so that

Re: [Haskell-cafe] Cabal-install

2010-03-08 Thread Peter Robinson
On 8 March 2010 17:51, Andrew Coppin andrewcop...@btinternet.com wrote: Anyway, can anybody tell me how I can change the default settings so that I get profiling libraries built by default, and Haddock documentation built by default? (I'm on Windows, in case that makes a difference...) #

[Haskell-cafe] Num instance for Lazy ByteStrings (was: NumLazyByteString Package License)

2010-03-08 Thread Thomas DuBuisson
Tristan and other interested parties on the Cafe, Answering your question first, Tristan: I was going to use BSD3 (if it isn't already) for the NumLazyByteString. For the cafe too: A while ago I made a Num instance for LPS; it is currently on my code.haskell.org account. Notice this isn't on