KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I’ve created a function in which I can use (as far as I know) case expressions or guards. foo a b c = case a of 1 -> [...] 2 -> [...] 3 -> [...] [...] otherwise -> error "..." or foo a b c | a == 1 = [...] | a == 2 = [...] | a == 3 = [...] | [...] | otherwise = error "..." So, the question is: which of those 2 (case or guards) are “better” coding? Are both basically the same?
Tags (comma-separated)
Save Edits
Cancel