Re: [Haskell-cafe] Re: HS-Plugins 1.0 chokes on simple test, WinXP GHC-6.6
I'm running cygwin on WinXP and got a different failure (below) from the latest darcs hs-plugins. Line 11 is right after the TOP definition. Does anyone have a theory about what's going on here? - Conal looks like the TOP and GHC_LIB_PATH values are the output of external commands, such as ghc --print-libdir, and someone forgot to remove the linefeeds from the output before inserting it in the script? claus configure:1954: gccconftest.c 5 conftest.c:11: error: missing terminating character conftest.c:14: error: missing terminating character configure:1957: $? = 1 configure: failed program was: | /* confdefs.h. */ | | #define PACKAGE_NAME | #define PACKAGE_TARNAME | #define PACKAGE_VERSION | #define PACKAGE_STRING | #define PACKAGE_BUGREPORT | #define CYGWIN 1 | #define LEADING_UNDERSCORE 1 | #define TOP c:\\Haskell\\hs-plugins | #define WITH_GHC ghc | #define GHC_LIB_PATH c:/ghc/ghc-6.6 | /* end confdefs.h. */ | | int | main () | { | | ; | return 0; | } configure:1996: error: C compiler cannot create executables On 3/9/07, Alistair Bayley [EMAIL PROTECTED] wrote: You managed to build the darcs version under ghc 6.6? For me runghc setup.hs configure fails with lots of strange error messages... (below) other packages build ok. Rene. C:\repos\hs-pluginsdarcs pull plink: unknown option -O Pulling from http://www.cse.unsw.edu.au/~dons/code/hs-plugins;... No remote changes to pull in! C:\repos\hs-pluginsrunghc Setup.lhs configure I used an MSYS shell on Windows. It doesn't build with ghc/cabal on a basic windows box - you need some sort of Unix clone. Looks like you're using cygwin, I think ('cause you still have paths starting with C:\). Alistair ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] System.FilePath Re[2]: ANN: HSH 1.2.0
-- i've added crossposts to John Meacham and Einar Karttunen because -- you also denoted interest in new i/o library Hello Neil, Friday, March 9, 2007, 9:12:31 PM, you wrote: I note that the deadline for discussion of System.FilePath has now passed (well, a long time ago :-), so it looks like it's going into base. Any final objections before we do this? The deadline passed before Christmas, and no one objected. I still intend to move it in to base, may be it is a good time to start File library? i has some ideas for it, and also want to propose it as SoC project. just a couple of ideas: - ghc rts independent i/o lib - portable async i/o which is able to work via select/epoll/... - support for unicode filenames - String/ByteString/UTF8String as filename - filepath operations (your module) - filesystem operations (System.Directory) - support for large files (4gb) on windows - bytestring i/o - interfacing with Streams and FPS libraries there are LOTS of things that need to be implemented in order to make modern i/o library. your module seem as a first building block. we can't make all these things inside Base lib because upgradability problems will hit us all the way. so i propose to make File library consisting of your sole module and start to wait contributions :) if someone will need just the interface you already implemented, he can request File-0.1 version - it will be again impossible if you will integrate your library in the Base as i many times said, Base is the dead end for any code, so it should contain only things that will be not changed in next 5 years. i know how your code may be changed in near future - by adding ByteString support. moreover, i propose to split base library without losing backward compatibility just by creating new libs that will contain essentially the same code. i propose to start new i/o lib with your module Regarding canonicalizePath, I'd be perfectly happy to change its name and/or somehow make it more easily discoverable: does anyone want to make a proposal? I recommend either changing the name to unportableGHCCanonicalizePath or implementing it for Hugs ;) I can't think of a good name, FilePath originally called it makePathAbsolute, i like this name. it denotes action and that is right because it works in IO monad, not a pure function. and it makes clear that it does, while canonical may mean everything, just like shuffle or change'a'bit -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Church Encoding Function
Hi, some more ideas following from the last post. I noticed how the function Data.Maybe.maybe converts a Haskell Maybe into a Church encoded Maybe. Also, the if construct, interpreted as a function, converts a Bool into a church encoded Bool. If lists are encoded as forall b. (a - b - b) - b - b, then foldr, with the right order of arguments, converts a haskell [] to a Church encoded List. Is there a name for these functions? “Characteristic Church Encoding Functions” maybe? Are there more than these: Maybe -- maybe Bool -- ifthenelse List -- foldr (,) -- uncurry Just a short idea while waiting at the airport... Greetings, Joachim -- Joachim nomeata Breitner mail: [EMAIL PROTECTED] | ICQ# 74513189 | GPG-Key: 4743206C JID: [EMAIL PROTECTED] | http://www.joachim-breitner.de/ Debian Developer: [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Simple benchmark of list operations?
Hello haskell-cafe, Page http://community.livejournal.com/ru_lambda/44716.html contains three very simple but long-working benchmark functions: dummy :: [Int] - [Int] dummy [] = [] dummy (x:xs) = x:dummy (dummy xs) dummy2 :: [Int] - [Int] dummy2 = dum [] where dum w [] = w dum w (x:xs) = dum (w++[x]) (dummy2 xs) dummy3 :: [Int] - [Int] dummy3 = dum [] where dum w [] = reverse w dum w (x:xs) = dum (x:w) (dummy3 xs) *Main dummy [1..21] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] (16.97 secs, 157120860 bytes) *Main dummy2 [1..21] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] (2.42 secs, 151470452 bytes) *Main dummy3 [1..21] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] (1.78 secs, 84642856 bytes) *Main Is it interesting for testing haskell compilers? -- Best regards, Bulat mailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re[2]: [Haskell-cafe] idea for avoiding temporaries
Hello Claus, Saturday, March 10, 2007, 4:36:22 AM, you wrote: ah, ok, i'm not used to thinking in such scales;-) (perhaps you should get in touch with those SAC people, after all - i don't know what their state of play is, but many years ago, they started in an office near mine, and they were definitely thinking about large arrays, even about how to distribute them, and computations on them; last days i learned details of google's MapReduce system. seems that this approach is very interesting for dealing with large arrays. files (arrays) are splitted into chunks, operations are splitted into chunks, too. afaik, some C compilers are already able to automatically split vector operations into several threads? at least, it will be interesting to implement same technique for GHC, may be just in form of library, like google does -- Best regards, Bulatmailto:[EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Church Encoding Function
On Sat, Mar 10, 2007 at 03:43:41PM +0100, Joachim Breitner wrote: Hi, some more ideas following from the last post. I noticed how the function Data.Maybe.maybe converts a Haskell Maybe into a Church encoded Maybe. Also, the if construct, interpreted as a function, converts a Bool into a church encoded Bool. If lists are encoded as forall b. (a - b - b) - b - b, then foldr, with the right order of arguments, converts a haskell [] to a Church encoded List. Is there a name for these functions? ???Characteristic Church Encoding Functions??? maybe? Are there more than these: I usually hear deconstructor. either :: Either a b - (a - r) - (b - r) - r Maybe -- maybe Bool -- ifthenelse List -- foldr (,) -- uncurry Just a short idea while waiting at the airport... Greetings, Joachim -- Joachim nomeata Breitner mail: [EMAIL PROTECTED] | ICQ# 74513189 | GPG-Key: 4743206C JID: [EMAIL PROTECTED] | http://www.joachim-breitner.de/ Debian Developer: [EMAIL PROTECTED] ___ 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] Church Encoding Function
On Saturday 10 March 2007 09:43, Joachim Breitner wrote: Hi, some more ideas following from the last post. I noticed how the function Data.Maybe.maybe converts a Haskell Maybe into a Church encoded Maybe. Also, the if construct, interpreted as a function, converts a Bool into a church encoded Bool. If lists are encoded as forall b. (a - b - b) - b - b, then foldr, with the right order of arguments, converts a haskell [] to a Church encoded List. Is there a name for these functions? “Characteristic Church Encoding Functions” maybe? Are there more than these: I believe these are the same as catamorphisms. http://en.wikipedia.org/wiki/Catamorphism Here is the paper where the term (AFAIK) was coined (although I have to admit to having only skimmed it): http://citeseer.ist.psu.edu/meijer91functional.html I'm pretty sure you can define a catamorphism for any regular algebraic data type. I'm not 100% sure what the story is for non-regular (AKA nested) datatypes. Maybe -- maybe Bool -- ifthenelse List -- foldr (,) -- uncurry Just a short idea while waiting at the airport... Greetings, Joachim ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Church Encoding Function
On Sat, Mar 10, 2007 at 03:43:41PM +0100, Joachim Breitner wrote: Hi, some more ideas following from the last post. I noticed how the function Data.Maybe.maybe converts a Haskell Maybe into a Church encoded Maybe. Also, the if construct, interpreted as a function, converts a Bool into a church encoded Bool. If lists are encoded as forall b. (a - b - b) - b - b, then foldr, with the right order of arguments, converts a haskell [] to a Church encoded List. Is there a name for these functions? folds (with the arguments flipped) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] System.FilePath Re[2]: ANN: HSH 1.2.0
Bulat Ziganshin wrote: -- i've added crossposts to John Meacham and Einar Karttunen because -- you also denoted interest in new i/o library Me, too :-) just a couple of ideas: - portable async i/o which is able to work via select/epoll/... I think you mean non-blocking I/O here, right? Async is not the same thing. - interfacing with Streams and FPS libraries It should also integrate cleanly with the network stack, which needs an overhaul about as badly as the I/O library. Einar Karttunen maintains his network-alt library at http://www.cs.helsinki.fi/u/ekarttun/network-alt/ which I think is a good starting point. b ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Church Encoding Function
On 10/03/07, Joachim Breitner [EMAIL PROTECTED] wrote: Is there a name for these functions? Characteristic Church Encoding Functions maybe? Are there more than these: Catamorphisms is indeed the name I've heard. -- -David House, [EMAIL PROTECTED] ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: literate Haskell newbie question
cat foo.lhs | grep -e ^ | sed s/^ // Running for the Useless Use of cat Award? A simpler version would be: sed -n -e 's/^//p foo.lhs I don't guarantee that this will work correctly, tho. Maybe sed -n -e 's/^ //p foo.lhs will work better? This said, the OP talked about TeX, so presumably he uses the other format, so maybe a better sed would be: sed -n -e '/^\\begin{code}/,/\\end{code}/{/^\\begin{code}/d;/^\\end{code}/d;p}' foo.lhs -- Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Church Encoding Function
I'm pretty sure you can define a catamorphism for any regular algebraic data type. Actually, so-called negative occurrences in (regular) data types cause problems. Try to define the catamorphism of data Exp = Num Int | Lam (Exp - Exp) | App Exp Exp to see the problem, Stefan ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Program Command Line Arguments
My apologies if this is a question with a trivial answer. Command line args in C are accessed via argc and argv[] defined as arguments to main();. How are command line arguments to a ghc-compiled program accessed in Haskell? Or is that even possible? Thanks. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] idea for avoiding temporaries
bulat.ziganshin: Hello Claus, Saturday, March 10, 2007, 4:36:22 AM, you wrote: ah, ok, i'm not used to thinking in such scales;-) (perhaps you should get in touch with those SAC people, after all - i don't know what their state of play is, but many years ago, they started in an office near mine, and they were definitely thinking about large arrays, even about how to distribute them, and computations on them; last days i learned details of google's MapReduce system. seems that this approach is very interesting for dealing with large arrays. files (arrays) are splitted into chunks, operations are splitted into chunks, too. afaik, some C compilers are already able to automatically split vector operations into several threads? at least, it will be interesting to implement same technique for GHC, may be just in form of library, like google does See the data parallel arrays library: http://haskell.org/haskellwiki/GHC/Data_Parallel_Haskell -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Program Command Line Arguments
On Mar 10, 2007, at 20:46 , [EMAIL PROTECTED], [EMAIL PROTECTED] wrote: My apologies if this is a question with a trivial answer. Command line args in C are accessed via argc and argv[] defined as arguments to main();. How are command line arguments to a ghc-compiled program accessed in Haskell? Or is that even possible? Take a look at the System.Environment module. -- brandon s. allbery[linux,solaris,freebsd,perl] [EMAIL PROTECTED] system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED] electrical and computer engineering, carnegie mellon universityKF8NH ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: [Haskell-cafe] Program Command Line Arguments
Dave: My apologies if this is a question with a trivial answer. Command line args in C are accessed via argc and argv[] defined as arguments to main();. How are command line arguments to a ghc-compiled program accessed in Haskell? Or is that even possible? Simplest: System.Environment:getArgs import System.Environment main = do args - getArgs print args http://haskell.org/ghc/docs/latest/html/libraries/base/System-Environment.html Complex: System.Console.GetOpt Example here: http://cgi.cse.unsw.edu.au/~dons/blog/2006/12/18#ph-3 http://haskell.org/ghc/docs/latest/html/libraries/base/System-Console-GetOpt.html You can find these functions yourself with hoogle: http://haskell.org/hoogle/ Searching for 'args' returns: System. getArgs :: IO [String] Cheers, Don P.S. This question is best asked on #haskell possibly (http://haskell.org/haskellwiki/IRC_channel) ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
[Haskell-cafe] Re: Simple benchmark of list operations?
bulat.ziganshin: Hello haskell-cafe, Page http://community.livejournal.com/ru_lambda/44716.html contains three very simple but long-working benchmark functions: dummy :: [Int] - [Int] dummy [] = [] dummy (x:xs) = x:dummy (dummy xs) dummy2 :: [Int] - [Int] dummy2 = dum [] where dum w [] = w dum w (x:xs) = dum (w++[x]) (dummy2 xs) dummy3 :: [Int] - [Int] dummy3 = dum [] where dum w [] = reverse w dum w (x:xs) = dum (x:w) (dummy3 xs) *Main dummy [1..21] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] (16.97 secs, 157120860 bytes) *Main dummy2 [1..21] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] (2.42 secs, 151470452 bytes) *Main dummy3 [1..21] [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21] (1.78 secs, 84642856 bytes) *Main Is it interesting for testing haskell compilers? Nice, I've added this to 'nobench': http://www.cse.unsw.edu.au/~dons/code/nobench/imaginary/ru_list You can see what the different compilers do to it here: http://www.cse.unsw.edu.au/~dons/nobench/i686/results.html -- Don ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe