How about this:
  import List
  isIdentity (PL xs) =  xs `isPrefixOf` [1..]
?

Best regards,
Henk-Jan van Tuyl


On Fri, 20 Oct 2006 01:01:33 +0200, Tomasz Zielonka <[EMAIL PROTECTED]> wrote:

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



--
Met vriendelijke groet,
Henk-Jan van Tuyl


--
http://Van.Tuyl.eu/
--

Using Opera's revolutionary e-mail client:
https://secure.bmtmicro.com/opera/buy-opera.html?AID=789433

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

Reply via email to