Quantcast
Channel: Implementation of null function - Stack Overflow
Browsing index pages (4 articles)

Implementation of null function

I have to learn Haskell for university and therefor I'm using learnyouahaskell.com for the beginning.I always used imperative languages so I decided to practice Haskell by coding a lot more than I...

View Article


Answer by shree.pat18 for Implementation of null function

Because _ literally means anything apart from explicitly specified patterns. When you specify (_:_) it means anything which can be represented as a list containing at least 1 element, without bothering...

View Article


Answer by leftaroundabout for Implementation of null function

You can't just turn the clauses around with your solution:mNull' :: [a] -> BoolmNull' _ = FalsemNull' [] = Truethis will always yield False, even if you pass an empty list. Because the runtime...

View Article

Answer by dfeuer for Implementation of null function

I'll add on to what leftaroundabout said. This is not really a potential concern for the list type, but in general, data types sometimes get modified. If you have an ill-conceiveddata FavoriteFood =...

View Article
Browsing index pages (4 articles)


Latest Images