agreeing: Idiomatic data structure for agreement

This is a package candidate release! Here you can preview how this package release will appear once published to the main package index (which can be accomplished via the 'maintain' link below). Please note that once a package has been published to the main package index it cannot be undone! Please consult the package uploading documentation for more information.

[maintain] [Publish]

Please see the README on GitHub at

[Skip to Readme]


Change log
Dependencies base (>=4.7 && <5) [details]
License BSD-3-Clause
Copyright 2023 James Cranch
Author James Cranch
Category Data
Home page
Bug tracker
Source repo head: git clone
Uploaded by jcranch at 2023-11-06T00:35:45Z



Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Readme for agreeing-

[back to package description]


A simple data structure helping us ask questions of the following sort: "does all this data have the same /BLANK/ and if so what is it?"

For example:

    doTheseHaveTheSameLength :: [String] -> String
    doTheseHaveTheSameLength l = case foldMap (Somebody . length) of
      Somebody n -> "They all have length " <> show n
      Nobody     -> "The lengths differ"
      Anybody    -> "You didn't give me any strings"

This can of course be done with Maybe (Maybe x) instead, but doing so runs the risk of getting confused: which is Nothing and which is Just Nothing?