Re: looking for System.Console.Readline example

2003-12-02 Thread sebc
A minor modification to Martin's code gives you laziness: > import System.IO.Unsafe > import System.Console.Readline > > readlines :: String -> IO [String] > readlines prompt = > do input <- readline prompt >case input of >Nothing -> >return [] >

Re: System.Posix (symbolic links)

2003-11-29 Thread sebc
You need to use getSymbolicLinkStatus instead of getFileStatus, which always follows symbolic links (I guess getSymbolicLinkStatus uses the stat system call, while getSymbolicLinkStatus uses lstat). -- Sebastien On Sat, Nov 29, 2003 at 08:24:08PM +0100, Johannes Goetz wrote: > Hi! Sorry for pos

Re: Why are strings linked lists?

2003-11-28 Thread sebc
On Fri, Nov 28, 2003 at 12:37:30PM +0100, Wolfgang Jeltsch wrote: > > > > So, what is happening that there is 1 cell in the heap > > containing the representation of 'a', and then a linked list > > of length 500, where each element points to that cell. > > Yes, you're right. But if you choose

Re: lifting functions to tuples?

2003-11-19 Thread sebc
Again, I think what you propose is different from what was asked. > On 2003-11-18 at 10:46EST "Abraham Egnor" wrote: > > The classic way to write a lift function for tuples is, of course: > > > > liftTup f (a, b) = (f a, f b) > > > > which has a type of (a -> b) -> (a, a) -> (b, b). I've been wo

Re: lifting functions to tuples?

2003-11-19 Thread sebc
On Tue, Nov 18, 2003 at 05:56:19PM -0800, [EMAIL PROTECTED] wrote: > > Abraham Egnor wrote: > > > The classic way to write a lift function for tuples is, of course: > > > liftTup f (a, b) = (f a, f b) > > > which has a type of (a -> b) -> (a, a) -> (b, b). I've been wondering if > > it would b

Re: lifting functions to tuples?

2003-11-18 Thread sebc
On Tue, Nov 18, 2003 at 04:34:43PM +, Jon Fairbairn wrote: > On 2003-11-18 at 10:46EST "Abraham Egnor" wrote: > > The classic way to write a lift function for tuples is, of course: > > > > liftTup f (a, b) = (f a, f b) > > > > which has a type of (a -> b) -> (a, a) -> (b, b). I've been wonde