## 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) ## [Functions] (do-template [ ] [(def: #export ( xy) (All [a b] (-> [a b] )) (let [[x y] xy] ))] [left a x] [right b y]) (def: #export (curry f) (All [a b c] (-> (-> [a b] c) (-> a b c))) (lambda [x y] (f [x y]))) (def: #export (uncurry f) (All [a b c] (-> (-> a b c) (-> [a b] c))) (lambda [xy] (let [[x y] xy] (f x y)))) (def: #export (swap xy) (All [a b] (-> [a b] [b a])) (let [[x y] xy] [y x]))