How can this function return true?
foldr (||) False [True,undefined]
=> True
The first fold looks like this:
undefined || True
, which should return an error
So im guessing haskell gives priority to the lazyness of the OR function over doing the folds step by step. Finds a True
on the way and returns that before starting the fold
Is this correct? In that case, does haskell always give priority to a lazy function over the non lazy ones? I believe that is the definition for being lazy but it seems like that can change the answer to make it wrong