Hi Daniel,
On Fri, 14 Jan 2005 21:57:25 +0100, Daniel Fischer <[EMAIL PROTECTED]> wrote:
<snip>
Finally, in several contexts I needed to cons an element to one of a pair of lists, so I defined
infixr 5 &,�
^^^ Please be aware that you won't find this paragraph symbol on a uk or us keyboard. AFAIK it is just on the german one.
(&) :: a -> ([a],[b]) -> ([a],[b]) x & (xs,ys) = (x:xs,ys)
(�) :: b -> ([a],[b]) -> ([a],[b]) y � (xs,ys) = (xs,y:ys).
I find them useful (though I don't like the symbols, if you have any better ideas, thx) and for splitAt, (&) saves another reduction per step.
I think these operators should be more related to ":" like ":&" "&:" or similar. However, in my opinion this special cons operators could be just functions with a meaningful name like "consfst" and "conssnd". It would provide much more readability.
Cheers,
Georg--
---- Georg Martius, Tel: (+49 34297) 89434 ---- ------- http://www.flexman.homeip.net --------- _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
