aboutsummaryrefslogtreecommitdiff
path: root/monad.inc
diff options
context:
space:
mode:
authorChristian Cunningham <cc@localhost>2024-07-14 09:16:39 -0700
committerChristian Cunningham <cc@localhost>2024-07-14 09:16:39 -0700
commit8caa5e7cafb686ac215eb4d1eb56f8a953ea11f4 (patch)
tree9ba811f89f0940988b7bb5e577a0a6463a45cee2 /monad.inc
parent28fbc837eaff40b0f992233e583f8352f13dddfe (diff)
Whitespace Formatting
Diffstat (limited to 'monad.inc')
-rw-r--r--monad.inc18
1 files changed, 9 insertions, 9 deletions
diff --git a/monad.inc b/monad.inc
index 6c5f676..18d8552 100644
--- a/monad.inc
+++ b/monad.inc
@@ -4,12 +4,12 @@
%include "alloc.inc"
%endif
-struc Monad
+struc Monad
just: resq 1
exist: resb 1
endstruc
-%macro m_make 1-3 0,0
+%macro m_make 1-3 0,0
;; %1 = Name
;; %2 = Address of Structure
;; %3 = Something > 0, Nothing = 0
@@ -20,7 +20,7 @@ m_%1:
iend
%endm
-%macro m_Just 1-3 0,0
+%macro m_Just 1-3 0,0
;; %1 = Name
;; %2 = New Structure Address
;; %3 = Something > 0, Nothing = 0
@@ -38,16 +38,16 @@ m_%1:
lea rax, [%1]
%endm
-%macro m_Nothing 1
+%macro m_Nothing 1
;; %1 = Name
m_Just %1
%endm
-%macro m_return 1-2 rax
+%macro m_return 1-2 rax
m_Just %1, %2, 1
%endm
-%macro m_bind 1-2 rax
+%macro m_bind 1-2 rax
;; %1 = Callable Function with Single Argument, the Unwrapped Monad
;; %2 = Monad
;; m a -> (a -> m b) -> m b
@@ -61,7 +61,7 @@ m_%1:
%%exit:
%endmacro
-%macro m_call 1-2 rax
+%macro m_call 1-2 rax
;; %1 = Callable Function with Single Argument, the Unwrapped Monad
;; %2 = Monad
;; m a -> (a -> !) -> !
@@ -75,11 +75,11 @@ m_%1:
%%exit:
%endmacro
-%macro alloc_m 0
+%macro alloc_m 0
alloc Monad_size
%endm
-%macro free_m 1
+%macro free_m 0-1 rax
free %1, Monad_size
%endm