diff options
| author | Tom Harley | 2020-01-11 19:46:15 +0000 |
|---|---|---|
| committer | Tom Harley | 2020-01-11 19:46:15 +0000 |
| commit | 9e87372371794bc3e7d46698141966c00acaad0e (patch) | |
| tree | 068da13d97cefed2e49ab06843e1dd9d97c32f6a /examples/nqueens/list.sin | |
| parent | Added int width specifiers (diff) | |
| download | sinter-9e87372371794bc3e7d46698141966c00acaad0e.tar.gz sinter-9e87372371794bc3e7d46698141966c00acaad0e.zip | |
Tidying up
- Removed unused example files
- Removed redundant common.c
- Added extra files to make sure the current version compiles the nqueens solution correctly
- Added extensionless files to .gitignore
- Added a way to install sinter
Diffstat (limited to 'examples/nqueens/list.sin')
| -rw-r--r-- | examples/nqueens/list.sin | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/examples/nqueens/list.sin b/examples/nqueens/list.sin deleted file mode 100644 index 9a59945..0000000 --- a/examples/nqueens/list.sin +++ /dev/null @@ -1,56 +0,0 @@ -[type cons_ [kind head tail]] -[type nil_ [kind]] - -[def cons [head tail] - [cons_ 1 head tail]] - -[def nil [] - [nil_ 0]] - -[def head [xs] - [cons_.head xs]] - -[def tail [xs] - [cons_.tail xs]] - -[def has_tail [xs] - [nil_.kind xs]] - -[def is_nil [x] - [if [nil_.kind x] - 0 - 1]] - -[def concat [as bs] - [cons [head as] - [if [is_nil [tail as]] - bs - [concat [tail as] bs]]]] - -[def alt_concat [as bs] - [if [is_nil [tail as]] - [cons [head as] bs] - [cons [head as] [concat [tail as] bs]]]] - -[def flatten_once [xs] - [concat [head xs] [flatten_once [tail xs]]]] - -[def List.>>= [ma f] - [flatten_once [map ma f]]] - -[def List.return [a] - [cons a [nil]]] - -[def prepend [x xs] - [cons x xs]] - -[def append [xs x] - [if [is_nil xs] - [cons [debug_int x] [nil]] - [cons [head xs] [append [tail xs] x]]]] - -[def map [xs f] - [if [is_nil xs] - xs - [cons [f [head xs]] - [map [tail xs] f]]]] |
