shithub: MicroHs

Download patch

ref: 9cafa1a6f51a9c0e902c31be0cbe7e88658f44da
parent: eff1304fede732433f16246552cf800c1d17a589
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Sat Nov 18 11:05:22 EST 2023

Comments

--- a/src/MicroHs/Compile.hs
+++ b/src/MicroHs/Compile.hs
@@ -67,6 +67,8 @@
 
 -----------------
 
+-- Compile the module with the given name, starting with the given cache.
+-- Return the "compiled module" and the resulting cache.
 compileCacheTop :: Flags -> Ident -> Cache -> IO ([(Ident, Exp)], Cache)
 compileCacheTop flags mn ch = do
   (ds, ch') <- compile flags mn ch
--- a/src/MicroHs/Exp.hs
+++ b/src/MicroHs/Exp.hs
@@ -28,22 +28,22 @@
 --
 -- Used combinators
 --   * indicates that the implementation uses an indirection
---   + indicates allocation in the implementation
--- S  x y z   = x z (y z)             +
+--   A indicates allocation in the implementation
+-- S  x y z   = x z (y z)             A
 -- K  x y     = x                     *
 -- I  x       = x                     *
--- B  x y z   = x (y z)               +
--- C  x y z   = x z y                 +
--- S' x y z w = x (y w) (z w)         +
--- B' x y z w = x y (z w)             +
--- C' x y z w = x (y w) z             +
+-- B  x y z   = x (y z)               A
+-- C  x y z   = x z y                 A
+-- S' x y z w = x (y w) (z w)         A
+-- B' x y z w = x y (z w)             A
+-- C' x y z w = x (y w) z             A
 -- A  x y     = y                     *
 -- T  x y     = y x
 -- n@(Y x)    = x n
 -- BK x y z   = x y
--- P  x y z   = z x y                 +
--- R  x y z   = y z x                 +
--- O  x y z w = w x y                 +
+-- P  x y z   = z x y                 A
+-- R  x y z   = y z x                 A
+-- O  x y z w = w x y                 A
 --
 
 data Exp
--- a/src/MicroHs/MakeCArray.hs
+++ b/src/MicroHs/MakeCArray.hs
@@ -1,3 +1,5 @@
+-- Copyright 2023 Lennart Augustsson
+-- See LICENSE file for full license.
 module MicroHs.MakeCArray(makeCArray) where
 import Prelude
 import Data.Char
--