For example, I have the following entry
data Rec = Rec
{ _a :: Int
, _b :: Int
, _c :: Int
} deriving (Show, Eq)
makeLenses ''Rec
and I see only 2 ways to build new values:
Rec{_a=1,_b=2,_c=3}Rec 1 2 3
The second option doesn’t look very good if the number of record fields is more than a couple, and the underscores do not look natural in the first.
Are there other ways to create record values?
source
share