Improve some Foldable methods for NonEmpty
authorDavid Feuer <david.feuer@gmail.com>
Mon, 14 May 2018 03:26:08 +0000 (23:26 -0400)
committerBen Gamari <ben@smart-cactus.org>
Mon, 14 May 2018 03:26:14 +0000 (23:26 -0400)
commitb7139869c3c42c778fa9eb90058439323f548ec2
treea9abe5e2a1fab604e880d0f0f1ed8d633ae988dd
parentca3d3039386b145ae2835ca563b4c5a3497c25c9
Improve some Foldable methods for NonEmpty

* `length` is improved by using the default definition,
  while `foldr1` is improved by using a custom one.

* Several methods had useless lazy pattern matches
  (i.e., the functions were actually strict in those arguments).
  Remove `~`s to clarify.

Reviewers: hvr, bgamari, mpickering, nomeata

Reviewed By: bgamari

Subscribers: ygale, rwbarton, thomie, carter

GHC Trac Issues: #15131

Differential Revision: https://phabricator.haskell.org/D4677
libraries/base/Data/Foldable.hs