diff options
Diffstat (limited to 'monad.inc')
-rw-r--r-- | monad.inc | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 |