haskell - Intercalate function giving Non-exhaustive patterns -


i'm trying intercalate 2 lists this:

intercalate [0, 2, 4] [1, 3, 5] [0, 1, 2, 3, 4, 5] 

so created function:

intercalate (x:xs) (y:ys) = x:(y:(intercalate xs ys)) intercalate [] [] = [] 

however error:

 exception: <interactive>:3:5-57: non-exhaustive patterns in function intercalate 

i can't understand why!

a hint should enough here:

you handle case in both lists empty.

you handle case in both lists nonempty.

can think 2 more cases?


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -