BSD3 licensed by Edward A. Kmett
Maintained by Edward A. Kmett

Module documentation for 0.18.2

semigroups

Hackage Build Status

Haskellers are usually familiar with monoids. A monoid has an appending operation <> or mappend and an identity element mempty. A Semigroup has an append <>, but does not require an mempty element. A Monoid can be made a Semigroup with just instance Semigroup MyMonoid

More formally, a semigroup is an algebraic structure consisting of a set together with an associative binary operation. A semigroup generalizes a monoid in that there might not exist an identity element. It also (originally) generalized a group (a monoid with all inverses) to a type where every element did not have to have an inverse, thus the name semigroup.

Semigroups appear all over the place, except in the Haskell Prelude, so they are packaged here.

Contact Information

Contributions and bug reports are welcome!

Please feel free to contact me through github or on the #haskell IRC channel on irc.freenode.net.

-Edward Kmett

Changes

0.18.3

  • Add Semigroup instance for IO, as well as for Event and Lifetime from GHC.Event
  • Add Eq1, Ord1, Read1, and Show1 instances for NonEmpty
  • Define Generic and Generic1 instances back to GHC 7.2, and expose the Data.Semigroup.Generic module on GHC 7.2

0.18.2

  • Depend on the bytestring-builder package to ensure Semigroup instances for bytestring Builder and ShortByteString are always defined
  • Allow building with binary-0.8.3 and later

0.18.1

  • Add the missing instance for Data.Binary.Builder.Builder.

0.18.0.1

  • Added support for base-4.9

0.18

  • Removed the partial functions words, unwords, lines, unlines

0.17.0.1

  • Fixed the @since annotations

0.17

  • Added groupWith, groupAllWith, groupWith1, groupAllWith1
  • Renamed sortOn to sortWith to match the "Comprehensive comprehensions" paper and TransformListComp extension.
  • Add Semigroup instances for Alt, Void, Proxy and Tagged
  • Add Num instances for Min and Max
  • Removed times1p in favor of stimes.

0.16.2.2

  • Cleaned up imports to remove warnings on GHC 7.10.

0.16.2.1

  • Restored the ability to build on GHC < 7.6. (Generic1 deriving was only added in GHC 7.6)

0.16.2

  • Added genericMappend and supporting GSemigroup class for generically deriving Semigroup instances.
  • Added Arg a b which only compares for equality/order on its first argument, which can be used to compute argmin and argmax.
  • Add Bifunctor Arg instance to avoid orphans for GHC 7.10+.
  • Added missing Data.Monoid.Generic module to source control.

0.16.1

  • Added Semigroup instances for various Builder constructions in text and bytestring where available.
  • Added MonadFix and MonadPlus instances for NonEmpty.

0.16.0.1

  • Bumped deepseq version bound for GHC 7.10 compatibility.

0.16

  • times1p and timesN are now reduced to accepting only a Natural argument. Whole doesn't exist in GHC 7.10's Numeric.Natural, and nats version 1 has removed support for the class.

0.15.4

  • Use Data.Coerce.coerce on GHC 7.8+ to reduce the number of eta-expansions in the resulting core.
  • Avoid conflict with pending Foldable.length in base.

0.15.3

  • instance NFData a => NFData (NonEmpty a)
  • Added NFData instances for the types in Data.Semigroup

0.15.2

  • Fixed a Trustworthiness problem for GHC 7.8+

0.15.1

  • Nathan van Doorn fixed a number of embarassing bugs in the Enum instances.

0.15

  • instance IsList NonEmpty

0.14

  • Allow for manual removal of dependencies to support advanced sandbox users who explicitly want to avoid compiling certain dependencies they know they aren't using.

    We will fix bugs caused by any combination of these package flags, but the API of the package should be considered the default build configuration with all of the package dependency flags enabled.

  • Will now build as full-fledged Safe Haskell if you configure with -f-hashable.

  • Added some missing Generic/Generic/Hashable instances

0.13.0.1

  • Generic support requires ghc-prim on GHC 7.4.

0.13

  • Added instances for 'Generic', 'Foldable', 'Traversable', 'Enum', 'Functor', 'Hashable', 'Applicative', 'Monad' and 'MonadFix'

0.12.2

  • Vastly widened the dependency bound on text and bytestring.

0.12.1

  • Updated to support the new version of text.
  • Added transpose, sortBy and sortWith.

0.12

  • Added an instance for Const r.
  • Added some1

0.11

  • Added the missing instance for HashSet.

0.10

  • Added support for unordered-containers, bytestring and text.

0.9.2

  • Added a DefaultSignature for (<>) in terms of mappend.

0.9.1

  • Added timesN.

0.9

  • Moved Numeric.Natural to a separate nats package.
