Ticket #3640: BadPun.hs

File BadPun.hs, 204 bytes (added by cjs, 4 years ago)

Demonstration of bad puns in where clauses.

Line 
1{-# LANGUAGE NamedFieldPuns #-}
2
3data Record = Record { f1, f2, f3 :: Int }
4
5goodPun Record{f1,f2,f3} = f1 + f2 + f3
6
7badPun record = f1 + f2 + f3
8    where Record{f1=f1,f2,f3} = record
9
10main = return ()