1Erlware Commons 2=============== 3 4Current Status 5-------------- 6 7![Tests](https://github.com/erlware/erlware_commons/workflows/EUnit/badge.svg) 8 9Introduction 10------------ 11 12Erlware commons can best be described as an extension to the stdlib 13application that is distributed with Erlang. These are things that we 14at Erlware have found useful for production applications but are not 15included with the distribution. We hope that as things in this library 16prove themselves useful, they will make their way into the main Erlang 17distribution. However, whether they do or not, we hope that this 18application will prove generally useful. 19 20Goals for the project 21--------------------- 22 23* Generally Useful Code 24* High Quality 25* Well Documented 26* Well Tested 27 28Licenses 29-------- 30 31This project contains elements licensed with Apache License, Version 2.0, 32as well as elements licensed with The MIT License. 33 34You'll find license-related information in the header of specific files, 35where warranted. 36 37In cases where no such information is present refer to 38[COPYING](COPYING). 39 40Currently Available Modules/Systems 41------------------------------------ 42 43### [ec_date](https://github.com/erlware/erlware_commons/blob/master/src/ec_date.erl) 44 45This module formats erlang dates in the form {{Year, Month, Day}, 46{Hour, Minute, Second}} to printable strings, using (almost) 47equivalent formatting rules as http://uk.php.net/date, US vs European 48dates are disambiguated in the same way as 49http://uk.php.net/manual/en/function.strtotime.php That is, Dates in 50the m/d/y or d-m-y formats are disambiguated by looking at the 51separator between the various components: if the separator is a slash 52(/), then the American m/d/y is assumed; whereas if the separator is a 53dash (-) or a dot (.), then the European d-m-y format is assumed. To 54avoid potential ambiguity, it's best to use ISO 8601 (YYYY-MM-DD) 55dates. 56 57erlang has no concept of timezone so the following formats are not 58implemented: B e I O P T Z formats c and r will also differ slightly 59 60### [ec_file](https://github.com/erlware/erlware_commons/blob/master/src/ec_file.erl) 61 62A set of commonly defined helper functions for files that are not 63included in stdlib. 64 65### [ec_plists](https://github.com/erlware/erlware_commons/blob/master/src/ec_plists.erl) 66 67plists is a drop-in replacement for module <a 68href="http://www.erlang.org/doc/man/lists.html">lists</a>, making most 69list operations parallel. It can operate on each element in parallel, 70for IO-bound operations, on sublists in parallel, for taking advantage 71of multi-core machines with CPU-bound operations, and across erlang 72nodes, for parallizing inside a cluster. It handles errors and node 73failures. It can be configured, tuned, and tweaked to get optimal 74performance while minimizing overhead. 75 76Almost all the functions are identical to equivalent functions in 77lists, returning exactly the same result, and having both a form with 78an identical syntax that operates on each element in parallel and a 79form which takes an optional "malt", a specification for how to 80parallize the operation. 81 82fold is the one exception, parallel fold is different from linear 83fold. This module also include a simple mapreduce implementation, and 84the function runmany. All the other functions are implemented with 85runmany, which is as a generalization of parallel list operations. 86 87### [ec_semver](https://github.com/erlware/erlware_commons/blob/master/src/ec_semver.erl) 88 89A complete parser for the [semver](http://semver.org/) 90standard. Including a complete set of conforming comparison functions. 91 92### [ec_lists](https://github.com/erlware/erlware_commons/blob/master/src/ec_lists.erl) 93 94A set of additional list manipulation functions designed to supliment 95the `lists` module in stdlib. 96 97### [ec_talk](https://github.com/erlware/erlware_commons/blob/master/src/ec_talk.erl) 98 99A set of simple utility functions to facilitate command line 100communication with a user. 101 102Signatures 103----------- 104 105Other languages, have built in support for **Interface** or 106**signature** functionality. Java has Interfaces, SML has 107Signatures. Erlang, though, doesn't currently support this model, at 108least not directly. There are a few ways you can approximate it. We 109have defined a mechnism called *signatures* and several modules that 110to serve as examples and provide a good set of *dictionary* 111signatures. More information about signatures can be found at 112[signature](https://github.com/erlware/erlware_commons/blob/master/doc/signatures.md). 113 114 115### [ec_dictionary](https://github.com/erlware/erlware_commons/blob/master/src/ec_dictionary.erl) 116 117A signature that supports association of keys to values. A map cannot 118contain duplicate keys; each key can map to at most one value. 119 120### [ec_dict](https://github.com/erlware/erlware_commons/blob/master/src/ec_dict.erl) 121 122This provides an implementation of the ec_dictionary signature using 123erlang's dicts as a base. The function documentation for ec_dictionary 124applies here as well. 125 126### [ec_gb_trees](https://github.com/erlware/erlware_commons/blob/master/src/ec_gb_trees.erl) 127 128This provides an implementation of the ec_dictionary signature using 129erlang's gb_trees as a base. The function documentation for 130ec_dictionary applies here as well. 131 132### [ec_orddict](https://github.com/erlware/erlware_commons/blob/master/src/ec_orddict.erl) 133 134This provides an implementation of the ec_dictionary signature using 135erlang's orddict as a base. The function documentation for 136ec_dictionary applies here as well. 137 138### [ec_rbdict](https://github.com/erlware/erlware_commons/blob/master/src/ec_rbdict.erl) 139 140This provides an implementation of the ec_dictionary signature using 141Robert Virding's rbdict module as a base. The function documentation 142for ec_dictionary applies here as well. 143