Good Haskell coding style of if/else control block?

后端 未结 8 1547
慢半拍i
慢半拍i 2021-01-31 09:15

I\'m learning Haskell in the hope that it will help me get closer to functional programming. Previously, I\'ve mostly used languages with C-like syntax, like C, Java, and D.

8条回答
  •  孤街浪徒
    2021-01-31 09:27

    You can also use explicit grouping with curly braces. See the layout section of http://www.haskell.org/tutorial/patterns.html

    I wouldn't recommend that though. I've never seen anyone use explicit grouping besides in a few special cases. I usually look at the Standard Prelude code for examples of style.

提交回复
热议问题