More formatting tweaks.

This commit is contained in:
Duncan McGreggor 2015-05-21 19:14:39 -05:00
parent 1c9fe229cb
commit 8fbb180c7c

View file

@ -3,13 +3,13 @@
;; Provide the state monad in terms of the state transformer ;; Provide the state monad in terms of the state transformer
(''state `(transformer 'state 'identity)) (''state `(transformer 'state 'identity))
(_ (_
`(list_to_atom (lists:flatten (list "calrissian-" `(list_to_atom (lists:flatten `("calrissian-"
(atom_to_list ,name) ,(atom_to_list ,name)
"-monad")))))) "-monad"))))))
(defmacro transformer (name inner-monad) (defmacro transformer (name inner-monad)
`(tuple (list_to_atom (lists:flatten (list "calrissian-" `(tuple (list_to_atom (lists:flatten `("calrissian-"
(atom_to_list ,name) ,(atom_to_list ,name)
"-transformer"))) "-transformer")))
(monad ,inner-monad))) (monad ,inner-monad)))
@ -31,7 +31,7 @@
`(call ,monad 'fail ,expr)) `(call ,monad 'fail ,expr))
(defmacro sequence (monad list) (defmacro sequence (monad list)
`(: lists foldr `(lists:foldr
(lambda (m acc) (mcons ,monad m acc)) (lambda (m acc) (mcons ,monad m acc))
(return ,monad []) (return ,monad [])
,list)) ,list))