In Functional Programming, is it considered a bad practice to have incomplete pattern matchings

前端 未结 7 1359
梦毁少年i
梦毁少年i 2020-12-09 02:12

Is it generally considered a bad practice to use non-exhaustive pattern machings in functional languages like Haskell or F#, which means that the cases specified don\'t cove

7条回答
  •  不思量自难忘°
    2020-12-09 02:35

    The Haskell prelude (standard functions) contains many partial functions, e.g. head and tail only work on non-empty lists, but don't ask me why.

提交回复
热议问题