Re: How to define an operator to show a sequence of polymorphic things
From: Bernd Holzmüller <holzmueller@ics-ag.de> To: Haskell@haskell.org Subject: How to define an operator to show a sequence of polymorphic things Date: Tue, 22 Apr 2003 17:11:34 +0200
Hi all,
I'd like to have a better way for "showing" a list of things, e.g.
show (f1 t) ++ show (f2 t) ++ show (f3 t) ++ ....
I would love to just write: (f1 # f2 # f3) t but I do not see how to define an operator like # in Haskell without applying show over again on the first arguments (i.e. f1 and f2). Because polymorphic lists are not possible, I can not define # as to write [f1,f2,f3] # t either.
Any idea?
Regards, Bernd
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell
x # r = show x ++ r end = "" 1 # True # 'a' # end ==> "1True'a'" _________________________________________________________________ The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
participants (1)
-
Derek Elkins