Used by 399 packages:
Agda, DSH, FormalGrammars, GenussFold, Glob, GrammarProducts, LATS, OpenSCAD, SimpleLog, Validation, abcnotation, accuerr, acid-state-dist, active, adjunctions, aeson, aeson-compat, airbrake, alga, algebra, algebraic-prelude, amazonka-core, amazonka-s3-streaming, ansi-pretty, approximate, arena, arithmoi, attoparsec, auto, autonix-deps, average, axiomatic-classes, b9, backtracking-exceptions, beam, bet, bifunctors, binary-orphans, binary-tagged, bitcoin-payment-channel, bloodhound, boolean-like, boombox, both, buchhaltung, bytestring-strict-builder, bytestring-tree-builder, caramia, carte, case-insensitive, cassava, category-extras, charset, chunked-data, clafer, classy-prelude, colorful-monoids, colour-space, commodities, commutative, comonad, compensated, compressed, computational-algebra, conceit, concurrent-machines, conduit-find, configurator-export, console-style, contravariant, control-invariants, copr, cql-io, credentials, cron, cue-sheet, data-check, data-filepath, data-nat, data-serializer, dejafu, dependent-map, diagrams-contrib, diagrams-core, diagrams-lib, diagrams-pdf, diagrams-postscript, diagrams-svg, digit, directory-layout, discrimination, distributive, diversity, dlist-instances, dlist-nonempty, dom-parser, dpor, dsh-sql, dual-tree, dustme, dynamic-plot, dynamodb-simple, dynobud, ec2-unikernel, ede, either, enumerate-function, enummapmap, event, eventstore, extensible, find-conduit, flac, flowdock-rest, foldl-statistics, foldl-transduce, folds, forest, foscam-filename, fpco-api, fraction, free, fswait, geojson, ghc-mod, giak, github, gitlib, gore-and-ash, grapefruit-frp, hOpenPGP, halma-telegram-bot, haskell-time-range, haskell-token-utils, haskellscrabble, haskoin-wallet, hasql, hbro, hedgehog, hermit, hgeometry, hierarchy, hjsonpointer, hjsonschema, hledger-lib, hmm-hmatrix, hnix, hpp, hspec-megaparsec, hwsl2-reducers, hydra-print, hyperloglog, hyperloglogplus, identicon, imprevu, insert-ordered-containers, intro, invariant, javaclass, jose, json-bytes-builder, json-encoder, jwt, karps, katip, keys, kmeans-par, lambdacube-compiler, lame-tester, language-conf, language-hcl, language-lua2, language-puppet, language-thrift, latex-function-tables, lattices, ldap-client, lens, lens-action, lentil, lgtk, liblastfm, liblawless, libmolude, lilypond, linear, linearmap-category, liquid, list-tries, log-base, log-domain, log-elasticsearch, log-postgres, logging-effect, lucid, luminance, machinecell, machines, magma, manifold-random, manifolds, marquise, means, meep, megaparsec, microstache, mida, milena, minilens, minlen, misfortune, modify-fasta, modulo, mono-traversable, mono-traversable-instances, monoid-extras, monoidplus, ms, music-articulation, music-dynamics, music-dynamics-literal, music-parts, music-pitch, music-pitch-literal, music-preludes, music-score, music-sibelius, musicxml2, natural-transformation, nested-routes, netwire, network-transport-zeromq, non-empty-sequence, nonempty-alternative, notzero, opaleye, opaleye-sqlite, opml-conduit, optparse-applicative, optparse-generic, pagination, papa-include, papa-prelude-semigroups, pasta, pcre-heavy, penny, penny-bin, penny-lib, pinchot, pipes-files, pipes-fluid, pipes-key-value-csv, pipes-misc, pipes-zeromq4, plan-b, plots, pointed, pointedalternative, polyvariadic, positive, postgresql-query, praglude, pred-trie, prettify, prettyprinter, prettyprinter-ansi-terminal, printcess, prof2pretty, pseudo-trie, psi, purescript, quickcheck-instances, ralist, range-set-list, range-space, rebase, recursion-schemes, redis-io, redis-resp, reducers, reflex, reflex-animation, reflex-dom, reflex-dom-colonnade, reflex-gloss-scene, reflex-transformers, representable-functors, representable-tries, req, rest-gen, riak, rose-trees, roundRobin, route-planning, s-expression, safecopy, scrape-changes, semigroupoids, semigroupoids-syntax, semigroups-actions, separated, serialize-instances, serokell-util, servant, servant-client, servant-docs, servant-ede, servant-static-th, sets, sexp-grammar, shell-conduit, simple-conduit, solr, sparser, spiros, stache, stack, stackage-curator, stackage-types, staversion, steeloverseer, stgi, store, streams, strelka, strelka-core, strict-base, structures, subhask, sunroof-compiler, sunroof-examples, sunroof-server, swish, sys-process, system-util, tagsoup-megaparsec, tdigest, tdigest-Chart, tensorflow, tensorflow-opgen, text-builder, text-ldap, text-printer, text-short, text-show, text-show-instances, text1, these, tickle, time-warp, tldr, total-maps, toysolver, transf, treemap, tries, trifecta, tubes, turtle, typerbole, uniform-pair, validate-input, validation, vector, vector-builder, vector-instances, wahsp, wai-middleware-static, webcrank, wl-pprint-annotated, wl-pprint-ansiterm, wl-pprint-extras, wl-pprint-terminfo, wordexp, workflow-pure, wybor, xcffib, xhtml, xml-conduit-decode, xml-isogen, yaml, yesod, yesod-auth-ldap-native, yesod-core, yesod-csp, yesod-form, yesod-platform, yesod-table, yi-core, yi-keymap-emacs, yi-keymap-vim, yi-misc-modes, yoko, zero, zeromq3-haskell, zeromq4-conduit, zeromq4-haskell, zip, zmqat
comments powered byDisqus