From 69be73e4a3ddb3a023f0aa83c869b1a33af88e54 Mon Sep 17 00:00:00 2001 From: "Duncan M. McGreggor" Date: Tue, 19 May 2015 23:30:19 -0500 Subject: [PATCH] Various formatting tweaks. --- src/calrissian-identity-monad.lfe | 4 +++- src/calrissian-maybe-monad.lfe | 7 +++++-- src/calrissian-monad.lfe | 14 ++++++++------ src/calrissian-util.lfe | 23 ++++++++++++----------- 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/calrissian-identity-monad.lfe b/src/calrissian-identity-monad.lfe index f090464..4be2a99 100644 --- a/src/calrissian-identity-monad.lfe +++ b/src/calrissian-identity-monad.lfe @@ -8,4 +8,6 @@ (funcall f x)) (defun return (x) x) -(defun fail (x) (throw (tuple 'error x))) + +(defun fail (x) + (throw (tuple 'error x))) diff --git a/src/calrissian-maybe-monad.lfe b/src/calrissian-maybe-monad.lfe index 77160b5..e19ac6f 100644 --- a/src/calrissian-maybe-monad.lfe +++ b/src/calrissian-maybe-monad.lfe @@ -10,5 +10,8 @@ (((tuple 'just x) f) (funcall f x))) -(defun return (x) (tuple 'just x)) -(defun fail (_) 'nothing) +(defun return (x) + (tuple 'just x)) + +(defun fail (_) + 'nothing) diff --git a/src/calrissian-monad.lfe b/src/calrissian-monad.lfe index 81a636d..be444c0 100644 --- a/src/calrissian-monad.lfe +++ b/src/calrissian-monad.lfe @@ -9,9 +9,11 @@ ((_) 'undefined)) (defun do-transform - ((monad (cons h '())) h) - ((monad (cons (list f '<- m) t)) (list '>>= monad - m - (list 'lambda (list f) (do-transform monad t)))) - ((monad (cons h t)) (list '>> monad h (do-transform monad t))) - ) + ((monad (cons h '())) + h) + ((monad (cons (list f '<- m) t)) + (list '>>= monad + m + (list 'lambda (list f) (do-transform monad t)))) + ((monad (cons h t)) + (list '>> monad h (do-transform monad t)))) diff --git a/src/calrissian-util.lfe b/src/calrissian-util.lfe index 3055123..e9ace16 100644 --- a/src/calrissian-util.lfe +++ b/src/calrissian-util.lfe @@ -9,27 +9,28 @@ ;; Report exported function arities as (arity - 1) to account for ;; the extra argument supplied to tuple modules (let ((fix-info (lambda (info-plist) - (let* ((exports (: proplists get_value 'exports info-plist)) + (let* ((exports (proplists:get_value 'exports info-plist)) (fix-arity (match-lambda ;; module_info is added by the compiler and therefore remains as-is (((tuple 'module_info arity)) (tuple 'module_info arity)) (((tuple fun arity)) (tuple fun (- arity 1))))) - (info-dict (: dict from_list info-plist)) - (new-dict (: dict store 'exports (: lists map fix-arity exports) info-dict)) - (new-plist (: dict to_list new-dict))) + (info-dict (dict:from_list info-plist)) + (new-dict (dict:store 'exports (lists:map fix-arity exports) info-dict)) + (new-plist (dict:to_list new-dict))) new-plist)))) (funcall fix-info (module-info module)))) - ((module) (call module 'module_info))) + ((module) + (call module 'module_info))) (defun module-info (module key) - (: proplists get_value key (module-info module))) + (proplists:get_value key (module-info module))) (defun implements? (behaviour module) (let* ((exports (module-info module 'exports)) - (exported? (lambda (definition) (: lists member definition exports)))) - (: lists all exported? - (call behaviour 'behaviour_info 'callbacks)))) + (exported? (lambda (definition) (lists:member definition exports)))) + (lists:all exported? + (call behaviour 'behaviour_info 'callbacks)))) (defun exports? (definition module) - (: lists member definition - (module-info module 'exports))) \ No newline at end of file + (lists:member definition + (module-info module 'exports)))