by grumpyprole · 6y ago · 0 comments
It looks like the "record dot" follows the same parsing rules as the "module dot": the presence of whitespace turns the . into function composition.
import Data.Set (fromList)
import qualified Data.Set as Set
data Set a = Set (Set.Set a)
f :: Ord a => [a] -> Set a
f = Set . fromList
g :: Ord a => [a] -> Set a
g = Set .fromList
h :: Ord a => [a] -> Set a
h = Set. fromList
i :: Ord a => [a] -> Set.Set a
i = Set.fromList
In other words, the . is interpreted as a "module dot" if and only if there is no whitespace either preceding or following the dot.