
Purescript coding standard
newtype instead of type where possible
type is a type synonym, which is a weak form of newtypenewtype is a strong form of type that allows for more type safetynewtype over data for single-variant types
data is designed for multi-variant typesdata introduces a runtime overhead of boxing and unboxingdo only in monadic context, use where or let otherwise
do in non-monadic context is misleading and confusingstatestconst x\_ -> x(_ + 1)\x -> x + 1f gf (\value -> g value)import Foo.Bar as Foo.Barimport Foo.Bar, because it pollutes the namespace with all symbols exported by Foo.Bar
Prelude is implicitly imported, so it is not necessary to qualify its symbolsimport Foo.Bar (baz), because it pollutes the namespace with baz, which still may not be universally uniqueimport Foo.Bar as FB, because it introduces cognitive overhead on the reader
Foo.Bar.bazbazBar.bazFB.baz