I see you are learning about Haskell. Congratulations! This isn't an easy language to handle (I'm am myself a learner, but aren't we all?).
I guess in your solution, cases like "ALLIGATOR" and "aLlIgAtOr" won't match the first pattern and will return "wide". But the OP was mentioning that the "alligator" animal was case insensitive.
Haskell
I see you are learning about Haskell. Congratulations! This isn't an easy language to handle (I'm am myself a learner, but aren't we all?).
I guess in your solution, cases like
"ALLIGATOR"
and"aLlIgAtOr"
won't match the first pattern and will return"wide"
. But the OP was mentioning that the"alligator"
animal was case insensitive.So I'm proposing this solution.
I took the opportunity to handle the cases where there was too much spaces (as I did in my TypeScript proposal).
This may not be the final solution, or prone to enhancement, but I guess it is a good one. We can make it better together as a community!