[Haskell-cafe] Empty Input list

Kevin Clees k.clees at web.de
Mon Mar 12 22:14:08 CET 2012


Hey Chris,

thank you for your help! Your last comment with the (!!)-thing was a very good idea! 

Now my function looks like this: 

tmp:: [(Int, Int)] -> Int -> (Int, Int)
tmp [] y = (0,0)
tmp xs y = xs !! (y-1)

If the function returns (0,0) it will blocked by another  function. 
If I want to use the "maybe" return, I get some new trouble that I don't like - so I chose that way :)

Thank you again 
Kevin





More information about the Haskell-Cafe mailing list