Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
turboMaCk committed Sep 24, 2021
1 parent 7a19d3d commit 1c40d6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/Elm/Print/Decoder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,7 @@ recordDecoderDoc ElmRecord{..} =
else recordDecoder
where
isEmptyRecord :: Bool
isEmptyRecord =
null elmRecordFields
isEmptyRecord = null elmRecordFields

emptyRecordDecoder :: Doc ann
emptyRecordDecoder = name <+> "D.succeed {}"
Expand Down
6 changes: 2 additions & 4 deletions src/Elm/Print/Encoder.hs
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ recordEncoderDoc ElmRecord{..} =
else recordEncoder
where
isEmptyRecord :: Bool
isEmptyRecord =
null elmRecordFields
isEmptyRecord = null elmRecordFields

newtypeEncoder :: Doc ann
newtypeEncoder =
Expand All @@ -136,8 +135,7 @@ recordEncoderDoc ElmRecord{..} =
Nothing -> emptyRecordEncoder

emptyRecordEncoder :: Doc ann
emptyRecordEncoder =
leftPart <+> "list (\\_ -> null) []"
emptyRecordEncoder = leftPart <+> "list (\\_ -> null) []"

recordEncoder :: Doc ann
recordEncoder = nest 4
Expand Down

0 comments on commit 1c40d6f

Please sign in to comment.