- •Avoid defining functions by cases on their last argument, use
LambdaCase - •Avoid list indexing (
!!) - •Avoid partial functions (
head,undefined) except in tests - •Instead of nesting
Either,Maybe, and tuples, make a newdatatype - •
LambdaCasenow supports\casesfor multiple arguments - •Never return tuples of arity higher than 2, just make a new
datatype - •Never use
unsafeCoerceorunsafePerformIO - •Only use
Eitherfor error handling, otherwise make a newdatatype - •Use
Data.Text.IOfor I/O
haskell
Haskell 代码编写指南。适用于编写 Haskell 代码时使用。
SKILL.md
--- frontmattername: haskell description: Guides for Haskell code. Use when writing Haskell code.