├── Prelude.dhall ├── README.md ├── examples ├── small.dhall ├── unvalidated.dhall └── validated.dhall ├── render.dhall ├── render ├── AUTOCOMPLETE.dhall ├── AUTOPICKUP_EXCEPTION.dhall ├── Alignment.dhall ├── Attributes.dhall ├── BIND.dhall ├── Bool.dhall ├── Color.dhall ├── Comparison.dhall ├── Condition.dhall ├── Config.dhall ├── Disclose.dhall ├── Disclosure.dhall ├── Enabled.dhall ├── Gender.dhall ├── Hilite.dhall ├── HiliteStatus.dhall ├── MenuColor.dhall ├── MenuHeadings.dhall ├── MenuStyle.dhall ├── MsgType.dhall ├── MsgWindow.dhall ├── NumberPad.dhall ├── Numeric.dhall ├── Options.dhall ├── ParanoidConfirmation.dhall ├── Percent.dhall ├── PetType.dhall ├── PickupBurden.dhall ├── PileLimit.dhall ├── PlayMode.dhall ├── Race.dhall ├── Role.dhall ├── RunMode.dhall ├── SOUND.dhall ├── Scores.dhall ├── SortLoot.dhall ├── SymSet.dhall ├── Textual.dhall ├── WhatisCoord.dhall └── WhatisFilter.dhall ├── toNetHack.dhall ├── types.dhall └── types ├── AUTOPICKUP_EXCEPTION.dhall ├── Alignment.dhall ├── Attributes.dhall ├── BIND.dhall ├── Color.dhall ├── Comparison.dhall ├── Condition.dhall ├── Config.dhall ├── Disclose.dhall ├── Disclosure.dhall ├── Enabled.dhall ├── Gender.dhall ├── Hilite.dhall ├── HiliteStatus.dhall ├── MenuColor.dhall ├── MenuHeadings.dhall ├── MenuStyle.dhall ├── MsgType.dhall ├── MsgWindow.dhall ├── NumberPad.dhall ├── Numeric.dhall ├── ParanoidConfirmation.dhall ├── Percent.dhall ├── PetType.dhall ├── PickupBurden.dhall ├── PileLimit.dhall ├── PlayMode.dhall ├── Race.dhall ├── Role.dhall ├── RunMode.dhall ├── SOUND.dhall ├── Scores.dhall ├── SortLoot.dhall ├── SymSet.dhall ├── Textual.dhall ├── WhatisCoord.dhall └── WhatisFilter.dhall /Prelude.dhall: -------------------------------------------------------------------------------- 1 | {- This file provides a central `Prelude` import for the rest of the library to 2 | use so that the integrity check only needs to be updated in one place 3 | whenever upgrading the interpreter. 4 | 5 | This allows the user to provide their own Prelude import using the 6 | `DHALL_PRELUDE` environment variable, like this: 7 | 8 | ``` 9 | $ export DHALL_PRELUDE='https://prelude.dhall-lang.org/package.dhall sha256:...' 10 | ``` 11 | 12 | Note that overriding the Prelude in this way only works if this repository 13 | is imported locally. Remote imports do not have access to environment 14 | variables and any attempt to import one will fall back to the next available 15 | import. To learn more, read: 16 | 17 | * https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees#cross-site-scripting-xss 18 | 19 | This file also provides an import without the integrity check as a slower 20 | fallback if the user is using a different version of the Dhall interpreter. 21 | -} 22 | 23 | env:DHALL_PRELUDE 24 | ? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v8.0.0/Prelude/package.dhall sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d 25 | ? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v8.0.0/Prelude/package.dhall 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # `dhall-nethack` 2 | 3 | This repository illustrates best practices for the 4 | [Dhall configuration language][dhall-lang] using the 5 | [NetHack configuration format][nethack] as an example use case. You can use 6 | this repository : 7 | 8 | * as a template for organizing your own large Dhall projects 9 | * as a case study for adapting Dhall to large and complex configuration formats 10 | 11 | Note: this repository covers the non-platform-specific NetHack options, omits 12 | redundant options (such as `female`, which is superseded by `gender`), and 13 | also omits underspecified options (such as `herecmd_menu`). 14 | 15 | ## Quick start 16 | 17 | ```haskell 18 | -- ./example.dhall 19 | 20 | let types = ./types.dhall 21 | 22 | let toNetHack = ./toNetHack.dhall 23 | 24 | let config = 25 | types.Config::{ 26 | , name = Some "Kaeru" 27 | , role = Some { enable = True, value = types.Role.wizard } 28 | , align = Some { enable = True, value = types.Alignment.chaotic } 29 | , race = Some { enable = True, value = types.Race.elf } 30 | , gender = Some types.Gender.female 31 | , pettype = Some types.PetType.cat 32 | , catname = Some "Imoen" 33 | , fruit = Some "apple pie" 34 | , autopickup = Some False 35 | , disclose = 36 | let secret = Some { default = False, prompt = False } 37 | 38 | in Some 39 | { attributes = secret 40 | , conduct = secret 41 | , dungeon_overview = secret 42 | , inventory = secret 43 | , monsters_genocided = secret 44 | , monsters_killed = secret 45 | } 46 | } 47 | 48 | in toNetHack config 49 | ``` 50 | 51 | ```bash 52 | $ dhall text --file './example.dhall' 53 | OPTIONS=align:chaotic 54 | OPTIONS=!autopickup 55 | OPTIONS=catname:Imoen 56 | OPTIONS=disclose:-i -a -v -g -c -o 57 | OPTIONS=fruit:apple pie 58 | OPTIONS=gender:female 59 | OPTIONS=name:Kaeru 60 | OPTIONS=pettype:cat 61 | OPTIONS=race:elf 62 | OPTIONS=role:wizard 63 | ``` 64 | 65 | ## Exploring the project 66 | 67 | You can begin to explore the project by browsing these files and their 68 | dependencies: 69 | 70 | * [`./types.dhall`](./types.dhall) 71 | * [`./types/Config.dhall`](./types/Config.dhall) 72 | * [`./render.dhall`](./render.dhall) 73 | * [`./render/Config.dhall`](./render/Config.dhall) 74 | * [`./Prelude.dhall`](./Prelude.dhall) 75 | * [`./examples/validated.dhall`](./examples/validated.dhall) 76 | 77 | You can also use `dhall repl` to explore this project. Try these commands to 78 | get started: 79 | 80 | ```haskell 81 | $ dhall repl 82 | ⊢ :let types = ./types.dhall -- Import all types as a giant record 83 | ⊢ types.Config -- Display the `Config` type 84 | ⊢ types.Scores -- Display the `Scores` type 85 | 86 | ⊢ :let render = ./render.dhall -- Import all rendering functions 87 | ⊢ render.Config types.Config.default -- Render the default configuration 88 | ⊢ render.Config ./examples/small.dhall -- Render a small configuration 89 | ⊢ render.Config ./examples/validated.dhall -- Render a large configuration 90 | ⊢ render.Config (types.Config::{ scores = types.Scores::{ top = Some 3 } }) 91 | ⊢ render.Scores (types.Scores::{ top = Some 3 }) 92 | 93 | ⊢ :type render.Scores -- What is the type of the `render.Scores` function? 94 | ⊢ render.Scores -- What is the implementation of `render.Scores`? 95 | ⊢ :type render.Config -- What is the type of the `render.Config` function? 96 | ⊢ render.Config -- What is the implementation of `render.Config`? 97 | ``` 98 | 99 | [dhall-lang]: https://github.com/dhall-lang/dhall-lang/ 100 | [nethack]: https://nethackwiki.com/wiki/Options 101 | -------------------------------------------------------------------------------- /examples/small.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in types.Config::{ 4 | , name = Some "Kaeru" 5 | , role = Some { enable = True, value = types.Role.wizard } 6 | , align = Some { enable = True, value = types.Alignment.chaotic } 7 | , race = Some { enable = True, value = types.Race.elf } 8 | , gender = Some types.Gender.female 9 | , pettype = Some types.PetType.cat 10 | , catname = Some "Imoen" 11 | , fruit = Some "apple pie" 12 | , autopickup = Some False 13 | , disclose = 14 | let secret = Some { default = False, prompt = False } 15 | 16 | in Some 17 | { attributes = secret 18 | , conduct = secret 19 | , dungeon_overview = secret 20 | , inventory = secret 21 | , monsters_genocided = secret 22 | , monsters_killed = secret 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /examples/unvalidated.dhall: -------------------------------------------------------------------------------- 1 | -- This file extends `./validated.dhall` with all options that are documented in 2 | -- https://nethackwiki.com/wiki/Options but not yet successfully validated 3 | -- against a NetHack installation 4 | 5 | ./validated.dhall 6 | ⫽ { rlecomp = Some False 7 | , SOUND = 8 | [ { regex = "This door is locked", filename = "lock.wav", volume = 100 } ] 9 | , SOUNDDIR = Some "C:\\foo" 10 | , zerocomp = Some False 11 | } 12 | -------------------------------------------------------------------------------- /examples/validated.dhall: -------------------------------------------------------------------------------- 1 | -- This file was tested using console NetHack version 3.6.1 2 | -- 3 | -- To exercise all options documented in https://nethackwiki.com/wiki/Options 4 | -- see `./unvalidated.dhall` 5 | 6 | let types = ../types.dhall 7 | 8 | in types.Config::{ 9 | , AUTOCOMPLETE = 10 | [ { enable = True, value = "zap" } 11 | , { enable = False, value = "annotate" } 12 | ] 13 | , acoustics = Some True 14 | , align = Some { enable = True, value = types.Alignment.chaotic } 15 | , autodescribe = Some False 16 | , autodig = Some False 17 | , AUTOPICKUP_EXCEPTION = 18 | [ { pickup = False, name = "chest" }, { pickup = True, name = "dagger" } ] 19 | , BIND = 20 | [ { keybinding = "!", command = "loot" } 21 | , { keybinding = "^v", command = "untrap" } 22 | , { keybinding = "M-x", command = "terrain" } 23 | ] 24 | , catname = Some "Mirri" 25 | , checkpoint = Some True 26 | , checkspace = Some True 27 | , clicklook = Some False 28 | , cmdassist = Some True 29 | , confirm = Some True 30 | , dark_room = Some False 31 | , disclose = Some types.Disclose::{ 32 | , inventory = Some { prompt = True, default = True } 33 | , attributes = Some { prompt = True, default = False } 34 | , monsters_killed = Some { prompt = False, default = True } 35 | , monsters_genocided = Some { prompt = False, default = False } 36 | , conduct = Some { prompt = False, default = False } 37 | , dungeon_overview = Some { prompt = False, default = False } 38 | } 39 | , dogname = Some "Cujo" 40 | , extmenu = Some False 41 | , fixinv = Some True 42 | , force_invmenu = Some False 43 | , fruit = Some "slime mold" 44 | , gender = Some types.Gender.female 45 | , goldX = Some False 46 | , help = Some True 47 | , hilite_pet = Some False 48 | , hilite_pile = Some False 49 | , hilite_status = types.HiliteStatus::{ 50 | , gold = 51 | [ { color = types.Color.yellow 52 | , trigger = Some types.Numeric.always 53 | , attributes = None types.Attributes.Type 54 | } 55 | ] 56 | } 57 | , hitpointbar = Some True 58 | , horsename = Some "Erhir" 59 | , ignintr = Some False 60 | , implicit_uncursed = Some True 61 | , legacy = Some True 62 | , lit_corridor = Some False 63 | , lootabc = Some False 64 | , mail = Some True 65 | , mention_walls = Some False 66 | , menucolors = 67 | [ { regex = "blessed" 68 | , color = Some types.Color.cyan 69 | , attributes = types.Attributes::{ bold = Some True } 70 | } 71 | ] 72 | , menustyle = Some types.MenuStyle.traditional 73 | , menu_deselect_all = Some "-" 74 | , menu_deselect_page = Some "\\" 75 | , menu_first_page = Some "^" 76 | , menu_headings = Some types.MenuHeadings.bold 77 | , menu_invert_all = Some "@" 78 | , menu_invert_page = Some "~" 79 | , menu_last_page = Some "|" 80 | , menu_next_page = Some ">" 81 | , menu_objsyms = Some False 82 | , menu_previous_page = Some "<" 83 | , menu_search = Some ":" 84 | , menu_select_all = Some "." 85 | , menu_tab_sep = Some False 86 | , msg_window = Some types.MsgWindow.single 87 | , MSGTYPE = [ types.MsgType.hide "You swap places with .*" ] 88 | , name = Some "Kaeru" 89 | , news = Some True 90 | , nudist = Some False 91 | , null = Some False 92 | , number_pad = Some types.NumberPad.Letters 93 | , packorder = Some "\")[%?+!=/(*`0_" 94 | , paranoid_confirmation = types.ParanoidConfirmation::{ pray = Some True } 95 | , pettype = Some types.PetType.cat 96 | , pickup_burden = Some types.PickupBurden.stressed 97 | , pickup_thrown = Some True 98 | , pickup_types = Some "?!/" 99 | , pile_limit = Some (types.PileLimit.limit 5) 100 | , playmode = Some types.PlayMode.normal 101 | , pushweapon = Some False 102 | , race = Some { enable = True, value = types.Race.elf } 103 | , rest_on_space = Some False 104 | , role = Some { enable = True, value = types.Role.wizard } 105 | , roguesymset = Some types.SymSet.RogueEpyx 106 | , runmode = Some types.RunMode.walk 107 | , safe_pet = Some True 108 | , sanity_check = Some False 109 | , scores = { own = Some True, around = Some 2, top = Some 10 } 110 | , showexp = Some False 111 | , showrace = Some False 112 | , showscore = Some False 113 | , silent = Some True 114 | , sortloot = Some types.SortLoot.none 115 | , sortpack = Some True 116 | , sparkle = Some True 117 | , standout = Some False 118 | , status_updates = Some True 119 | , statushilites = Some 10 120 | , suppress_alert = Some "3.3.1" 121 | , symset = Some types.SymSet.DECgraphics 122 | , time = Some False 123 | , timed_delay = Some True 124 | , tombstone = Some True 125 | , toptenwin = Some False 126 | , travel = Some True 127 | , verbose = Some True 128 | , whatis_coord = Some types.WhatisCoord.none 129 | , whatis_filter = Some types.WhatisFilter.no_filtering 130 | , whatis_menu = Some False 131 | , whatis_moveskip = Some False 132 | , windowtype = Some "tty" 133 | , wizkit = Some "wizkit.txt" 134 | } 135 | -------------------------------------------------------------------------------- /render.dhall: -------------------------------------------------------------------------------- 1 | { Alignment = ./render/Alignment.dhall 2 | , Attributes = ./render/Attributes.dhall 3 | , AUTOCOMPLETE = ./render/AUTOCOMPLETE.dhall 4 | , AUTOPICKUP_EXCEPTION = ./render/AUTOPICKUP_EXCEPTION.dhall 5 | , BIND = ./render/BIND.dhall 6 | , Bool = ./render/Bool.dhall 7 | , Color = ./render/Color.dhall 8 | , Comparison = ./render/Comparison.dhall 9 | , Condition = ./render/Condition.dhall 10 | , Config = ./render/Config.dhall 11 | , Disclose = ./render/Disclose.dhall 12 | , Disclosure = ./render/Disclosure.dhall 13 | , Enabled = ./render/Enabled.dhall 14 | , Gender = ./render/Gender.dhall 15 | , Hilite = ./render/Hilite.dhall 16 | , HiliteStatus = ./render/HiliteStatus.dhall 17 | , MenuColor = ./render/MenuColor.dhall 18 | , MenuHeadings = ./render/MenuHeadings.dhall 19 | , MenuStyle = ./render/MenuStyle.dhall 20 | , MsgType = ./render/MsgType.dhall 21 | , MsgWindow = ./render/MsgWindow.dhall 22 | , NumberPad = ./render/NumberPad.dhall 23 | , Numeric = ./render/Numeric.dhall 24 | , Options = ./render/Options.dhall 25 | , ParanoidConfirmation = ./render/ParanoidConfirmation.dhall 26 | , Percent = ./render/Percent.dhall 27 | , PetType = ./render/PetType.dhall 28 | , PickupBurden = ./render/PickupBurden.dhall 29 | , PileLimit = ./render/PileLimit.dhall 30 | , PlayMode = ./render/PlayMode.dhall 31 | , Race = ./render/Race.dhall 32 | , Role = ./render/Role.dhall 33 | , RunMode = ./render/RunMode.dhall 34 | , Scores = ./render/Scores.dhall 35 | , SortLoot = ./render/SortLoot.dhall 36 | , SOUND = ./render/SOUND.dhall 37 | , SymSet = ./render/SymSet.dhall 38 | , Textual = ./render/Textual.dhall 39 | , WhatisCoord = ./render/WhatisCoord.dhall 40 | , WhatisFilter = ./render/WhatisFilter.dhall 41 | } 42 | -------------------------------------------------------------------------------- /render/AUTOCOMPLETE.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Enabled Text) 4 | → "AUTOCOMPLETE=${./Bool.dhall x.enable}${x.value}" 5 | -------------------------------------------------------------------------------- /render/AUTOPICKUP_EXCEPTION.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.AUTOPICKUP_EXCEPTION) 4 | → let prefix = if x.pickup then "<" else ">" 5 | 6 | in "AUTOPICKUP_EXCEPTION=\"${prefix}${x.name}\"" 7 | -------------------------------------------------------------------------------- /render/Alignment.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Alignment) 4 | → merge 5 | { lawful = "lawful" 6 | , neutral = "neutral" 7 | , chaotic = "chaotic" 8 | , random = "random" 9 | } 10 | x 11 | -------------------------------------------------------------------------------- /render/Attributes.dhall: -------------------------------------------------------------------------------- 1 | let Prelude = ../Prelude.dhall 2 | 3 | let types = ../types.dhall 4 | 5 | let renderAttribute = 6 | λ(name : Text) 7 | → λ(x : Optional Bool) 8 | → Optional/fold 9 | Bool 10 | x 11 | (List Text) 12 | (λ(enabled : Bool) → if enabled then [ name ] else [] : List Text) 13 | ([] : List Text) 14 | 15 | in λ(x : types.Attributes.Type) 16 | → Prelude.Text.concatSep 17 | "&" 18 | ( renderAttribute "bold" x.bold 19 | # renderAttribute "inverse" x.inverse 20 | # renderAttribute "underline" x.underline 21 | # renderAttribute "blink" x.blink 22 | # renderAttribute "dim" x.dim 23 | ) 24 | -------------------------------------------------------------------------------- /render/BIND.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.BIND) → "BIND=${x.keybinding}:${x.command}" 4 | -------------------------------------------------------------------------------- /render/Bool.dhall: -------------------------------------------------------------------------------- 1 | λ(enable : Bool) → if enable then "" else "!" 2 | -------------------------------------------------------------------------------- /render/Color.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Color) 4 | → merge 5 | { black = "black" 6 | , red = "red" 7 | , green = "green" 8 | , brown = "brown" 9 | , blue = "blue" 10 | , magenta = "magenta" 11 | , cyan = "cyan" 12 | , gray = "gray" 13 | , orange = "orange" 14 | , lightgreen = "lightgreen" 15 | , yellow = "yellow" 16 | , lightblue = "lightblue" 17 | , lightmagenta = "lightmagenta" 18 | , lightcyan = "lightcyan" 19 | , white = "white" 20 | } 21 | x 22 | -------------------------------------------------------------------------------- /render/Comparison.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(comparison : types.Comparison) 4 | → merge 5 | { EqualTo = λ(n : Natural) → Natural/show n 6 | , LessThanOrEqualTo = λ(n : Natural) → "<${Natural/show n}" 7 | , GreaterThanOrEqualTo = λ(n : Natural) → ">${Natural/show n}" 8 | } 9 | comparison 10 | -------------------------------------------------------------------------------- /render/Condition.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Condition) 4 | → merge 5 | { always = "always" 6 | , stone = "stone" 7 | , slime = "slime" 8 | , strngl = "strngl" 9 | , foodpois = "foodpois" 10 | , termill = "termill" 11 | , blind = "blind" 12 | , deaf = "deaf" 13 | , stun = "stun" 14 | , conf = "conf" 15 | , hallu = "hallu" 16 | , lev = "lev" 17 | , fly = "fly" 18 | , ride = "ride" 19 | , major_troubles = "major_troubles" 20 | , minor_troubles = "minor_troubles" 21 | , movement = "movement" 22 | , all = "all" 23 | } 24 | x 25 | -------------------------------------------------------------------------------- /render/Config.dhall: -------------------------------------------------------------------------------- 1 | {- The Dhall language is sufficiently powerful that you can use the language to 2 | template other configuration file formats. This pattern is more common 3 | when: 4 | 5 | (A) You are targeting a configuration format where you don't have the option 6 | of modifying the program to read a Dhall configuration file directly 7 | 8 | (B) The configuration format is not a standard configuration format like 9 | JSON or YAML 10 | 11 | If we were using a standard format then we would use something like 12 | `dhall-to-json` or `dhall-to-yaml` instead of `dhall-to-text` 13 | 14 | The NetHack configuration format fits both of these criteria. 15 | 16 | When writing complicated logic, be generous with names and create a lot of 17 | `let` bindings instead of creating giant right-hand-sides for your 18 | expressions. Abstraction is cheap in Dhall because all indirection can be 19 | eliminated via normalization. 20 | -} 21 | let Prelude = ../Prelude.dhall 22 | 23 | let types = ../types.dhall 24 | 25 | let renderOptions = ./Options.dhall 26 | 27 | let renderOptional = 28 | λ(a : Type) 29 | → λ(f : a → Text) 30 | → λ(optional : Optional a) 31 | → Optional/fold a optional Text (λ(x : a) → renderOptions (f x)) "" 32 | 33 | let renderNamedOptional = 34 | λ(a : Type) 35 | → λ(f : a → Text) 36 | → λ(name : Text) 37 | → renderOptional a (λ(x : a) → "${name}:${f x}") 38 | 39 | let renderOptionalText = renderNamedOptional Text (λ(x : Text) → x) 40 | 41 | let renderOptionalCharacter = renderNamedOptional Text (λ(x : Text) → "'${x}'") 42 | 43 | let renderOptionalBool = 44 | λ(name : Text) 45 | → renderOptional Bool (λ(enable : Bool) → "${./Bool.dhall enable}${name}") 46 | 47 | let renderOptionalNatural = renderNamedOptional Natural Natural/show 48 | 49 | let renderList = 50 | λ(a : Type) 51 | → λ(f : a → Text) 52 | → Prelude.Text.concatMap 53 | a 54 | ( λ(x : a) 55 | → '' 56 | ${f x} 57 | '' 58 | ) 59 | 60 | let renderOptionalEnabled = 61 | λ(a : Type) 62 | → λ(f : a → Text) 63 | → renderNamedOptional (types.Enabled a) (./Enabled.dhall a f) 64 | 65 | let renderOptionalTopLevel = 66 | λ(name : Text) 67 | → λ(x : Optional Text) 68 | → Optional/fold 69 | Text 70 | x 71 | Text 72 | ( λ(file : Text) 73 | → '' 74 | ${name}=${file} 75 | '' 76 | ) 77 | "" 78 | 79 | let renderAUTOCOMPLETES = renderList (types.Enabled Text) ./AUTOCOMPLETE.dhall 80 | 81 | let renderAlign = 82 | renderOptionalEnabled types.Alignment ./Alignment.dhall "align" 83 | 84 | let renderAutopickup = 85 | renderList types.AUTOPICKUP_EXCEPTION ./AUTOPICKUP_EXCEPTION.dhall 86 | 87 | let renderDisclose = 88 | renderNamedOptional types.Disclose.Type ./Disclose.dhall "disclose" 89 | 90 | let renderMenuColors = 91 | λ(x : List types.MenuColor) 92 | → if Prelude.List.null types.MenuColor x 93 | 94 | then "" 95 | 96 | else '' 97 | OPTIONS=menucolors 98 | ${renderList types.MenuColor ./MenuColor.dhall x}'' 99 | 100 | let renderMenuHeadings = 101 | renderNamedOptional 102 | types.MenuHeadings 103 | ./MenuHeadings.dhall 104 | "menu_headings" 105 | 106 | let renderMenuStyle = 107 | renderNamedOptional types.MenuStyle ./MenuStyle.dhall "menustyle" 108 | 109 | let renderMsgWindow = 110 | renderNamedOptional types.MsgWindow ./MsgWindow.dhall "msg_window" 111 | 112 | let renderNumberPad = 113 | renderNamedOptional types.NumberPad ./NumberPad.dhall "number_pad" 114 | 115 | let renderPetType = renderNamedOptional types.PetType ./PetType.dhall "pettype" 116 | 117 | let renderPickupBurden = 118 | renderNamedOptional 119 | types.PickupBurden 120 | ./PickupBurden.dhall 121 | "pickup_burden" 122 | 123 | let renderPileLimit = 124 | renderNamedOptional types.PileLimit ./PileLimit.dhall "pile_limit" 125 | 126 | let renderPlayMode = 127 | renderNamedOptional types.PlayMode ./PlayMode.dhall "playmode" 128 | 129 | let renderRunMode = renderNamedOptional types.RunMode ./RunMode.dhall "runmode" 130 | 131 | let renderSortLoot = 132 | renderNamedOptional types.SortLoot ./SortLoot.dhall "sortloot" 133 | 134 | let renderSOUND = renderList types.SOUND ./SOUND.dhall 135 | 136 | let renderOptionalSymSet = renderNamedOptional types.SymSet ./SymSet.dhall 137 | 138 | let renderWhatisCoord = 139 | renderNamedOptional types.WhatisCoord ./WhatisCoord.dhall "whatis_coord" 140 | 141 | let renderWhatisFilter = 142 | renderNamedOptional 143 | types.WhatisFilter 144 | ./WhatisFilter.dhall 145 | "whatis_filter" 146 | 147 | in λ(config : types.Config.Type) 148 | → renderAUTOCOMPLETES config.AUTOCOMPLETE 149 | ++ renderOptionalBool "acoustics" config.acoustics 150 | ++ renderAlign config.align 151 | ++ renderOptionalBool "autodescribe" config.autodescribe 152 | ++ renderOptionalBool "autodig" config.autodig 153 | ++ renderOptionalBool "autoopen" config.autoopen 154 | ++ renderOptionalBool "autopickup" config.autopickup 155 | ++ renderAutopickup config.AUTOPICKUP_EXCEPTION 156 | ++ renderOptionalBool "autoquiver" config.autoquiver 157 | ++ renderList types.BIND ./BIND.dhall config.BIND 158 | ++ renderOptionalBool "blind" config.blind 159 | ++ renderOptionalBool "bones" config.bones 160 | ++ renderOptionalText "catname" config.catname 161 | ++ renderOptionalBool "checkpoint" config.checkpoint 162 | ++ renderOptionalBool "checkspace" config.checkspace 163 | ++ renderOptionalBool "clicklook" config.clicklook 164 | ++ renderOptionalBool "cmdassist" config.cmdassist 165 | ++ renderOptionalBool "confirm" config.confirm 166 | ++ renderOptionalBool "dark_room" config.dark_room 167 | ++ renderDisclose config.disclose 168 | ++ renderOptionalText "dogname" config.dogname 169 | ++ renderOptionalBool "extmenu" config.extmenu 170 | ++ renderOptionalBool "fixinv" config.fixinv 171 | ++ renderOptionalBool "force_invmenu" config.force_invmenu 172 | ++ renderOptionalText "fruit" config.fruit 173 | ++ renderNamedOptional types.Gender ./Gender.dhall "gender" config.gender 174 | ++ renderOptionalBool "goldX" config.goldX 175 | ++ renderOptionalBool "help" config.help 176 | ++ renderOptionalBool "hilite_pet" config.hilite_pet 177 | ++ renderOptionalBool "hilite_pile" config.hilite_pile 178 | ++ ./HiliteStatus.dhall config.hilite_status 179 | ++ renderOptionalBool "hitpointbar" config.hitpointbar 180 | ++ renderOptionalText "horsename" config.horsename 181 | ++ renderOptionalBool "ignintr" config.ignintr 182 | ++ renderOptionalBool "implicit_uncursed" config.implicit_uncursed 183 | ++ renderOptionalBool "legacy" config.legacy 184 | ++ renderOptionalBool "lit_corridor" config.lit_corridor 185 | ++ renderOptionalBool "lootabc" config.lootabc 186 | ++ renderOptionalBool "mail" config.mail 187 | ++ renderOptionalBool "mention_walls" config.mention_walls 188 | ++ renderMenuColors config.menucolors 189 | ++ renderMenuStyle config.menustyle 190 | ++ renderOptionalCharacter "menu_deselect_all" config.menu_deselect_all 191 | ++ renderOptionalCharacter "menu_deselect_page" config.menu_deselect_page 192 | ++ renderOptionalCharacter "menu_first_page" config.menu_first_page 193 | ++ renderMenuHeadings config.menu_headings 194 | ++ renderOptionalCharacter "menu_invert_all" config.menu_invert_all 195 | ++ renderOptionalCharacter "menu_invert_page" config.menu_invert_page 196 | ++ renderOptionalCharacter "menu_last_page" config.menu_last_page 197 | ++ renderOptionalCharacter "menu_next_page" config.menu_next_page 198 | ++ renderOptionalBool "menu_objsyms" config.menu_objsyms 199 | ++ renderOptionalCharacter "menu_previous_page" config.menu_previous_page 200 | ++ renderOptionalCharacter "menu_search" config.menu_search 201 | ++ renderOptionalCharacter "menu_select_all" config.menu_select_all 202 | ++ renderOptionalCharacter "menu_select_page" config.menu_select_page 203 | ++ renderOptionalBool "menu_tab_sep" config.menu_tab_sep 204 | ++ renderOptionalNatural "msghistory" config.msghistory 205 | ++ renderMsgWindow config.msg_window 206 | ++ renderList types.MsgType ./MsgType.dhall config.MSGTYPE 207 | ++ renderOptionalText "name" config.name 208 | ++ renderOptionalBool "news" config.news 209 | ++ renderOptionalBool "nudist" config.nudist 210 | ++ renderOptionalBool "null" config.null 211 | ++ renderNumberPad config.number_pad 212 | ++ renderOptionalText "packorder" config.packorder 213 | ++ ./ParanoidConfirmation.dhall config.paranoid_confirmation 214 | ++ renderOptionalBool "perm_invent" config.perm_invent 215 | ++ renderPetType config.pettype 216 | ++ renderPickupBurden config.pickup_burden 217 | ++ renderOptionalBool "pickup_thrown" config.pickup_thrown 218 | ++ renderOptionalText "pickup_types" config.pickup_types 219 | ++ renderPileLimit config.pile_limit 220 | ++ renderPlayMode config.playmode 221 | ++ renderOptionalBool "pushweapon" config.pushweapon 222 | ++ renderOptionalEnabled types.Race ./Race.dhall "race" config.race 223 | ++ renderOptionalBool "rest_on_space" config.rest_on_space 224 | ++ renderOptionalEnabled types.Role ./Role.dhall "role" config.role 225 | ++ renderOptionalSymSet "roguesymset" config.roguesymset 226 | ++ renderOptionalBool "rlecomp" config.rlecomp 227 | ++ renderRunMode config.runmode 228 | ++ renderOptionalBool "safe_pet" config.safe_pet 229 | ++ renderOptionalBool "sanity_check" config.sanity_check 230 | ++ ./Scores.dhall config.scores 231 | ++ renderOptionalBool "showexp" config.showexp 232 | ++ renderOptionalBool "showrace" config.showrace 233 | ++ renderOptionalBool "showscore" config.showscore 234 | ++ renderOptionalBool "silent" config.silent 235 | ++ renderSortLoot config.sortloot 236 | ++ renderOptionalBool "sortpack" config.sortpack 237 | ++ renderSOUND config.SOUND 238 | ++ renderOptionalTopLevel "SOUNDDIR" config.SOUNDDIR 239 | ++ renderOptionalBool "sparkle" config.sparkle 240 | ++ renderOptionalBool "standout" config.standout 241 | ++ renderOptionalBool "status_updates" config.status_updates 242 | ++ renderOptionalNatural "statushilites" config.statushilites 243 | ++ renderOptionalText "suppress_alert" config.suppress_alert 244 | ++ renderOptionalSymSet "symset" config.symset 245 | ++ renderOptionalBool "time" config.time 246 | ++ renderOptionalBool "timed_delay" config.timed_delay 247 | ++ renderOptionalBool "tombstone" config.tombstone 248 | ++ renderOptionalBool "toptenwin" config.toptenwin 249 | ++ renderOptionalBool "travel" config.travel 250 | ++ renderOptionalBool "verbose" config.verbose 251 | ++ renderWhatisCoord config.whatis_coord 252 | ++ renderWhatisFilter config.whatis_filter 253 | ++ renderOptionalBool "whatis_menu" config.whatis_menu 254 | ++ renderOptionalBool "whatis_moveskip" config.whatis_moveskip 255 | ++ renderOptionalText "windowtype" config.windowtype 256 | ++ renderOptionalTopLevel "WIZKIT" config.wizkit 257 | ++ renderOptionalBool "zerocomp" config.zerocomp 258 | -------------------------------------------------------------------------------- /render/Disclose.dhall: -------------------------------------------------------------------------------- 1 | let Prelude = ../Prelude.dhall 2 | 3 | let types = ../types.dhall 4 | 5 | let renderDisclosure = ./Disclosure.dhall 6 | 7 | let renderOptionalDisclosure = 8 | λ(suffix : Text) 9 | → λ(x : Optional types.Disclosure) 10 | → Optional/fold 11 | types.Disclosure 12 | x 13 | (List Text) 14 | (λ(d : types.Disclosure) → [ "${renderDisclosure d}${suffix}" ]) 15 | ([] : List Text) 16 | 17 | in λ(x : types.Disclose.Type) 18 | → Prelude.Text.concatSep 19 | " " 20 | ( renderOptionalDisclosure "i" x.inventory 21 | # renderOptionalDisclosure "a" x.attributes 22 | # renderOptionalDisclosure "v" x.monsters_killed 23 | # renderOptionalDisclosure "g" x.monsters_genocided 24 | # renderOptionalDisclosure "c" x.conduct 25 | # renderOptionalDisclosure "o" x.dungeon_overview 26 | ) 27 | -------------------------------------------------------------------------------- /render/Disclosure.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Disclosure) 4 | → if x.prompt 5 | 6 | then if x.default then "y" else "n" 7 | 8 | else if x.default 9 | 10 | then "+" 11 | 12 | else "-" 13 | -------------------------------------------------------------------------------- /render/Enabled.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(a : Type) 4 | → λ(f : a → Text) 5 | → λ(x : types.Enabled a) 6 | → "${./Bool.dhall x.enable}${f x.value}" 7 | -------------------------------------------------------------------------------- /render/Gender.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Gender) 4 | → merge { male = "male", female = "female", random = "random" } x 5 | -------------------------------------------------------------------------------- /render/Hilite.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(a : Type) 4 | → λ(renderTrigger : a → Text) 5 | → λ(hilite : types.Hilite a) 6 | → let trigger = 7 | Optional/fold 8 | a 9 | hilite.trigger 10 | Text 11 | (λ(trigger : a) → "/${renderTrigger trigger}") 12 | "" 13 | 14 | let attributes = 15 | Optional/fold 16 | types.Attributes.Type 17 | hilite.attributes 18 | Text 19 | (λ(a : types.Attributes.Type) → "&${./Attributes.dhall a}") 20 | "" 21 | 22 | let color = "/${./Color.dhall hilite.color}" 23 | 24 | in "${trigger}${color}${attributes}" 25 | -------------------------------------------------------------------------------- /render/HiliteStatus.dhall: -------------------------------------------------------------------------------- 1 | let Prelude = ../Prelude.dhall 2 | 3 | let types = ../types.dhall 4 | 5 | in λ(x : types.HiliteStatus.Type) 6 | → let renderHilites = 7 | λ(a : Type) 8 | → λ(renderTrigger : a → Text) 9 | → λ(field : Text) 10 | → Prelude.Text.concatMap 11 | (types.Hilite a) 12 | ( λ(h : types.Hilite a) 13 | → ./Options.dhall 14 | "hilite_status:${field}${./Hilite.dhall 15 | a 16 | renderTrigger 17 | h}" 18 | ) 19 | 20 | let renderTextualHilites = renderHilites types.Textual ./Textual.dhall 21 | 22 | let renderNumericHilites = renderHilites types.Numeric ./Numeric.dhall 23 | 24 | let renderPercentHilites = renderHilites types.Percent ./Percent.dhall 25 | 26 | let renderConditionHilites = 27 | renderHilites types.Condition ./Condition.dhall 28 | 29 | in renderTextualHilites "title" x.title 30 | ++ renderNumericHilites "strength" x.strength 31 | ++ renderNumericHilites "dexterity" x.dexterity 32 | ++ renderNumericHilites "constitution" x.constitution 33 | ++ renderNumericHilites "intelligence" x.intelligence 34 | ++ renderNumericHilites "wisdom" x.wisdom 35 | ++ renderNumericHilites "charisma" x.charisma 36 | ++ renderNumericHilites "characteristics" x.characteristics 37 | ++ renderTextualHilites "alignment" x.alignment 38 | ++ renderNumericHilites "score" x.score 39 | ++ renderTextualHilites "carrying-capacity" x.carrying-capacity 40 | ++ renderNumericHilites "gold" x.gold 41 | ++ renderPercentHilites "power" x.power 42 | ++ renderNumericHilites "power-max" x.power-max 43 | ++ renderNumericHilites "experience-level" x.experience-level 44 | ++ renderNumericHilites "armor-class" x.armor-class 45 | ++ renderNumericHilites "HD" x.HD 46 | ++ renderNumericHilites "time" x.time 47 | ++ renderTextualHilites "hunger" x.hunger 48 | ++ renderPercentHilites "hitpoints" x.hitpoints 49 | ++ renderNumericHilites "hitpoints-max" x.hitpoints-max 50 | ++ renderNumericHilites "dungeon-level" x.dungeon-level 51 | ++ renderNumericHilites "experience" x.experience 52 | ++ renderConditionHilites "condition" x.condition 53 | -------------------------------------------------------------------------------- /render/MenuColor.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.MenuColor) 4 | → let attributes = ./Attributes.dhall x.attributes 5 | 6 | let suffix = 7 | Optional/fold 8 | types.Color 9 | x.color 10 | Text 11 | (λ(c : types.Color) → "${./Color.dhall c}&${attributes}") 12 | attributes 13 | 14 | in "MENUCOLOR=\"${x.regex}\"=${suffix}" 15 | -------------------------------------------------------------------------------- /render/MenuHeadings.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.MenuHeadings) 4 | → merge { bold = "bold", inverse = "inverse", underline = "underline" } x 5 | -------------------------------------------------------------------------------- /render/MenuStyle.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.MenuStyle) 4 | → merge 5 | { traditional = "traditional" 6 | , combination = "combination" 7 | , partial = "partial" 8 | , full = "full" 9 | } 10 | x 11 | -------------------------------------------------------------------------------- /render/MsgType.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.MsgType) 4 | → let value = 5 | merge 6 | { hide = λ(t : Text) → "hide \"${t}\"" 7 | , stop = λ(t : Text) → "stop \"${t}\"" 8 | , norep = λ(t : Text) → "norep \"${t}\"" 9 | , show = λ(t : Text) → "show \"${t}\"" 10 | } 11 | x 12 | 13 | in "MSGTYPE=${value}" 14 | -------------------------------------------------------------------------------- /render/MsgWindow.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.MsgWindow) 4 | → merge 5 | { single = "single" 6 | , combination = "combination" 7 | , full = "full" 8 | , reversed = "reversed" 9 | } 10 | x 11 | -------------------------------------------------------------------------------- /render/NumberPad.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.NumberPad) 4 | → merge 5 | { Letters = "0" 6 | , Numbers_5_is_G = "1" 7 | , Numbers_5_is_g = "2" 8 | , PhoneKeys = "3" 9 | , PhoneKeys_MSDOS = "4" 10 | , Letters_z_is_NW = "-1" 11 | } 12 | x 13 | -------------------------------------------------------------------------------- /render/Numeric.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | let renderComparison = ./Comparison.dhall 4 | 5 | in λ(x : types.Numeric) 6 | → merge 7 | { always = "always" 8 | , up = "up" 9 | , down = "down" 10 | , changed = "changed" 11 | , number = renderComparison 12 | } 13 | x 14 | -------------------------------------------------------------------------------- /render/Options.dhall: -------------------------------------------------------------------------------- 1 | λ(options : Text) 2 | → '' 3 | OPTIONS=${options} 4 | '' 5 | -------------------------------------------------------------------------------- /render/ParanoidConfirmation.dhall: -------------------------------------------------------------------------------- 1 | let Prelude = ../Prelude.dhall 2 | 3 | let types = ../types.dhall 4 | 5 | let renderConfirmation = 6 | λ(name : Text) 7 | → λ(o : Optional Bool) 8 | → Optional/fold 9 | Bool 10 | o 11 | (List Text) 12 | (λ(b : Bool) → if b then [ name ] else [] : List Text) 13 | ([] : List Text) 14 | 15 | in λ(x : types.ParanoidConfirmation.Type) 16 | → let confirmations = 17 | renderConfirmation "Confirm" x.Confirm 18 | # renderConfirmation "quit" x.quit 19 | # renderConfirmation "die" x.die 20 | # renderConfirmation "bones" x.bones 21 | # renderConfirmation "attack" x.attack 22 | # renderConfirmation "pray" x.pray 23 | # renderConfirmation "wand-break" x.wand-break 24 | # renderConfirmation "Were-change" x.Were-change 25 | # renderConfirmation "Remove" x.Remove 26 | # renderConfirmation "all" x.all 27 | 28 | in if Prelude.List.null Text confirmations 29 | 30 | then "" 31 | 32 | else '' 33 | OPTIONS=paranoid_confirmation:${Prelude.Text.concatSep 34 | " " 35 | confirmations} 36 | '' 37 | -------------------------------------------------------------------------------- /render/Percent.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | let renderComparison = ./Comparison.dhall 4 | 5 | in λ(x : types.Percent) 6 | → merge 7 | { always = "always" 8 | , up = "up" 9 | , down = "down" 10 | , changed = "changed" 11 | , percentage = 12 | λ(comparison : types.Comparison) → "${renderComparison comparison}%" 13 | , number = renderComparison 14 | } 15 | x 16 | -------------------------------------------------------------------------------- /render/PetType.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.PetType) → merge { cat = "cat", dog = "dog", none = "none" } x 4 | -------------------------------------------------------------------------------- /render/PickupBurden.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.PickupBurden) 4 | → merge 5 | { unencumbered = "U" 6 | , burdened = "B" 7 | , stressed = "S" 8 | , strained = "N" 9 | , overtaxed = "O" 10 | , overloaded = "L" 11 | } 12 | x 13 | -------------------------------------------------------------------------------- /render/PileLimit.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.PileLimit) → merge { unlimited = "0", limit = Natural/show } x 4 | -------------------------------------------------------------------------------- /render/PlayMode.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.PlayMode) 4 | → merge { normal = "normal", explore = "explore", debug = "debug" } x 5 | -------------------------------------------------------------------------------- /render/Race.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Race) 4 | → merge 5 | { human = "human" 6 | , elf = "elf" 7 | , dwarf = "dwarf" 8 | , gnome = "gnome" 9 | , orc = "orc" 10 | , random = "random" 11 | } 12 | x 13 | -------------------------------------------------------------------------------- /render/Role.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Role) 4 | → merge 5 | { archaeologist = "archaeologist" 6 | , barbarian = "barbarian" 7 | , caveman = "caveman" 8 | , healer = "healer" 9 | , knight = "knight" 10 | , monk = "monk" 11 | , priest = "priest" 12 | , ranger = "ranger" 13 | , rogue = "rogue" 14 | , samurai = "samurai" 15 | , tourist = "tourist" 16 | , valkyrie = "valkyrie" 17 | , wizard = "wizard" 18 | } 19 | x 20 | -------------------------------------------------------------------------------- /render/RunMode.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.RunMode) 4 | → merge 5 | { teleport = "teleport", run = "run", walk = "walk", crawl = "crawl" } 6 | x 7 | -------------------------------------------------------------------------------- /render/SOUND.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.SOUND) 4 | → "SOUND=MESG \"${x.regex}\" \"${x.filename}\" ${Natural/show x.volume}" 5 | -------------------------------------------------------------------------------- /render/Scores.dhall: -------------------------------------------------------------------------------- 1 | let Prelude = ../Prelude.dhall 2 | 3 | let types = ../types.dhall 4 | 5 | in λ(x : types.Scores.Type) 6 | → let own = 7 | Optional/fold 8 | Bool 9 | x.own 10 | (List Text) 11 | (λ(b : Bool) → [ "${./Bool.dhall b}o" ]) 12 | ([] : List Text) 13 | 14 | let around = 15 | Optional/fold 16 | Natural 17 | x.around 18 | (List Text) 19 | (λ(n : Natural) → [ "${Natural/show n}a" ]) 20 | ([] : List Text) 21 | 22 | let top = 23 | Optional/fold 24 | Natural 25 | x.top 26 | (List Text) 27 | (λ(n : Natural) → [ "${Natural/show n}t" ]) 28 | ([] : List Text) 29 | 30 | let scores = own # around # top 31 | 32 | in if Prelude.List.null Text scores 33 | 34 | then "" 35 | 36 | else '' 37 | OPTIONS=scores:${Prelude.Text.concatSep " " scores} 38 | '' 39 | -------------------------------------------------------------------------------- /render/SortLoot.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.SortLoot) 4 | → merge { full = "full", loot = "loot", none = "none" } x 5 | -------------------------------------------------------------------------------- /render/SymSet.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.SymSet) 4 | → merge 5 | { NHAccess = "NHAccess" 6 | , MACgraphics = "MACgraphics" 7 | , IBMGraphics_2 = "IBMGraphics_2" 8 | , IBMGraphics_1 = "IBMGraphics_1" 9 | , IBMgraphics = "IBMgraphics" 10 | , DECgraphics = "DECgraphics" 11 | , RogueWindows = "RogueWindows" 12 | , RogueEpyx = "RogueEpyx" 13 | , RogueIBM = "RogueIBM" 14 | } 15 | x 16 | -------------------------------------------------------------------------------- /render/Textual.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.Textual) 4 | → merge 5 | { always = "always" 6 | , up = "up" 7 | , down = "down" 8 | , changed = "changed" 9 | , string = λ(text : Text) → text 10 | } 11 | x 12 | -------------------------------------------------------------------------------- /render/WhatisCoord.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.WhatisCoord) 4 | → merge { compass = "c", full = "f", map = "m", screen = "s", none = "n" } x 5 | -------------------------------------------------------------------------------- /render/WhatisFilter.dhall: -------------------------------------------------------------------------------- 1 | let types = ../types.dhall 2 | 3 | in λ(x : types.WhatisFilter) 4 | → merge { no_filtering = "n", view_only = "v", same_area = "a" } x 5 | -------------------------------------------------------------------------------- /toNetHack.dhall: -------------------------------------------------------------------------------- 1 | -- This is file just a convenient import synonym 2 | ./render/Config.dhall 3 | -------------------------------------------------------------------------------- /types.dhall: -------------------------------------------------------------------------------- 1 | {- This provides a convenient import to obtain all available types 2 | 3 | Users will typically use this import to access constructors for various 4 | union types, like this: 5 | 6 | ``` 7 | let types = ./types.dhall 8 | 9 | in types.Config::{ role = Some { enable = True, value = types.Role.wizard } } 10 | ``` 11 | 12 | This import is also used internally within the package as a convenient 13 | import for all available types. 14 | -} 15 | 16 | { Alignment = ./types/Alignment.dhall 17 | , Attributes = ./types/Attributes.dhall 18 | , AUTOPICKUP_EXCEPTION = ./types/AUTOPICKUP_EXCEPTION.dhall 19 | , BIND = ./types/BIND.dhall 20 | , Color = ./types/Color.dhall 21 | , Comparison = ./types/Comparison.dhall 22 | , Condition = ./types/Condition.dhall 23 | , Config = ./types/Config.dhall 24 | , Disclose = ./types/Disclose.dhall 25 | , Disclosure = ./types/Disclosure.dhall 26 | , Enabled = ./types/Enabled.dhall 27 | , Gender = ./types/Gender.dhall 28 | , Hilite = ./types/Hilite.dhall 29 | , HiliteStatus = ./types/HiliteStatus.dhall 30 | , MenuColor = ./types/MenuColor.dhall 31 | , MenuHeadings = ./types/MenuHeadings.dhall 32 | , MenuStyle = ./types/MenuStyle.dhall 33 | , MsgType = ./types/MsgType.dhall 34 | , MsgWindow = ./types/MsgWindow.dhall 35 | , NumberPad = ./types/NumberPad.dhall 36 | , Numeric = ./types/Numeric.dhall 37 | , ParanoidConfirmation = ./types/ParanoidConfirmation.dhall 38 | , Percent = ./types/Percent.dhall 39 | , PetType = ./types/PetType.dhall 40 | , PickupBurden = ./types/PickupBurden.dhall 41 | , PileLimit = ./types/PileLimit.dhall 42 | , PlayMode = ./types/PlayMode.dhall 43 | , Race = ./types/Race.dhall 44 | , Role = ./types/Role.dhall 45 | , RunMode = ./types/RunMode.dhall 46 | , Scores = ./types/Scores.dhall 47 | , SortLoot = ./types/SortLoot.dhall 48 | , SOUND = ./types/SOUND.dhall 49 | , SymSet = ./types/SymSet.dhall 50 | , Textual = ./types/Textual.dhall 51 | , WhatisCoord = ./types/WhatisCoord.dhall 52 | , WhatisFilter = ./types/WhatisFilter.dhall 53 | } 54 | -------------------------------------------------------------------------------- /types/AUTOPICKUP_EXCEPTION.dhall: -------------------------------------------------------------------------------- 1 | { pickup : Bool, name : Text } 2 | -------------------------------------------------------------------------------- /types/Alignment.dhall: -------------------------------------------------------------------------------- 1 | < lawful | neutral | chaotic | random > 2 | -------------------------------------------------------------------------------- /types/Attributes.dhall: -------------------------------------------------------------------------------- 1 | {- We don't use a `List` to represent the attributes since that would permit 2 | setting the same attribute multiple times. Instead we use a record where 3 | each attribute can be specified at most one time. 4 | -} 5 | 6 | { Type = 7 | { bold : Optional Bool 8 | , inverse : Optional Bool 9 | , underline : Optional Bool 10 | , blink : Optional Bool 11 | , dim : Optional Bool 12 | } 13 | , default = 14 | { bold = None Bool 15 | , inverse = None Bool 16 | , underline = None Bool 17 | , blink = None Bool 18 | , dim = None Bool 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /types/BIND.dhall: -------------------------------------------------------------------------------- 1 | { keybinding : Text, command : Text } 2 | -------------------------------------------------------------------------------- /types/Color.dhall: -------------------------------------------------------------------------------- 1 | < black 2 | | red 3 | | green 4 | | brown 5 | | blue 6 | | magenta 7 | | cyan 8 | | gray 9 | | orange 10 | | lightgreen 11 | | yellow 12 | | lightblue 13 | | lightmagenta 14 | | lightcyan 15 | | white 16 | > 17 | -------------------------------------------------------------------------------- /types/Comparison.dhall: -------------------------------------------------------------------------------- 1 | {- This type could also have been encoded as: 2 | 3 | ``` 4 | { comparison : 5 | < EqualTo | LessThanOrEqualTo | GreaterThanOrEqualTo > 6 | , amount : 7 | Natural 8 | } 9 | ``` 10 | 11 | I chose to embed the `Natural` in each union alternative since it requires 12 | less typing and reads more naturally. For example, compare this: 13 | 14 | ``` 15 | { comparison = Operator.LessThanOrEqualTo, value = 5 } 16 | ``` 17 | 18 | ... to this: 19 | 20 | ``` 21 | Comparison.LessThanOrEqualTo 5 22 | ``` 23 | -} 24 | 25 | < EqualTo : Natural 26 | | LessThanOrEqualTo : Natural 27 | | GreaterThanOrEqualTo : Natural 28 | > 29 | -------------------------------------------------------------------------------- /types/Condition.dhall: -------------------------------------------------------------------------------- 1 | < always 2 | | stone 3 | | slime 4 | | strngl 5 | | foodpois 6 | | termill 7 | | blind 8 | | deaf 9 | | stun 10 | | conf 11 | | hallu 12 | | lev 13 | | fly 14 | | ride 15 | | major_troubles 16 | | minor_troubles 17 | | movement 18 | | all 19 | > 20 | -------------------------------------------------------------------------------- /types/Config.dhall: -------------------------------------------------------------------------------- 1 | {- Almost all of the fields are either `Optional` values or `List`s so that 2 | these fields can be omitted from the generated NetHack configuration file if 3 | left empty. 4 | 5 | The few fields that are not wrapped in `Optional` or `List` are records 6 | whose fields are also all `List` or `Optional` values. For example, the 7 | `Scores` type is defined as: 8 | 9 | ``` 10 | { own : Optional Bool, around : Optional Natural, top : Optional Natural } 11 | ``` 12 | 13 | If all of those fields are `None` then the `scores` option will omitted 14 | from the generated NetHack configuration file, so there is no need to wrap 15 | the `Scores` type in yet another `Optional`. 16 | -} 17 | let Alignment = ./Alignment.dhall 18 | 19 | let AUTOPICKUP_EXCEPTION = ./AUTOPICKUP_EXCEPTION.dhall 20 | 21 | let BIND = ./BIND.dhall 22 | 23 | let Disclose = ./Disclose.dhall 24 | 25 | let Enabled = ./Enabled.dhall 26 | 27 | let Gender = ./Gender.dhall 28 | 29 | let HiliteStatus = ./HiliteStatus.dhall 30 | 31 | let MenuColor = ./MenuColor.dhall 32 | 33 | let MenuStyle = ./MenuStyle.dhall 34 | 35 | let MenuHeadings = ./MenuHeadings.dhall 36 | 37 | let MsgWindow = ./MsgWindow.dhall 38 | 39 | let MsgType = ./MsgType.dhall 40 | 41 | let NumberPad = ./NumberPad.dhall 42 | 43 | let ParanoidConfirmation = ./ParanoidConfirmation.dhall 44 | 45 | let PetType = ./PetType.dhall 46 | 47 | let PickupBurden = ./PickupBurden.dhall 48 | 49 | let PileLimit = ./PileLimit.dhall 50 | 51 | let PlayMode = ./PlayMode.dhall 52 | 53 | let Race = ./Race.dhall 54 | 55 | let Role = ./Role.dhall 56 | 57 | let RunMode = ./RunMode.dhall 58 | 59 | let Scores = ./Scores.dhall 60 | 61 | let SortLoot = ./SortLoot.dhall 62 | 63 | let SOUND = ./SOUND.dhall 64 | 65 | let SymSet = ./SymSet.dhall 66 | 67 | let WhatisCoord = ./WhatisCoord.dhall 68 | 69 | let WhatisFilter = ./WhatisFilter.dhall 70 | 71 | in { Type = 72 | { AUTOCOMPLETE : List (Enabled Text) 73 | , acoustics : Optional Bool 74 | , align : Optional (Enabled Alignment) 75 | , autodescribe : Optional Bool 76 | , autodig : Optional Bool 77 | , autoopen : Optional Bool 78 | , autopickup : Optional Bool 79 | , AUTOPICKUP_EXCEPTION : List AUTOPICKUP_EXCEPTION 80 | , autoquiver : Optional Bool 81 | , BIND : List BIND 82 | , blind : Optional Bool 83 | , bones : Optional Bool 84 | , catname : Optional Text 85 | , checkpoint : Optional Bool 86 | , checkspace : Optional Bool 87 | , clicklook : Optional Bool 88 | , cmdassist : Optional Bool 89 | , confirm : Optional Bool 90 | , dark_room : Optional Bool 91 | , disclose : Optional Disclose.Type 92 | , dogname : Optional Text 93 | , extmenu : Optional Bool 94 | , fixinv : Optional Bool 95 | , force_invmenu : Optional Bool 96 | , fruit : Optional Text 97 | , gender : Optional Gender 98 | , goldX : Optional Bool 99 | , help : Optional Bool 100 | , hilite_pet : Optional Bool 101 | , hilite_pile : Optional Bool 102 | , hilite_status : HiliteStatus.Type 103 | , hitpointbar : Optional Bool 104 | , horsename : Optional Text 105 | , ignintr : Optional Bool 106 | , implicit_uncursed : Optional Bool 107 | , legacy : Optional Bool 108 | , lit_corridor : Optional Bool 109 | , lootabc : Optional Bool 110 | , mail : Optional Bool 111 | , mention_walls : Optional Bool 112 | , menucolors : List MenuColor 113 | , menustyle : Optional MenuStyle 114 | , menu_deselect_all : Optional Text 115 | , menu_deselect_page : Optional Text 116 | , menu_first_page : Optional Text 117 | , menu_headings : Optional MenuHeadings 118 | , menu_invert_all : Optional Text 119 | , menu_invert_page : Optional Text 120 | , menu_last_page : Optional Text 121 | , menu_next_page : Optional Text 122 | , menu_objsyms : Optional Bool 123 | , menu_previous_page : Optional Text 124 | , menu_search : Optional Text 125 | , menu_select_all : Optional Text 126 | , menu_select_page : Optional Text 127 | , menu_tab_sep : Optional Bool 128 | , msghistory : Optional Natural 129 | , msg_window : Optional MsgWindow 130 | , MSGTYPE : List MsgType 131 | , name : Optional Text 132 | , news : Optional Bool 133 | , nudist : Optional Bool 134 | , null : Optional Bool 135 | , number_pad : Optional NumberPad 136 | , packorder : Optional Text 137 | , paranoid_confirmation : ParanoidConfirmation.Type 138 | , perm_invent : Optional Bool 139 | , pettype : Optional PetType 140 | , pickup_burden : Optional PickupBurden 141 | , pickup_thrown : Optional Bool 142 | , pickup_types : Optional Text 143 | , pile_limit : Optional PileLimit 144 | , playmode : Optional PlayMode 145 | , pushweapon : Optional Bool 146 | , race : Optional (Enabled Race) 147 | , rest_on_space : Optional Bool 148 | , role : Optional (Enabled Role) 149 | , roguesymset : Optional SymSet 150 | , rlecomp : Optional Bool 151 | , runmode : Optional RunMode 152 | , safe_pet : Optional Bool 153 | , sanity_check : Optional Bool 154 | , scores : Scores.Type 155 | , showexp : Optional Bool 156 | , showrace : Optional Bool 157 | , showscore : Optional Bool 158 | , silent : Optional Bool 159 | , sortloot : Optional SortLoot 160 | , sortpack : Optional Bool 161 | , SOUNDDIR : Optional Text 162 | , SOUND : List SOUND 163 | , sparkle : Optional Bool 164 | , standout : Optional Bool 165 | , status_updates : Optional Bool 166 | , statushilites : Optional Natural 167 | , suppress_alert : Optional Text 168 | , symset : Optional SymSet 169 | , time : Optional Bool 170 | , timed_delay : Optional Bool 171 | , tombstone : Optional Bool 172 | , toptenwin : Optional Bool 173 | , travel : Optional Bool 174 | , verbose : Optional Bool 175 | , whatis_coord : Optional WhatisCoord 176 | , whatis_filter : Optional WhatisFilter 177 | , whatis_menu : Optional Bool 178 | , whatis_moveskip : Optional Bool 179 | , windowtype : Optional Text 180 | , wizkit : Optional Text 181 | , zerocomp : Optional Bool 182 | } 183 | , default = 184 | { AUTOCOMPLETE = [] : List (Enabled Text) 185 | , acoustics = None Bool 186 | , align = None (Enabled Alignment) 187 | , autodescribe = None Bool 188 | , autodig = None Bool 189 | , autoopen = None Bool 190 | , autopickup = None Bool 191 | , AUTOPICKUP_EXCEPTION = [] : List AUTOPICKUP_EXCEPTION 192 | , autoquiver = None Bool 193 | , BIND = [] : List BIND 194 | , blind = None Bool 195 | , bones = None Bool 196 | , catname = None Text 197 | , checkpoint = None Bool 198 | , checkspace = None Bool 199 | , clicklook = None Bool 200 | , cmdassist = None Bool 201 | , confirm = None Bool 202 | , dark_room = None Bool 203 | , disclose = None Disclose.Type 204 | , dogname = None Text 205 | , extmenu = None Bool 206 | , fixinv = None Bool 207 | , force_invmenu = None Bool 208 | , fruit = None Text 209 | , gender = None Gender 210 | , goldX = None Bool 211 | , help = None Bool 212 | , hilite_pet = None Bool 213 | , hilite_pile = None Bool 214 | , hilite_status = HiliteStatus.default 215 | , hitpointbar = None Bool 216 | , horsename = None Text 217 | , ignintr = None Bool 218 | , implicit_uncursed = None Bool 219 | , legacy = None Bool 220 | , lit_corridor = None Bool 221 | , lootabc = None Bool 222 | , mail = None Bool 223 | , mention_walls = None Bool 224 | , menucolors = [] : List MenuColor 225 | , menustyle = None MenuStyle 226 | , menu_deselect_all = None Text 227 | , menu_deselect_page = None Text 228 | , menu_first_page = None Text 229 | , menu_headings = None MenuHeadings 230 | , menu_invert_all = None Text 231 | , menu_invert_page = None Text 232 | , menu_last_page = None Text 233 | , menu_next_page = None Text 234 | , menu_objsyms = None Bool 235 | , menu_previous_page = None Text 236 | , menu_search = None Text 237 | , menu_select_all = None Text 238 | , menu_select_page = None Text 239 | , menu_tab_sep = None Bool 240 | , msghistory = None Natural 241 | , msg_window = None MsgWindow 242 | , MSGTYPE = [] : List MsgType 243 | , name = None Text 244 | , news = None Bool 245 | , nudist = None Bool 246 | , null = None Bool 247 | , number_pad = None NumberPad 248 | , packorder = None Text 249 | , paranoid_confirmation = ParanoidConfirmation.default 250 | , perm_invent = None Bool 251 | , pettype = None PetType 252 | , pickup_burden = None PickupBurden 253 | , pickup_thrown = None Bool 254 | , pickup_types = None Text 255 | , pile_limit = None PileLimit 256 | , playmode = None PlayMode 257 | , pushweapon = None Bool 258 | , race = None (Enabled Race) 259 | , rest_on_space = None Bool 260 | , role = None (Enabled Role) 261 | , roguesymset = None SymSet 262 | , rlecomp = None Bool 263 | , runmode = None RunMode 264 | , safe_pet = None Bool 265 | , sanity_check = None Bool 266 | , scores = Scores.default 267 | , showexp = None Bool 268 | , showrace = None Bool 269 | , showscore = None Bool 270 | , silent = None Bool 271 | , sortloot = None SortLoot 272 | , sortpack = None Bool 273 | , SOUNDDIR = None Text 274 | , SOUND = [] : List SOUND 275 | , sparkle = None Bool 276 | , standout = None Bool 277 | , status_updates = None Bool 278 | , statushilites = None Natural 279 | , suppress_alert = None Text 280 | , symset = None SymSet 281 | , time = None Bool 282 | , timed_delay = None Bool 283 | , tombstone = None Bool 284 | , toptenwin = None Bool 285 | , travel = None Bool 286 | , verbose = None Bool 287 | , whatis_coord = None WhatisCoord 288 | , whatis_filter = None WhatisFilter 289 | , whatis_menu = None Bool 290 | , whatis_moveskip = None Bool 291 | , windowtype = None Text 292 | , wizkit = None Text 293 | , zerocomp = None Bool 294 | } 295 | } 296 | -------------------------------------------------------------------------------- /types/Disclose.dhall: -------------------------------------------------------------------------------- 1 | let Disclosure = ./Disclosure.dhall 2 | 3 | in { Type = 4 | { inventory : Optional Disclosure 5 | , attributes : Optional Disclosure 6 | , monsters_killed : Optional Disclosure 7 | , monsters_genocided : Optional Disclosure 8 | , conduct : Optional Disclosure 9 | , dungeon_overview : Optional Disclosure 10 | } 11 | , default = 12 | { inventory = None Disclosure 13 | , attributes = None Disclosure 14 | , monsters_killed = None Disclosure 15 | , monsters_genocided = None Disclosure 16 | , conduct = None Disclosure 17 | , dungeon_overview = None Disclosure 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /types/Disclosure.dhall: -------------------------------------------------------------------------------- 1 | { prompt : Bool, default : Bool } 2 | -------------------------------------------------------------------------------- /types/Enabled.dhall: -------------------------------------------------------------------------------- 1 | λ(a : Type) → { enable : Bool, value : a } 2 | -------------------------------------------------------------------------------- /types/Gender.dhall: -------------------------------------------------------------------------------- 1 | < male | female | random > 2 | -------------------------------------------------------------------------------- /types/Hilite.dhall: -------------------------------------------------------------------------------- 1 | {- This is a type-level function used within `./HiliteStatus.dhall` to reduce 2 | repetition 3 | -} 4 | 5 | let Color = ./Color.dhall 6 | 7 | let Attributes = ./Attributes.dhall 8 | 9 | in λ(trigger : Type) 10 | → { trigger : Optional trigger 11 | , color : Color 12 | , attributes : Optional Attributes.Type 13 | } 14 | -------------------------------------------------------------------------------- /types/HiliteStatus.dhall: -------------------------------------------------------------------------------- 1 | {- Each status has a different type of trigger (i.e. `Textual`, `Numeric`, 2 | etc.), which ensures that the user can't specify the wrong type of trigger 3 | for each option. 4 | 5 | For example, if the user tries to specify a numeric trigger for the title 6 | field, like this: 7 | 8 | ``` 9 | let types = ./types.dhall 10 | 11 | in types.Config::{ 12 | , hilite_status = 13 | types.HiliteStatus::{ 14 | , title = 15 | [ { trigger = 16 | Some (types.Numeric.number (types.Comparison.EqualTo 5)) 17 | , color = 18 | types.Color.blue 19 | , attributes = 20 | None types.Attributes.Type 21 | } 22 | ] 23 | } 24 | } 25 | ``` 26 | 27 | ... then they will get a type error like this: 28 | 29 | ``` 30 | Error: Expression doesn't match annotation 31 | 32 | { title : … 33 | { trigger : … 34 | < - string : … 35 | | + number : … 36 | | … 37 | > 38 | , … 39 | } 40 | , … 41 | } 42 | -} 43 | 44 | let Hilite = ./Hilite.dhall 45 | 46 | let Textual = ./Textual.dhall 47 | 48 | let Numeric = ./Numeric.dhall 49 | 50 | let Percent = ./Percent.dhall 51 | 52 | let Condition = ./Condition.dhall 53 | 54 | in { Type = 55 | { title : List (Hilite Textual) 56 | , strength : List (Hilite Numeric) 57 | , dexterity : List (Hilite Numeric) 58 | , constitution : List (Hilite Numeric) 59 | , intelligence : List (Hilite Numeric) 60 | , wisdom : List (Hilite Numeric) 61 | , charisma : List (Hilite Numeric) 62 | , characteristics : List (Hilite Numeric) 63 | , alignment : List (Hilite Textual) 64 | , score : List (Hilite Numeric) 65 | , carrying-capacity : List (Hilite Textual) 66 | , gold : List (Hilite Numeric) 67 | , power : List (Hilite Percent) 68 | , power-max : List (Hilite Numeric) 69 | , experience-level : List (Hilite Numeric) 70 | , armor-class : List (Hilite Numeric) 71 | , HD : List (Hilite Numeric) 72 | , time : List (Hilite Numeric) 73 | , hunger : List (Hilite Textual) 74 | , hitpoints : List (Hilite Percent) 75 | , hitpoints-max : List (Hilite Numeric) 76 | , dungeon-level : List (Hilite Numeric) 77 | , experience : List (Hilite Numeric) 78 | , condition : List (Hilite Condition) 79 | } 80 | , default = 81 | { title = [] : List (Hilite Textual) 82 | , strength = [] : List (Hilite Numeric) 83 | , dexterity = [] : List (Hilite Numeric) 84 | , constitution = [] : List (Hilite Numeric) 85 | , intelligence = [] : List (Hilite Numeric) 86 | , wisdom = [] : List (Hilite Numeric) 87 | , charisma = [] : List (Hilite Numeric) 88 | , characteristics = [] : List (Hilite Numeric) 89 | , alignment = [] : List (Hilite Textual) 90 | , score = [] : List (Hilite Numeric) 91 | , carrying-capacity = [] : List (Hilite Textual) 92 | , gold = [] : List (Hilite Numeric) 93 | , power = [] : List (Hilite Percent) 94 | , power-max = [] : List (Hilite Numeric) 95 | , experience-level = [] : List (Hilite Numeric) 96 | , armor-class = [] : List (Hilite Numeric) 97 | , HD = [] : List (Hilite Numeric) 98 | , time = [] : List (Hilite Numeric) 99 | , hunger = [] : List (Hilite Textual) 100 | , hitpoints = [] : List (Hilite Percent) 101 | , hitpoints-max = [] : List (Hilite Numeric) 102 | , dungeon-level = [] : List (Hilite Numeric) 103 | , experience = [] : List (Hilite Numeric) 104 | , condition = [] : List (Hilite Condition) 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /types/MenuColor.dhall: -------------------------------------------------------------------------------- 1 | let Color = ./Color.dhall 2 | 3 | let Attributes = ./Attributes.dhall 4 | 5 | in { regex : Text, color : Optional Color, attributes : Attributes.Type } 6 | -------------------------------------------------------------------------------- /types/MenuHeadings.dhall: -------------------------------------------------------------------------------- 1 | < bold | inverse | underline > 2 | -------------------------------------------------------------------------------- /types/MenuStyle.dhall: -------------------------------------------------------------------------------- 1 | < traditional | combination | partial | full > 2 | -------------------------------------------------------------------------------- /types/MsgType.dhall: -------------------------------------------------------------------------------- 1 | < hide : Text | stop : Text | norep : Text | show : Text > 2 | -------------------------------------------------------------------------------- /types/MsgWindow.dhall: -------------------------------------------------------------------------------- 1 | < single | combination | full | reversed > 2 | -------------------------------------------------------------------------------- /types/NumberPad.dhall: -------------------------------------------------------------------------------- 1 | {- We don't use a number to encode the `number_pad` option since not all 2 | numbers are valid selections for this option. Instead we use a union to 3 | explicitly enumerate the valid settings with slightly-friendlier names 4 | -} 5 | < Letters 6 | | Numbers_5_is_G 7 | | Numbers_5_is_g 8 | | PhoneKeys 9 | | PhoneKeys_MSDOS 10 | | Letters_z_is_NW 11 | > 12 | -------------------------------------------------------------------------------- /types/Numeric.dhall: -------------------------------------------------------------------------------- 1 | let Comparison = ./Comparison.dhall 2 | 3 | in < always | up | down | changed | number : Comparison > 4 | -------------------------------------------------------------------------------- /types/ParanoidConfirmation.dhall: -------------------------------------------------------------------------------- 1 | { Type = 2 | { Confirm : Optional Bool 3 | , quit : Optional Bool 4 | , die : Optional Bool 5 | , bones : Optional Bool 6 | , attack : Optional Bool 7 | , pray : Optional Bool 8 | , wand-break : Optional Bool 9 | , Were-change : Optional Bool 10 | , Remove : Optional Bool 11 | , all : Optional Bool 12 | } 13 | , default = 14 | { Confirm = None Bool 15 | , quit = None Bool 16 | , die = None Bool 17 | , bones = None Bool 18 | , attack = None Bool 19 | , pray = None Bool 20 | , wand-break = None Bool 21 | , Were-change = None Bool 22 | , Remove = None Bool 23 | , all = None Bool 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /types/Percent.dhall: -------------------------------------------------------------------------------- 1 | let Comparison = ./Comparison.dhall 2 | 3 | in < always 4 | | up 5 | | down 6 | | changed 7 | | percentage : Comparison 8 | | number : Comparison 9 | > 10 | -------------------------------------------------------------------------------- /types/PetType.dhall: -------------------------------------------------------------------------------- 1 | < cat | dog | none > 2 | -------------------------------------------------------------------------------- /types/PickupBurden.dhall: -------------------------------------------------------------------------------- 1 | < unencumbered | burdened | stressed | strained | overtaxed | overloaded > 2 | -------------------------------------------------------------------------------- /types/PileLimit.dhall: -------------------------------------------------------------------------------- 1 | {- We don't encourage the use of 0 as a sentinel value to specify unlimited. 2 | Instead, we provide better-named `unlimited` alternative so that the user's 3 | intent is more clear. 4 | 5 | Note that the user can still specify a `limit` of `0` which NetHack will 6 | still treat as unlimited. It's not worth forbidding that (at least, not 7 | within Dhall's simple type system). 8 | -} 9 | < unlimited | limit : Natural > 10 | -------------------------------------------------------------------------------- /types/PlayMode.dhall: -------------------------------------------------------------------------------- 1 | < normal | explore | debug > 2 | -------------------------------------------------------------------------------- /types/Race.dhall: -------------------------------------------------------------------------------- 1 | < human | elf | dwarf | gnome | orc | random > 2 | -------------------------------------------------------------------------------- /types/Role.dhall: -------------------------------------------------------------------------------- 1 | < archaeologist 2 | | barbarian 3 | | caveman 4 | | healer 5 | | knight 6 | | monk 7 | | priest 8 | | ranger 9 | | rogue 10 | | samurai 11 | | tourist 12 | | valkyrie 13 | | wizard 14 | > 15 | -------------------------------------------------------------------------------- /types/RunMode.dhall: -------------------------------------------------------------------------------- 1 | < teleport | run | walk | crawl > 2 | -------------------------------------------------------------------------------- /types/SOUND.dhall: -------------------------------------------------------------------------------- 1 | { regex : Text, filename : Text, volume : Natural } 2 | -------------------------------------------------------------------------------- /types/Scores.dhall: -------------------------------------------------------------------------------- 1 | { Type = 2 | { own : Optional Bool, around : Optional Natural, top : Optional Natural } 3 | , default = { own = None Bool, around = None Natural, top = None Natural } 4 | } 5 | -------------------------------------------------------------------------------- /types/SortLoot.dhall: -------------------------------------------------------------------------------- 1 | < full | loot | none > 2 | -------------------------------------------------------------------------------- /types/SymSet.dhall: -------------------------------------------------------------------------------- 1 | < NHAccess 2 | | MACgraphics 3 | | IBMGraphics_2 4 | | IBMGraphics_1 5 | | IBMgraphics 6 | | DECgraphics 7 | | RogueWindows 8 | | RogueEpyx 9 | | RogueIBM 10 | > 11 | -------------------------------------------------------------------------------- /types/Textual.dhall: -------------------------------------------------------------------------------- 1 | < always | up | down | changed | string : Text > 2 | -------------------------------------------------------------------------------- /types/WhatisCoord.dhall: -------------------------------------------------------------------------------- 1 | < compass | full | map | screen | none > 2 | -------------------------------------------------------------------------------- /types/WhatisFilter.dhall: -------------------------------------------------------------------------------- 1 | < no_filtering | view_only | same_area > 2 | --------------------------------------------------------------------------------