creates a Barrett Mu number, given a BigInt modulus.
All instances returned by types return by type inherit from Base. Base provides functions that all instances implement with some default behavior.
contains: as, bool, copy, eq, getSuper, getType, getTypeFullName, getTypeName, hash, init, isInstance, ne, not, repr, string, to, toString
More documentation appears at http://nagoon97.com/reading-binary-files-using-ajax/
contains: getFilePointer, getFileSize, movePointer, movePointerTo, readNumber, readString, readUnicodeString
contains: create, implementations
a representation of a color that provides accessors and mutators for its components in the HSL, RGB, and HSB color spaces under any radix and cardinality including an alpha channel.
Usage:
Color(color)
Color(
components, [radix, [rgbMode | hslMode],
[inclusive | exclusive]]]
)
# red
Color([1, 0, 0])
Color([255, 0, 0], 256)
Color([0, 1, 1], 1, hslMode)
contains: contrast, contrasted, copy, diff, eq, getBlue, getBrightness, getComponents, getGreen, getHue, getLightness, getMode, getOpacity, getOrdinal, getRadix, getRed, getSaturation, getState, hash, hsl, hslString, invert, inverted, mix, mixed, repr, rgb, rgbString, setBlue, setComponents, setGreen, setHue, setLightness, setMode, setModeHsl, setModeRgb, setOpacity, setRadix, setRed, setSaturation, string
contains: addOnSelectListener, getFilterMatcher, getHighlightMatcher, init, paint, paintDurationEvent, paintEvent, paintImpreciseDurationEvent, paintImpreciseInstantEvent, paintInstantEvent, paintPreciseDurationEvent, paintPreciseInstantEvent, removeOnSelectListener, setFilterMatcher, setHighlightMatcher, showBubble, softPaint
an associative array that maps objects to objects, a set of itmes that are key and value pairs, and a relation.
Dict is an Iterable Set.
Different than Python:
- update: add
- has_key: hasKey
- iteritems: itemsIter
- iterkeys: keysIter
- itervalues: valuesIter
- fromkeys(S, v): dict(each(S.keys(), function (k) {return [k, v]}))
- setdefault: use set and get
- __del__ -> remove
- __contains__ -> has
Same as Python:
- get
- clear
- copy
- items
- keys
- values
- pop
contains: add, added, complete, completed, cut, del, eq, find, findReverse, get, getDefault, has, hasKey, hasValue, hash, invoke, items, itemsIter, keys, keysIter, put, repr, set, string, update, updated, values, valuesIter
contains: position
contains: cancelDefault, getDefaulting, getPropagation, stop, stopPropgation
contains: init, paint, setHighlight, softPaint
contains: dateToPixelOffset, init, pixelOffsetToDate, setDate, shiftPixels
contains: init, paint, setHighlight, softPaint
an iteration. constructs an iterator instance given a successor function. For example:
var i = 0;
Iter(function () {
if (i++ < 10) {
return i;
} else
throw StopIteration();
}
});
a mixin that adds convenience functions to types that implement iter.
contains: added, all, any, args, array, bool, chain, compact, compactIter, cycle, dict, each, eachArgs, eachArgsIter, eachIter, enumerate, enumerateIter, flatten, flattened, forEach, forEachArgs, getLength, group, invoke, iter, join, list, max, min, nextCatch, number, object, product, reduce, reduced, reversed, reversedIter, sorted, string, sum, transpose, transposeIter, unique, where, whereArgs, whereArgsIter, whereIter, without, withoutIter, zip, zipIter
contains: dateToPixelOffset, init, pixelOffsetToDate, setDate, shiftPixels
is Iterable
Different than Python:
- append: push
- extend: add
- count: getLength
- index: find
- insert: put
- remove: del
Same as Python:
- pop
- sort
- reverse
contains: add, added, array, begins, clear, cut, del, ends, eq, find, findReverse, first, get, getLength, has, hasKey, hasValue, hash, items, itemsIter, iter, join, keys, keysIter, last, lt, pop, push, put, reduce, repr, reverse, reversed, reversedIter, set, shift, slice, sliced, sort, sorted, splice, spliced, unshift, values, valuesIter
a function that returns a new, empty, module object.
contains: moduleScope
a native JavaScript type for module scopes. All the names in a module scope are available to its module, but they are private in the sense that including a module in another module does not copy the former module's scope.
contains: error, foreignModuleBind, global, include, info, log, module, moduleBind, moduleUrl, modulesUrl, publish, register, require, warn
A constructor for the null constant, analgous to Undefined.
contains: observe, observeAfter, observeBefore, setSignal
contains: addOnSelectListener, getFilterMatcher, getHighlightMather, init, paint, paintDurationEvent, paintEvent, paintImpreciseDurationEvent, paintImpreciseInstantEvent, paintInstantEvent, paintPreciseDurationEvent, paintPreciseInstantEvent, removeOnSelectListener, setFilterMatcher, setHighlightMatcher, showBubble, softPaint
contains: addOnSelectListener, getFilterMatcher, getHIghlightMatcher, init, painDurationEvent, paint, paintEvent, paintInstantEvent, removeOnSelectListener, setFilterMatcher, setHighlightMatcher, showBubble, softPaint
decorates an iterable such that, using the Peekable interface (the original iteration being consumed and buffered on demand), you can call peek to simulate a call to next without actually consuming an element from the iteration, or peekIter to simulate the resultant iteration of iter without consuming any values from the Peekable. Peekable uses these methods to provide hasNext for iterations that wouldn't otherwise be able to predict whether they have any more values without consuming one. Peekable also provides peekCatch to maintain orthogonality with Iterable nextCatch.
Use tee to permit multiple consumers of one indefinite iteration.
creates a playback control object and begins playing a sound.
contains: finished, getDuration, getPlaying, getPosition, getProgress, getSound, getUrl, getVolume, isPlaying, pause, resume, setOption, setPan, setPlaying, setPosition, setProgress, setTransform, setVolume, start, stop, toggle
contains: init, paint, setHighlight, softPaint
accepts encryptionExponent, decryptionExponent, modulus. use new
a representation of an integral, bounded linear region.
The domain of a range contains discrete integers, can be cardinal or ordinal, and can have a "step" between each pair of numbers like a "frequency". Cardinal ranges are inclusive of their terminal, "end", value and by default begin with one. Ordinal ranges are exclusive of their terminal, "end", value and by default begin with zero.
- is Iterable
contains: eq, get, getComponents, has, hasValue, iter, repr, reversed
accepts a pattern and flags, returns a new, extended RegExp object. differs from a native regex in that additional flags and syntax are supported and browser inconsistencies are ameliorated.
accepts a pattern and flags; returns a RegExp object. if the pattern and flag combination has previously been cached, the cached copy is returned, otherwise the new object is cached.
accepts a string to search, left and right delimiters as regex pattern strings, optional regex flags (may include non-native s, x, and y flags), and an options object which allows setting an escape character and changing the return format from an array of matches to a two-dimensional array of string parts with extended position data. returns an array of matches (optionally with extended data), allowing nested instances of left and right delimiters. use the g flag to return all matches, otherwise only the first is returned. if delimiters are unbalanced within the subject data, an error is thrown.
this function admittedly pushes the boundaries of what can be accomplished sensibly without a "real" parser. however, by doing so it provides flexible and powerful recursive parsing capabilities with minimal code weight.
warning: the escapeChar option is considered experimental and might be changed or removed in future versions of regexp.js.
accepts flags; returns a new RegExp object generated by recompiling the regex with the additional flags (may include non-native flags). the original regex object is not altered.
accepts a context object and arguments array; returns the result of calling exec with the first value in the arguments array. the context is ignored but is accepted for congruity with Function.prototype.apply.
accepts a context object and string; returns the result of calling exec with the provided string. the context is ignored but is accepted for congruity with Function.prototype.call.
adds named capture support, with values returned as result.name. also fixes two cross-browser issues, following the ECMA-262 v3 spec:
- captured values for non-participating capturing groups are returned as undefined, rather than the empty string
- the regex's lastIndex is not incremented after zero-length matches
Request inherits from and replaces the prexisting Request defined in modules.js.
contains: abort, error, getProgress, init, isAsynchronous, isSynchronous, ok, open, openOptions, ready, send, setOption
returns a wrapped HTTP Request object.
contains: abort, error, getResponse, getTimeout, isOpen, isSent, observe, ok, open, pogress, ready, send, setHeader, setTimeout, toString, warn
contains: abort, error, getProgress, init, isAsynchronous, isSynchronous, ok, open, openOptions, ready, send, setOption
accepts a setTimeout / clearTimeout handle number.
contains: dismiss
An unordered collection of unique values.
The polymorphic member function corresponding to the Set constructor is unique since Set objects guarantee that their members are distinct.
Set operations operate in constant time best case, and linear for degenerate cases.
If you mutate a List or Dict inside a set, it will be irrecoverable unless you retrieve a an object equivalent to the inserted value.
contains: add, added, and, anded, clear, difference, differenced, discard, eq, find, has, insert, intersect, intersected, isSubSet, isSuperSet, iter, mul, muled, or, ored, remove, repr, retrieve, sub, subed, symmetricDifferenced, union, unioned, xor, xored
accepts an Event type and
contains: dismiss, getAction, invoke, observe, observeAfter, observeBefore, observer, send, setAction
contains: delSignal, dismiss, getSignal, hasSignal, observe, observeAfter, observeBefore, observer, setSignal, signal
contains: del, getBytesLoaded, getBytesTotal, getDuration, getId3, getProgress, getStreaming, getUrl, getVolume, id3, play, ready, setOption, setVolume
run the altered exec when called with a non-global regex.
add named capture support to replacement strings using the syntax ${name}, and to replacement functions as arguments[0].name.
a consistent cross-browser, ECMA-262 v3 compliant split method
A constructor for the undefined constant.
The value undefined is not a member of the type system, but for orthogonality, we provide an Undefined type. This feature preserves the following identities:
- isInstance(undefined, Undefined)
- getType(undefined) === Undefined
- getType(undefined)() === undefined
- getTypeName(undefined) === 'Undefined'
contains: $, appendTo, click, createElement, doubleClick, final, getElement, getValue, init, mouseDown, mouseEnter, mouseLeave, mouseMove, mouseOut, mouseOver, mouseScroll, mouseScrollClick, mouseUp, pack, setOption, setValue, sink
contains: $, appendTo, click, createElement, doubleClick, final, getElement, getValue, init, mouseDown, mouseEnter, mouseLeave, mouseMove, mouseOut, mouseOver, mouseScroll, mouseScrollClick, mouseUp, pack, setOption, setValue, sink
contains: init, paint, setHighlight, softPaint
returns the sum of all of its arguments.
- stateless
- polymorphic on added
- currys on less than 2 arguments
- commutative
alias of union
- stateful
- chainable
- stateful
- chainable
- stateful
- chainable
returns a function that creates aliases for the methods of a given instance. The alias is polymorphic.
alphabet16Lower is the default hexadecimal alphabet. This value can be overridden on the module and function level.
alias of intersected
- stateless
- chainable
one of "browser", "dashboard", "spiderMonkey", or "rhino".
returns the result of functor.apply(context, arguments), ascertaining that that the arguments are converted to an array.
applies a given function, using the given arguments such that:
args([1, 2, 3], sum) == sum(1, 2, 3)
Usage:
args(arguments, functor, [context])
Also, composes functions such that that the first function passes its result into the second function as arguments.
returns whether all items of a given array are true.
returns whether any item of a given array is true.
returns whether any item of a given array is true.
deletes a value at a given index and moves all successive values toward the begining to fill the void. If the user provides an end index, deletes all values in a range of indicies.
Indicies may be negative. If so, the index is an offset from the array length.
a high performance variant of each that accepts only Array``s and returns an ``Array.
arrayEach(array, functor) or arrayEach(array, functor, context)
returns the index of a given value in an array or -1 if the value does not exist in the array.
returns whether the Array, items contains the given value.
arrayHas(items, value)`
constructs an iteration for native JavaScript Array or array-like instances. Works for any type that provides a length attribute and array[indexing] for successive numbers.
puts a value at a given index of an array and moves all successive elements toward the end one place.
supports the same interface as repr but only operates on arrays. repr uses this function internally. arrayRepr will perform better in situations where an object is guaranteed to be an Array.
- stateful
- chainable
returns a new Array that contains the items of a given Array in reversed order. This function does not affect the state of the given array.
- stateless
returns an array of a sliced of an Array or Array-like object.
arraySliced(object) or arraySliced(object, start) or arraySliced(object, start, stop)
a high performance variant of where that accepts only an Array and returns an Array, rather than any iterable and a List respectively.
arrayWhere(array, functor) or arrayWhere(array, functor, context)
Coerces this instance into an instance of a given type. If the other type is a member of this instance's ancestor types, returns itself. Otherwise, uses the to member function to create a new object based on this one.
returns a value in a given type. if the value is already the correct type, returns the original object. if it isn't the correct type, converts it returning a shalow copy in the new type.
- polymorphic
a constant for specifying asynchronous, non-blocking HTTP requests.
Add integers, wrapping at 2**32. This uses 16-bit operations internally to work around bugs in some JavaScript interpreters.
variadic
the Date that the module loader began building itself.
returns whether the first elements of a given list-like-object are equal, by way of eq, the respective elements in this list.
In Python, this function is called startsWith. This divergence from Python nomenclature is a matter of idealism. Ideally the semantic group of start, stop, pause, resume, and run are all temporal verbs, whereas the semantic group begins, ends, first, last, and such all apply to the state of spatial segments or lists.
- stateless
- polymorphic
- currys with less than 2 arguments.
Convert an array of big-endian words to a base-64 string
Convert an array of big-endian words to a hex string.
Convert an array of big-endian words to a string
Convert an array of little-endian words to a base-64 string
Convert an array of little-endian words to a hex string.
Convert an array of little-endian words to a string
a default implementation that always returns true.
casts a value of a native or user defined type to a boolean true or false. bool defers to the bool method of any type that defines one.
- polymorphic
returns whether the iteraction contains any values.
- stateful (consumes one iteration)
whether the state is affirmative.
a transition that bounces from its launch site until it reaches the landing.
returns the boundary of an interation of values given a judge function (one that accepts two values and returns whether the former is closer to the boundary than the latter), an optional relation function that returns an aspect of each value that should be judged, and an optional basis: a value from which to start searching for the boundary.
returns a boundary searching function for a given judge function. Boundary functions use the judge function to find the closest value to a given boundary. min is a boundary function that finds the least value of an iteration and max is a boundary function that finds the greatest value of an iteration. The judge functions for min and max are lt and gt respectively.
hides and loads a given Flash movie by URL and calls a given callback after the movie has sent its ready signal. The callback's arguments are a sender and receiver object. Augmenting the receiver with handler functions will permit the movie to send signals to javascript using your functions. The sender is a similar object provided by the Flash movie that contains handler functions that you can call to send signals to ActionScript in the Flash movie.
one of "gecko", "safari", "konqueror", or "explorer", undefined.
returns a comparator that compares values based on the values resultant from a given relation. accepts a relation and an optional comparator.
To sort a list of objects based on their "a" key:
objects.sort(by(get("a")))
To get those in descending order:
objects.sort(by(get("a")), desc)
by returns a comparison function that also tracks the arguments you used to construct it. This permits sort and sorted to perform a Schwartzian transform which can increase the performance of the sort by a factor of 2.
converts a name to camel Case using a given delimiter between numeric words.
Denotes an interval that includes its bound.
This variable may change name.
serially chains iterations. the resultant iteration will consume and produce values from the first iteration, then consume and produce values from each following iteration in turn. adding and summing iterations has the same effect.
if only one argument is passed in, it is presumed to be an iterable object containing the iterations you desire to chain.
if more than one argument is passed in, the arguments themselves are presumed to be a list of iterations to chain.
bits per input character. 8 - ASCII; 16 - Unicode This value can be overridden on the module and function level.
a transition that traces the arc of a circle that launches slowly and lands quickly.
removes all values in this set.
- stateful
- chainable
removes all key value pairs from list and dict-like objects including native Arrays, Objects, and types that override the clear function like Dict and List.
- polymorphic
- stateful
- chainable
- stateful
- chainable