On Thu, Oct 19, 2006 at 04:03:38PM +0200, Mikael Johansson wrote:
>   isIdentity (PL xs) = all (\(i,j) -> i==j) (zip [1..] xs)
> 
>   isIdentity (PL xs) = xs == [1..(length xs)]

How about a compromise?

    isIdentity (PL xs) = xs == zipWith const [1..] xs

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

Reply via email to