2 Fix parenthesis spacing and type in the code segment
source | link

Use pointless  ( oror -free) notation where appropriate

Often a function with one or two parameters can be written point free.

So a lookup for a list of tuples whose elements are swapped is naïvely written as:

revlookup :: Eq b => b -> [(a, b)] -> Maybe a
revlookup e l=lookup e(map swap l)

(the type is there just to help you understand what it's doing.)

for our purposes this is much better:

revlookup=(.map swap).lookup

Use pointless( or -free) notation where appropriate

Often a function with one or two parameters can be written point free.

So a lookup for a list of tuples whose elements are swapped is naïvely written as:

revlookup :: Eq b -> [(a, b)] -> a
revlookup e l=lookup e(map swap l)

(the type is there just to help you understand what it's doing.)

for our purposes this is much better:

revlookup=(.map swap).lookup

Use pointless  (or -free) notation where appropriate

Often a function with one or two parameters can be written point free.

So a lookup for a list of tuples whose elements are swapped is naïvely written as:

revlookup :: Eq b => b -> [(a, b)] -> Maybe a
revlookup e l=lookup e(map swap l)

(the type is there just to help you understand what it's doing.)

for our purposes this is much better:

revlookup=(.map swap).lookup
    Mod Removes Wiki by Doorknob
1
source | link

Use pointless( or -free) notation where appropriate

Often a function with one or two parameters can be written point free.

So a lookup for a list of tuples whose elements are swapped is naïvely written as:

revlookup :: Eq b -> [(a, b)] -> a
revlookup e l=lookup e(map swap l)

(the type is there just to help you understand what it's doing.)

for our purposes this is much better:

revlookup=(.map swap).lookup