Hi Jan,

On one hand, I've never really needed this. 
On the other hand, it looks like a nice syntaxic sugar addition, so if you implemented this I would probably give it a try.

David.


2013/4/8 Jan Stolarek <jan.stolarek@p.lodz.pl>
> You can achieve something similar with the ViewPatterns language
> extension.
>
> member _ [] = False
> member x (((x ==) -> True) : _) = True
> member x (_ : xs) = member x xs
Hi Tillmann,

there are a couple of ways to achieve this in Haskell, for example using guards:

member :: Eq a => a -> [a] -> Bool
member _ []             = False
member y (x:_) | x == y = True
member y (_:xs)         = member y xs

The goal of my proposal is to provide a concise syntax, whereas ViewPatterns are very verbose and
guards are slightly verbose. I want something simple and something that is very intuitive if
you've programmed in Prolog :)

Janek

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe