From: Luke Lau Date: Sat, 18 May 2019 23:23:31 +0000 (+0100) Subject: Generate code for functions and variables X-Git-Url: https://git.lukelau.me/?p=kaleidoscope-hs.git;a=commitdiff_plain;h=8cd4f6315dc3efd76822337e935b7d465a134a5e;hp=8cd4f6315dc3efd76822337e935b7d465a134a5e Generate code for functions and variables Now that we're generating functions, variables can now be bound. This means we will have to somehow keep track of what variables are available in scope (i.e. passed to us in 'funciton'), so we've wrapped our IRBuilderT in a ReaderT (Map String Operand). For now if the variable doesn't exist in scope, we just crash the program. But later on we will introduce a mechanism for errors, and tidy up the transformer stack. ---