null instead of ==

后端 未结 3 1870
自闭症患者
自闭症患者 2021-02-05 01:31

I have just started to learn Haskell out of interest. I follow learnyouahaskell.com.

There I found this:

null checks if a list is emp

3条回答
  •  自闭症患者
    2021-02-05 02:18

    Another benefit to using null is that many other containers (e.g. Data.Sequence, Data.ByteString, etc.) have a null function as well. This makes it easy to switch to another implementation simply by changing your import statements.

提交回复
热议问题