[Haskell-cafe] Defining new operators

rodrigo.bonifacio rodrigo.bonifacio at uol.com.br
Wed Aug 8 14:14:43 EDT 2007


I have created the following function:

dist :: String -> [[String]] -> [[String]]
dist x  y = [ x:e | e<-y ]


dist "1M" [[], ["2M"], ["2M, 3M"]] = [["1M"],["1M","2M"],["1M","2M, 3M"]]

How can I create an operator that perform the same function as dist? I want to write something like: 

"1M" ++ [[], ["2M"], ["2M", "3M"]]

Thanks in advance.


More information about the Haskell-Cafe mailing list