[clean-list] order of parameters of "fwrites"

lethevert acatofearlgrey at ybb.ne.jp
Wed Oct 12 01:56:35 MEST 2005


Hello.

I have a simple question about order of parameters.

In StdEnv Library, these functions are defined.

fwritec		:: !Char !*File -> *File
fwritei		:: !Int !*File -> *File
fwriter		:: !Real !*File -> *File
fwrites		:: !{#Char} !*File -> *File

But why parameters are in this order?

Recently I found it's useful to write like below;

printSomeStringList :: *File [String] -> *File
printSomeStringList f lst
    = foldl (\f s = fwrites s f) f lst

If parameters of "fwrites" are in reverse order, this was written as below;

printSomeStringList :: *File [String] -> *File
printSomeStringList f lst
    = foldl fwrites f lst

Are there any reason why parameters are in this order?

-------------------
lethevert
lethevert at users.sourceforge.net



More information about the clean-list mailing list