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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

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

android - How to create dynamically Fragment pager adapter -