empty

Returns the identity object for a monoid.

Signature

empty(monoid)
forall M, a:
  (M) => M a
where M is Monoid

Documentation

Returns the identity object for a monoid.

Properties

Convenience

curried()

Returns the identity object for a monoid.

infix()

Returns the identity object for a monoid.

Experimental

Source Code

Defined in source/fantasy-land/empty.js at line 33, column 0
(monoid) =>
  isNew(monoid)     ?  monoid[flEmpty]()
: isCtorNew(monoid) ?  monoid.constructor[flEmpty]()
: isOld(monoid)     ?  warn(monoid.empty())
: isCtorOld(monoid) ?  warn(monoid.constructor.empty())
: /*otherwise*/        unsupported(monoid)
Stability
stable
Licence
MIT
Module
folktale/fantasy-land/empty
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • @boris-marinov
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)