Skip to content

Instantly share code, notes, and snippets.

View hazzard993's full-sized avatar

Jason McKenzie hazzard993

View GitHub Profile
@hazzard993
hazzard993 / composition.gml
Last active December 23, 2024 01:07
Inline pasteable functional functions for some functional programming in GameMaker (at least to my understanding of FP).
///
/// Performs right-to-left function composition.
///
/// @param {Function[]} ...functions The pipeline of functions to send values through.
/// @returns The head of this pipeline.
var compose = function() {
var functions = [];
for (var i = 0; i < argument_count; ++i) {
array_push(functions, argument[i]);
}