From aaee41ef1c1756e0a32e47e95b5be6ea343305d4 Mon Sep 17 00:00:00 2001 From: Brent Yorgey Date: Tue, 25 Jun 2024 10:57:30 -0500 Subject: [PATCH] add `imap` to world DSL reference --- data/worlds/README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/data/worlds/README.md b/data/worlds/README.md index d2fc2146b6..3edffc85e9 100644 --- a/data/worlds/README.md +++ b/data/worlds/README.md @@ -81,6 +81,7 @@ repetitions of `S` separated by `,`. | 'let' ( '=' )*, 'in' | 'overlay' '[' +, ']' | 'mask' + | 'imap' | '"' + '"' | '(' ')' @@ -186,4 +187,9 @@ entities but also some empty cells. https://libnoise.sourceforge.net/glossary/index.html#perlinnoise - `mask b e` takes the value of `e` where `b` is true, and is empty elsewhere. +- `imap` has type `World int -> World int -> World a -> World a`, and + creates a new world from a reference world using the given index + lookup functions. That is, `imap wx wy wa` yields the world + `\c -> wa (wx c, wy c)`. For example, `imap (-x) y w` reflects the + world `w` across the line `y = 0`. - `"foo"` imports the DSL term in `worlds/foo.world`.