Commit 7bd8ce44 authored by Petr Pudlak's avatar Petr Pudlak Committed by Jose A. Lopes
Browse files

Improve the point-free section of the style guide

Distinguish declaring functions in the point-free style and using
a very similar technique to avoid parentheses (which isn't technically
Signed-off-by: default avatarPetr Pudlak <>
Reviewed-by: default avatarKlaus Aehlig <>
parent a41a1eec
......@@ -467,14 +467,25 @@ Similarly, provide Haddock-style comments for top-level definitions.
Parentheses, point free style
Prefer the so-called point-free style to extra parentheses::
Prefer the so-called `point-free`_ style style when declaring functions, if
-- bad
let a = f ( g ( h x) )
let a x = f (g (h x))
-- good
let a = f . g . h
Also use function composition in a similar manner in expressions to avoid extra
-- bad
f (g (h x))
-- better
let b = f $ g $ h x
f $ g $ h x
-- best
let c = f . g . h $ x
f . g . h $ x
.. _`point-free`:
Language features
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment