## Copyright (c) Eduardo Julian. All rights reserved. ## This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. ## If a copy of the MPL was not distributed with this file, ## You can obtain one at http://mozilla.org/MPL/2.0/. (;module: lux (lux (control monoid))) ## [Functions] (def: #export (const c) {#;doc "Create constant functions."} (All [a b] (-> a (-> b a))) (lambda [_] c)) (def: #export (flip f) {#;doc "Flips the order of the arguments of a function."} (All [a b c] (-> (-> a b c) (-> b a c))) (lambda [x y] (f y x))) ## [Structures] (struct: #export Monoid (Monoid (All [a] (-> a a))) (def: unit id) (def: append .))