From c4a46f47e16b367cd73b10c341957acaeb430c01 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 31 Jul 2018 11:52:20 -0400 Subject: [PATCH] :memo: lambda. --- src/Control/Abstract/Primitive.hs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Control/Abstract/Primitive.hs b/src/Control/Abstract/Primitive.hs index bd7ddb81c..e81abb5fe 100644 --- a/src/Control/Abstract/Primitive.hs +++ b/src/Control/Abstract/Primitive.hs @@ -62,6 +62,9 @@ defineNamespace name scope = define name $ do binds <- Env.head <$> locally (scope >> getEnv) namespace name Nothing binds +-- | Construct a function from a Haskell function taking 'Name's as arguments. +-- +-- The constructed function will have the same arity as the Haskell function. Nullary functions are constructed by providing an evaluator producing an address. Note that the constructed function must not contain free variables as they will not be captured by the closure, and/or will be garbage collected. lambda :: ( HasCallStack , Lambda address value effects fn , Member (Reader ModuleInfo) effects