Re: how to write a simple cat

1999-06-01 Thread Friedrich Dominicus
Hannah Schroeter wrote: > > Hello! > > On Mon, May 31, 1999 at 06:01:31PM +0200, Friedrich Dominicus wrote: > > Hannah Schroeter wrote: > > > > Hello! > > > > On Fri, May 28, 1999 at 08:00:27AM +0200, Friedrich Dominicus wrote: > > > > I wrote before with my trouble understanding hugsIsEOF. Bu

Re: how to write a simple cat

1999-06-01 Thread Hannah Schroeter
Hello! On Tue, Jun 01, 1999 at 06:58:32AM +0200, Friedrich Dominicus wrote: > [...] > I want to do the following, read a file line by line and finding out > which line is longer than x-chars. I want to print out which lines are > so long. I think that can just be done line-wise. > Thanks for yo

Re: how to write a simple cat

1999-06-01 Thread Sven Panne
Hannah Schroeter wrote: > [...] So, still no need to fuzz with file handles :-) ... and no need to fuzz with intermediate names, either. :-) If you define an operator for reversed function composition (.|) = flip (.) and read it like a pipe in *nix, you get a one-liner: longerThan fn len

Re: how to write a simple cat

1999-06-01 Thread Friedrich Dominicus
Hannah Schroeter wrote: > > Hello! > > On Tue, Jun 01, 1999 at 06:58:32AM +0200, Friedrich Dominicus wrote: > > [...] > > > I want to do the following, read a file line by line and finding out > > which line is longer than x-chars. I want to print out which lines are > > so long. I think that c

Re: how to write a simple cat

1999-06-01 Thread S. Alexander Jacobson
It would be nice if the prelude defined more general functions like: > splitStr c s = left:case right of [] -> []; otherwise -> splitStr c (tail right) > where (left,right)=span (/=c) s > joinStr c l = case l of []-> []; otherwise -> foldl1 (\x y->x++c:y) l The implementation of lines and unli

Re: how to write a simple cat

1999-06-01 Thread Sven Panne
Friedrich Dominicus wrote: >[...] How can I combine the output with a line-number can I put that > into the filter? Or do I have to found another solution? Don't fear! Mr. One-Liner comes to the rescue:;-) longerThan fn lenlim = readFile fn >>= lines .| filter (length .| (>lenlim)) .| zip

Re: how to write a simple cat

1999-06-01 Thread Friedrich Dominicus
Sven Panne wrote: > > Friedrich Dominicus wrote: > >[...] How can I combine the output with a line-number can I put that > > into the filter? Or do I have to found another solution? > > Don't fear! Mr. One-Liner comes to the rescue:;-) > >longerThan fn lenlim = readFile fn >>= lines .|

Re: how to write a simple cat

1999-06-01 Thread Kevin Atkinson
Keith Wansbrough wrote: > > Sven Panne wrote: > > > > Don't fear! Mr. One-Liner comes to the rescue:;-) > > > > > >longerThan fn lenlim = readFile fn >>= lines .| filter (length .| (>lenlim)) >.| zip [1..] .| map (\(n,l) -> shows n ") " ++ l) .| unlines .| putStr > > Friedrich wrote: >

Re: how to write a simple cat

1999-06-01 Thread Lars Henrik Mathiesen
> Date: Tue, 01 Jun 1999 17:32:22 +0200 > From: Sven Panne <[EMAIL PROTECTED]> > Don't fear! Mr. One-Liner comes to the rescue:;-) > >longerThan fn lenlim = readFile fn >>= lines .| filter (length .| (>lenlim)) .| >zip [1..] .| map (\(n,l) -> shows n ") " ++ l) .| unlines .| putStr Are

Official release of Hugs 98

1999-06-01 Thread Mark Jones
~c [EMAIL PROTECTED] ~r Readme ~e

Re: how to write a simple cat

1999-06-01 Thread Lennart Augustsson
Keith Wansbrough wrote: > Sven Panne wrote: > > > > Don't fear! Mr. One-Liner comes to the rescue:;-) > > > > > >longerThan fn lenlim = readFile fn >>= lines .| filter (length .| (>lenlim)) >.| zip [1..] .| map (\(n,l) -> shows n ") " ++ l) .| unlines .| putStr > > Friedrich wrote: > > >

Re: how to write a simple cat

1999-06-01 Thread Jan Skibinski
On Tue, 1 Jun 1999, Sven Panne wrote: > Friedrich Dominicus wrote: > >[...] How can I combine the output with a line-number can I put that > > into the filter? Or do I have to found another solution? > > Don't fear! Mr. One-Liner comes to the rescue:;-) How about initiating Haskel

Re: Implementation of Nameable Type Parameters

1999-06-01 Thread Kevin Atkinson
Kevin Atkinson wrote: > > For those of you who may be interested: > > I am working on an implementation of Nameable Type Parameters written in > Haskell. I currently have them working in a so called Mini Haskell > where all kind information is presented explicitly. I had a few > unification pr

Re: how to write a simple cat

1999-06-01 Thread Keith Wansbrough
Sven Panne wrote: > > Don't fear! Mr. One-Liner comes to the rescue:;-) > > > >longerThan fn lenlim = readFile fn >>= lines .| filter (length .| (>lenlim)) .| >zip [1..] .| map (\(n,l) -> shows n ") " ++ l) .| unlines .| putStr Friedrich wrote: > Do you want to drive me away from lear

Announcing Hugs 98

1999-06-01 Thread Mark P Jones
__ __ __ __ ___ _ || || || || || || ||__ Hugs 98: Based on the Haskell 98 Standard ||___|| ||__|| ||__|| __||Copyright (c) 1994-1999 ||---|| ___|| World Wide Web: http://haskell.org/hugs || ||