Hi guys, i don't get why in the following haskell code: test :: [[Char]] -> [Char] test [a] = a test _ = "yo" when i send: > ["ay", "oy", "ey"] i always get "yo" as an output. i tried looking on stackoverflow but didn't find my answer Q-Q i am quite new and i don't get why it enter in the one with '_'.
Haskell isn't a super-common language. It might be better to look for a forum dedicated to Haskell. I don't know Haskell, so I won't be much help. If anyone can help, it might be useful to include some extra information. What output do you expect, and is what you posted just a snippet? If it's just a snippet, it might be helpful to post the code in its entirety.
I know this is old already but underscore(_) is basically "whatever" in haskell. So you are saying in that line 'if you reached here, then return "yo"' I'm not sure what you wanted to do here. If you are still hanging in it, I could help you
Thank you very much for the offer =P But i did manage to finish this ^^ As usual it was me making a dumb mistake =P But still thanks you very much for the offer, that was quite kind