Is there any way to separate infinite and finite lists?
For example, I am writing some function for lists and I want to use length function foo :: [a] -> Bool foo xs = length xs == 100 How can someone understand could this function be used with infinite lists or not? Or should I always think about infinite lists and use something like this foo :: [a] -> Bool foo xs = length (take 101 xs) == 100 instead of using length directly? What if haskell would have FiniteList type, so length and foo would be length :: FiniteList a -> Int foo :: FiniteList a -> Bool length traverses the entire list, but to determine if a list has a particular length n you only