On 9/24/07, skaller <[EMAIL PROTECTED]> wrote:
> One way to resolve this might be:
>
>         (name="lpsrc/flx_fred.ipk") . foreach println;
>         (s="a\nb\nc") . foreach println;
>
> i.e. use records .. which suggests 'filename' might be a
> better parameter name than 'name' .. this doesn't work right
> now so I'll fix it..

That's not really that great either. The chance of conflicts with
using records just makes the problem less likely to occur, but they'll
still happen.

I'm not really crazy about my idea either, to be honest. It seems
hacky. After some thought, I think really want is that it can be more
clear to write things left-to-right, which ruby does:

IO.open('foo').sort().each { |line|
 puts line
}

Isn't this kind of monadic? Do I understand monads enough that you
could define a combinator to do this?

File::open 'foo' >>= File::getlines >>= List::sort >>=
List::iter[string] (fun (line:string) =>
 println line;
);

-e

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to