module HW_Survey where

import qualified Data.Text as Text
import qualified Data.Vector as Vector
import qualified HW_Answer as Answer
import qualified HW_Other as Other
import qualified HW_Question as Question
import qualified HW_Section as Section
import qualified Numeric.Natural as Natural

-- | <https://github.com/haskellweekly/haskellweekly/blob/f7aacff431f8072adf5134a9ae5db3aa2499963a/src/lib/HW/Template/Survey2021.hs>
sections :: Vector.Vector Section.Section
sections = Vector.fromList
  [ section 10 "Survey"
    [ question 0 "When did you submit your survey response?" $ single
      [ "2021-11-01"
      , "2021-11-02"
      , "2021-11-03"
      , "2021-11-04"
      , "2021-11-05"
      , "2021-11-06"
      , "2021-11-07"
      , "2021-11-08"
      , "2021-11-09"
      , "2021-11-10"
      , "2021-11-11"
      , "2021-11-12"
      , "2021-11-13"
      , "2021-11-14"
      , "2021-11-15"
      ]
    , question 1 "Did you provide an email address?" $ single
      [ "No"
      , "Yes"
      ]
    ]
  , section 0 "Haskell usage"
    [ question 1 "Do you use Haskell?" $ single
      [ "Yes"
      , "No, but I used to"
      , "No, I never have"
      ]
    , question 2 "If you stopped using Haskell, how long did you use it before you stopped?" $ single
      [ "Less than 1 day"
      , "1 day to 1 week"
      , "1 week to 1 month"
      , "1 month to 1 year"
      , "More than 1 year"
      ]
    , question 3 "If you do not use Haskell, why not?" $ multi Other.Allow
      [ "My company doesn't use Haskell"
      , "Haskell's documentation is not good enough"
      , "Haskell is too hard to learn"
      , "Haskell lacks critical libraries"
      , "Haskell lacks critical tools"
      , "Haskell's performance is not good enough"
      , "Haskell lacks critical features"
      , "Haskell does not support the platforms I need"
      ]
    , question 4 "How many years have you been using Haskell?" $ single
      [ "Less than 1"
      , "1 to 2"
      , "2 to 3"
      , "3 to 4"
      , "4 to 5"
      , "5 to 6"
      , "6 to 7"
      , "7 to 8"
      , "8 to 9"
      , "9 to 10"
      , "10 to 11"
      , "11 to 12"
      , "12 to 13"
      , "13 to 14"
      , "14 to 15"
      , "More than 15"
      ]
    , question 5 "How frequently do you use Haskell?" $ single
      [ "Daily"
      , "Weekly"
      , "Monthly"
      , "Yearly"
      , "Rarely"
      ]
    , question 6 "How would you rate your proficiency in Haskell?" $ single
      [ "I can't write or read Haskell"
      , "I can write simple programs in Haskell"
      , "I can write useful, production-ready code but it is a struggle"
      , "I am productive writing Haskell"
      , "I'm an expert"
      ]
    , question 7 "Where do you use Haskell?" $ multi Other.Forbid
      [ "Home"
      , "Industry"
      , "Academia"
      , "School"
      ]
    , question 8 "Do you use Haskell at work?" $ single
      [ "Yes, most of the time"
      , "Yes, some of the time"
      , "No, but my company does"
      , "No, but I'd like to"
      , "No, and I don't want to"
      ]
    , question 9 "If you do not use Haskell at work, why not?" $ multi Other.Allow
      [ "My company doesn't use Haskell"
      , "It's too hard to hire Haskell developers"
      , "Haskell is too hard to learn"
      , "Haskell lacks critical libraries"
      , "Haskell's documentation is not good enough"
      , "Haskell lacks critical tools"
      , "Haskell does not support the platforms I need"
      , "Haskell's performance is not good enough"
      , "Haskell lacks critical features"
      ]
    , question 10 "Which programming languages other than Haskell are you fluent in?" $ multi Other.Allow
      [ "Python"
      , "JavaScript"
      , "C"
      , "Java"
      , "C++"
      , "Shell"
      , "TypeScript"
      , "Rust"
      , "Elm"
      , "C#"
      , "Scala"
      , "PureScript"
      , "Ruby"
      , "Go"
      , "PHP"
      , "Clojure"
      , "Lua"
      , "Ocaml"
      , "Assembly"
      , "Kotlin"
      , "Perl"
      , "F#"
      , "Erlang"
      , "R"
      , "Matlab"
      , "Swift"
      ]
    , question 11 "Which types of software do you develop with Haskell?" $ multi Other.Allow
      [ "Command-line programs (CLI)"
      , "API services (returning non-HTML)"
      , "Libraries or frameworks"
      , "Data processing"
      , "Automation or scripts"
      , "Web services (returning HTML)"
      , "Agents or daemons"
      , "Desktop programs (GUI)"
      ]
    , question 12 "Which industries do you use Haskell in?" $ multi Other.Allow
      [ "Web"
      , "Academia"
      , "Banking or finance"
      , "Education"
      , "Science"
      , "Commerce or retail"
      , "Cryptocurrency"
      , "Gaming"
      , "Healthcare or medical"
      , "Embedded"
      , "Mobile"
      , "Government"
      ]
    ]
  , section 1 "Projects"
    [ question 0 "How many Haskell projects do you contribute to?" $ single
      [ "0"
      , "1"
      , "2"
      , "3"
      , "4"
      , "5"
      , "6 to 10"
      , "11 to 20"
      , "More than 20"
      ]
    , question 1 "What is the total size of all the Haskell projects you contribute to?" $ single
      [ "Less than 1,000 lines of code"
      , "Between 1,000 and 9,999 lines of code"
      , "Between 10,000 and 99,999 lines of code"
      , "More than 100,000 lines of code"
      ]
    , question 2 "Which platforms do you develop Haskell on?" $ multi Other.Allow
      [ "Linux"
      , "MacOS"
      , "Windows"
      , "BSD"
      ]
    , question 3 "Which platforms do you target?" $ multi Other.Allow
      [ "Linux"
      , "MacOS"
      , "Windows"
      , "BSD"
      , "Android"
      , "iOS"
      ]
    ]
  , section 2 "Compilers"
    [ question 0 "Which Haskell compilers do you use?" $ multi Other.Allow
      [ "GHC"
      , "GHCJS"
      ]
    , question 1 "Which installation methods do you use for your Haskell compiler?" $ multi Other.Allow
      [ "Stack"
      , "ghcup"
      , "Nix"
      , "Operating system package"
      , "Haskell Platform"
      , "Official binaries"
      , "Homebrew"
      , "Source"
      , "Chocolatey"
      ]
    , question 2 "Has upgrading your Haskell compiler broken your code in the last year?" $ single
      [ "No"
      , "Yes"
      ]
    , question 3 "How has upgrading your Haskell compiler broken your code in the last year?" $ multi Other.Allow
      [ "Incompatible dependencies"
      , "Expected changes, such as the MonadFail proposal"
      , "New warnings"
      , "Compiler bugs"
      , "Unexpected changes"
      ]
    , question 4 "Which versions of GHC do you use?" $ multi Other.Forbid
      [ "> 9.2"
      , "9.2"
      , "9.0"
      , "8.10.x"
      , "8.8.x"
      , "8.6.x"
      , "8.4.x"
      , "8.2.x"
      , "< 8.2"
      ]
    , question 5 "Which language extensions would you like to be enabled by default?" $ extension
      [ "AllowAmbiguousTypes"
      , "ApplicativeDo"
      , "Arrows"
      , "BangPatterns"
      , "BinaryLiterals"
      , "BlockArguments"
      , "CApiFFI"
      , "ConstrainedClassMethods"
      , "ConstraintKinds"
      , "Cpp"
      , "DataKinds"
      , "DatatypeContexts"
      , "DefaultSignatures"
      , "DeriveAnyClass"
      , "DeriveDataTypeable"
      , "DeriveFoldable"
      , "DeriveFunctor"
      , "DeriveGeneric"
      , "DeriveLift"
      , "DeriveTraversable"
      , "DerivingStrategies"
      , "DerivingVia"
      , "DisambiguateRecordFields"
      , "DuplicateRecordFields"
      , "EmptyCase"
      , "ExistentialQuantification"
      , "ExplicitForAll"
      , "ExplicitNamespaces"
      , "ExtendedDefaultRules"
      , "FlexibleContexts"
      , "FlexibleInstances"
      , "ForeignFunctionInterface"
      , "FunctionalDependencies"
      , "GADTs"
      , "GADTSyntax"
      , "GeneralizedNewtypeDeriving"
      , "HexFloatLiterals"
      , "ImplicitParams"
      , "ImportQualifiedPost"
      , "ImpredicativeTypes"
      , "IncoherentInstances"
      , "InstanceSigs"
      , "InterruptibleFFI"
      , "KindSignatures"
      , "LambdaCase"
      , "LiberalTypeSynonyms"
      , "LinearTypes"
      , "MagicHash"
      , "MonadComprehensions"
      , "MonoLocalBinds"
      , "MultiParamTypeClasses"
      , "MultiWayIf"
      , "NamedFieldPuns"
      , "NamedWildCards"
      , "NegativeLiterals"
      , "NoEmptyDataDecls"
      , "NoFieldSelectors"
      , "NoImplicitPrelude"
      , "NoMonadFailDesugaring"
      , "NoMonomorphismRestriction"
      , "NoPatternGuards"
      , "NoStarIsType"
      , "NoTraditionalRecordSyntax"
      , "NPlusKPatterns"
      , "NullaryTypeClasses"
      , "NumDecimals"
      , "NumericUnderscores"
      , "OverlappingInstances"
      , "OverloadedLabels"
      , "OverloadedLists"
      , "OverloadedRecordDot"
      , "OverloadedRecordUpdate"
      , "OverloadedStrings"
      , "PackageImports"
      , "ParallelListComp"
      , "PartialTypeSignatures"
      , "PatternSynonyms"
      , "PolyKinds"
      , "PostfixOperators"
      , "QuantifiedConstraints"
      , "QuasiQuotes"
      , "Rank2Types"
      , "RankNTypes"
      , "RebindableSyntax"
      , "RecordWildCards"
      , "RecursiveDo"
      , "RoleAnnotations"
      , "ScopedTypeVariables"
      , "StandaloneDeriving"
      , "StandaloneKindSignatures"
      , "StaticPointers"
      , "Strict"
      , "StrictData"
      , "TemplateHaskell"
      , "TemplateHaskellQuotes"
      , "TransformListComp"
      , "Trustworthy"
      , "TupleSections"
      , "TypeApplications"
      , "TypeFamilies"
      , "TypeFamilyDependencies"
      , "TypeInType"
      , "TypeOperators"
      , "TypeSynonymInstances"
      , "UnboxedSums"
      , "UnboxedTuples"
      , "UndecidableInstances"
      , "UndecidableSuperClasses"
      , "UnicodeSyntax"
      , "UnliftedDatatypes"
      , "UnliftedNewtypes"
      , "Unsafe"
      , "ViewPatterns"
      ]
    , question 6 "How important do you feel it would be to have a new version of the Haskell language standard?" $ single
      [ "Extremely important"
      , "Very important"
      , "Moderately important"
      , "Slightly important"
      , "Not at all important"
      ]
    ]
  , section 3 "Tooling"
    [ question 0 "Which build tools do you use for Haskell?" $ multi Other.Allow
      [ "Cabal"
      , "Stack"
      , "Nix"
      , "haskell.nix"
      , "Make"
      , "Shake"
      , "ghc-pkg"
      , "Bazel"
      ]
    , question 1 "Which editors do you use for Haskell?" $ multi Other.Allow
      [ "Visual Studio Code"
      , "Vi family"
      , "Emacs family"
      , "Sublime Text"
      , "IntelliJ IDEA"
      , "Atom"
      ]
    , question 2 "Which IDEs do you use for Haskell?" $ multi Other.Allow
      [ "Haskell Language Server (HLS)"
      , "ghcid"
      , "IntelliJ"
      , "ghcide"
      , "Intero"
      ]
    , question 3 "Which version control systems do you use for Haskell?" $ multi Other.Allow
      [ "Git"
      , "Darcs"
      , "Mercurial"
      ]
    , question 4 "Where do you get Haskell packages from?" $ multi Other.Allow
      [ "Hackage"
      , "Stackage"
      , "Nix"
      , "Source"
      ]
    , question 5 "Which tools do you use to test Haskell code?" $ multi Other.Allow
      [ "QuickCheck"
      , "Hspec"
      , "HUnit"
      , "Tasty"
      , "Hedgehog"
      , "SmallCheck"
      , "Haskell Test Framework"
      ]
    , question 6 "Which tools do you use to benchmark Haskell code?" $ multi Other.Allow
      [ "Criterion"
      , "Bench"
      , "Gauge"
      ]
    ]
  , section 4 "Infrastructure"
    [ question 0 "Which tools do you use to deploy Haskell applications?" $ multi Other.Allow
      [ "Static binaries"
      , "Docker images"
      , "Nix expressions"
      , "Dynamic binaries"
      ]
    , question 1 "Where do you deploy Haskell applications?" $ multi Other.Allow
      [ "Self or company owned servers"
      , "Amazon Web Services"
      , "Google Cloud"
      , "Digital Ocean"
      , "Heroku"
      , "Microsoft Azure"
      ]
    ]
  , section 5 "Community"
    [ question 0 "Where do you interact with the Haskell community?" $ multi Other.Allow
      [ "Reddit"
      , "GitHub"
      , "Twitter"
      , "Stack Overflow"
      , "Discord"
      , "Slack"
      , "IRC"
      , "Conferences (commercial)"
      , "Discourse"
      , "Mailing lists"
      , "Conferences (academic)"
      , "Meetups"
      , "Telegram"
      , "Matrix/Riot"
      , "Lobsters"
      , "Mastodon"
      , "Zulip"
      , "Gitter"
      ]
    , question 1 "Which of the following Haskell topics would you like to see more written about?" $ multi Other.Allow
      [ "Best practices"
      , "Design patterns"
      , "Application architectures"
      , "Performance analysis"
      , "Debugging how-tos"
      , "Library walkthroughs"
      , "Production infrastructure"
      , "Tooling choices"
      , "Case studies"
      , "Algorithm implementations"
      , "Project maintenance"
      , "Testing"
      , "GUIs"
      , "Web development"
      , "Project setup"
      , "Beginner fundamentals"
      , "Machine learning"
      , "Game development"
      , "Mobile development"
      , "Comparisons to other languages"
      ]
    ]
  , section 6 "Feelings"
    [ question 19 "I would prefer to use Haskell for my next new project." likert
    , question 18 "I would recommend using Haskell to others." likert
    , question 1 "I am satisfied with Haskell as a language." likert
    , question 14 "Once my Haskell program compiles, it generally does what I intended." likert
    , question 13 "I think that software written in Haskell is easy to maintain." likert
    , question 2 "I am satisfied with Haskell's compilers, such as GHC." likert
    , question 0 "I feel welcome in the Haskell community." likert
    , question 16 "Haskell's performance meets my needs." likert
    , question 4 "I am satisfied with Haskell's package repositories, such as Hackage." likert
    , question 6 "I think Haskell libraries are high quality." likert
    , question 15 "I think that Haskell libraries perform well." likert
    , question 20 "Haskell is working well for my team." likert
    , question 5 "I can find Haskell libraries for the things that I need." likert
    , question 12 "I think that Haskell libraries work well together." likert
    , question 11 "I think that Haskell libraries provide a stable API." likert
    , question 3 "I am satisfied with Haskell's build tools, such as Cabal." likert
    , question 21 "Haskell is critical to my company's success." likert
    , question 7 "I have a good understanding of Haskell best practices." likert
    , question 10 "I think that Haskell libraries are easy to use." likert
    , question 23 "As a hiring manager, I can easily find qualified Haskell candidates." likert
    , question 8 "I think Haskell libraries are well documented." likert
    , question 9 "I can easily compare competing Haskell libraries to select the best one." likert
    , question 22 "As a candidate, I can easily find Haskell jobs." likert
    , question 17 "I can easily reason about the performance of my Haskell code." likert
    ]
  , section 7 "Demographics"
    [ question 0 "Which country do you live in?" $ single
      [ "United States"
      , "Germany"
      , "United Kingdom"
      , "Russia"
      , "Canada"
      , "Australia"
      , "France"
      , "Netherlands"
      , "Sweden"
      , "Japan"
      , "Poland"
      , "India"
      , "Finland"
      , "Norway"
      , "Italy"
      , "Austria"
      , "Brazil"
      , "Czech Republic"
      , "Spain"
      , "Ukraine"
      , "China"
      , "Belgium"
      , "Denmark"
      , "Switzerland"
      , "Turkey"
      , "Singapore"
      , "Bulgaria"
      , "Romania"
      , "Israel"
      , "South Korea"
      , "New Zealand"
      , "Argentina"
      , "Belarus"
      , "Croatia"
      , "Ecuador"
      , "Indonesia"
      , "Ireland"
      , "Hungary"
      , "Iran"
      , "South Africa"
      , "Colombia"
      , "Egypt"
      , "Estonia"
      , "Greece"
      , "Kazakhstan"
      , "Kenya"
      , "Mexico"
      , "Pakistan"
      , "Peru"
      , "Serbia and Montenegro"
      , "Slovakia"
      , "Thailand"
      , "Vietnam"
      , "Chile"
      , "Honduras"
      , "Hong Kong"
      , "Iraq"
      , "Lithuania"
      , "Luxembourg"
      , "Malaysia"
      , "Nigeria"
      , "Philippines"
      , "Portugal"
      , "Puerto Rico"
      , "Taiwan"
      , "Uganda"
      , "Venezuela"
      , "Western Sahara"
      , "Zimbabwe"
      -- , "Afghanistan"
      -- , "Akrotiri"
      -- , "Albania"
      -- , "Algeria"
      -- , "American Samoa"
      -- , "Andorra"
      -- , "Angola"
      -- , "Anguilla"
      -- , "Antarctica"
      -- , "Antigua and Barbuda"
      -- , "Armenia"
      -- , "Aruba"
      -- , "Ashmore and Cartier Islands"
      -- , "Azerbaijan"
      -- , "The Bahamas"
      -- , "Bahrain"
      -- , "Bangladesh"
      -- , "Barbados"
      -- , "Bassas da India"
      -- , "Belize"
      -- , "Benin"
      -- , "Bermuda"
      -- , "Bhutan"
      -- , "Bolivia"
      -- , "Bosnia and Herzegovina"
      -- , "Botswana"
      -- , "Bouvet Island"
      -- , "British Indian Ocean Territory"
      -- , "British Virgin Islands"
      -- , "Brunei"
      -- , "Burkina Faso"
      -- , "Burma"
      -- , "Burundi"
      -- , "Cambodia"
      -- , "Cameroon"
      -- , "Cape Verde"
      -- , "Cayman Islands"
      -- , "Central African Republic"
      -- , "Chad"
      -- , "Christmas Island"
      -- , "Clipperton Island"
      -- , "Cocos (Keeling) Islands"
      -- , "Comoros"
      -- , "Democratic Republic of the Congo"
      -- , "Republic of the Congo"
      -- , "Cook Islands"
      -- , "Coral Sea Islands"
      -- , "Costa Rica"
      -- , "Cote d'Ivoire"
      -- , "Cuba"
      -- , "Cyprus"
      -- , "Dhekelia"
      -- , "Djibouti"
      -- , "Dominica"
      -- , "Dominican Republic"
      -- , "El Salvador"
      -- , "Equatorial Guinea"
      -- , "Eritrea"
      -- , "Ethiopia"
      -- , "Europa Island"
      -- , "Falkland Islands (Islas Malvinas)"
      -- , "Faroe Islands"
      -- , "Fiji"
      -- , "French Guiana"
      -- , "French Polynesia"
      -- , "French Southern and Antarctic Lands"
      -- , "Gabon"
      -- , "The Gambia"
      -- , "Gaza Strip"
      -- , "Georgia"
      -- , "Ghana"
      -- , "Gibraltar"
      -- , "Glorioso Islands"
      -- , "Greenland"
      -- , "Grenada"
      -- , "Guadeloupe"
      -- , "Guam"
      -- , "Guatemala"
      -- , "Guernsey"
      -- , "Guinea"
      -- , "Guinea-Bissau"
      -- , "Guyana"
      -- , "Haiti"
      -- , "Heard Island and McDonald Islands"
      -- , "Holy See (Vatican City)"
      -- , "Iceland"
      -- , "Isle of Man"
      -- , "Jamaica"
      -- , "Jan Mayen"
      -- , "Jersey"
      -- , "Jordan"
      -- , "Juan de Nova Island"
      -- , "Kiribati"
      -- , "North Korea"
      -- , "Kuwait"
      -- , "Kyrgyzstan"
      -- , "Laos"
      -- , "Latvia"
      -- , "Lebanon"
      -- , "Lesotho"
      -- , "Liberia"
      -- , "Libya"
      -- , "Liechtenstein"
      -- , "Macau"
      -- , "Macedonia"
      -- , "Madagascar"
      -- , "Malawi"
      -- , "Maldives"
      -- , "Mali"
      -- , "Malta"
      -- , "Marshall Islands"
      -- , "Martinique"
      -- , "Mauritania"
      -- , "Mauritius"
      -- , "Mayotte"
      -- , "Federated States of Micronesia"
      -- , "Moldova"
      -- , "Monaco"
      -- , "Mongolia"
      -- , "Montserrat"
      -- , "Morocco"
      -- , "Mozambique"
      -- , "Namibia"
      -- , "Nauru"
      -- , "Navassa Island"
      -- , "Nepal"
      -- , "Netherlands Antilles"
      -- , "New Caledonia"
      -- , "Nicaragua"
      -- , "Niger"
      -- , "Niue"
      -- , "Norfolk Island"
      -- , "Northern Mariana Islands"
      -- , "Oman"
      -- , "Palau"
      -- , "Palestine"
      -- , "Panama"
      -- , "Papua New Guinea"
      -- , "Paracel Islands"
      -- , "Paraguay"
      -- , "Pitcairn Islands"
      -- , "Qatar"
      -- , "Reunion"
      -- , "Rwanda"
      -- , "Saint Helena"
      -- , "Saint Kitts and Nevis"
      -- , "Saint Lucia"
      -- , "Saint Pierre and Miquelon"
      -- , "Saint Vincent and the Grenadines"
      -- , "Samoa"
      -- , "San Marino"
      -- , "Sao Tome and Principe"
      -- , "Saudi Arabia"
      -- , "Senegal"
      -- , "Seychelles"
      -- , "Sierra Leone"
      -- , "Slovenia"
      -- , "Solomon Islands"
      -- , "Somalia"
      -- , "South Georgia and the South Sandwich Islands"
      -- , "Spratly Islands"
      -- , "Sri Lanka"
      -- , "Sudan"
      -- , "Suriname"
      -- , "Svalbard"
      -- , "Swaziland"
      -- , "Syria"
      -- , "Tajikistan"
      -- , "Tanzania"
      -- , "Timor-Leste"
      -- , "Togo"
      -- , "Tokelau"
      -- , "Tonga"
      -- , "Trinidad and Tobago"
      -- , "Tromelin Island"
      -- , "Tunisia"
      -- , "Turkmenistan"
      -- , "Turks and Caicos Islands"
      -- , "Tuvalu"
      -- , "United Arab Emirates"
      -- , "Uruguay"
      -- , "Uzbekistan"
      -- , "Vanuatu"
      -- , "Virgin Islands"
      -- , "Wake Island"
      -- , "Wallis and Futuna"
      -- , "West Bank"
      -- , "Yemen"
      -- , "Zambia"
      ]
    , question 1 "Do you consider yourself a member of an underrepresented or marginalized group in technology?" $ multi Other.Allow
      [ "Lesbian, gay, bisexual, queer or otherwise non-heterosexual"
      , "Older or younger than the average developers I know"
      , "Political beliefs"
      , "Trans"
      , "Woman or perceived as a woman"
      , "Disabled or person with disability (including physical, mental, and other)"
      , "Educational background"
      , "Language"
      , "Non-binary gender"
      , "Racial or ethnic minority"
      , "Religious beliefs"
      , "Yes, but I prefer not to say which"
      , "Cultural beliefs"
      ]
    , question 2 "Do you feel your belonging to an underrepresented or marginalized group in technology makes it difficult for you to participate in the Haskell community?" $ single
      [ "Never"
      , "Sometimes"
      , "Often"
      ]
    , question 3 "Are you a student?" $ single
      [ "No"
      , "Yes, full time"
      , "Yes, part time"
      ]
    , question 4 "What is the highest level of education you have completed?" $ single
      [ "Less than high school diploma"
      , "High school diploma"
      , "Some college"
      , "Associate degree"
      , "Bachelor's degree"
      , "Master's degree"
      , "Professional degree"
      , "Doctoral degree"
      ]
    , question 5 "What is your employment status?" $ single
      [ "Employed full time"
      , "Employed part time"
      , "Self employed"
      , "Not employed, and not looking for work"
      , "Not employed, but looking for work"
      , "Retired"
      ]
    , question 6 "How large is the company you work for?" $ single
      [ "Fewer than 10 employees"
      , "10 to 99 employees"
      , "100 to 999 employees"
      , "More than 1,000 employees"
      ]
    , question 7 "How many years have you been coding?" $ single
      [ "0 to 4 years"
      , "5 to 9 years"
      , "10 to 14 years"
      , "15 to 19 years"
      , "20 to 24 years"
      , "25 to 29 years"
      , "30 or more years"
      ]
    , question 8 "How many years have you been coding professionally?" $ single
      [ "0 to 4 years"
      , "5 to 9 years"
      , "10 to 14 years"
      , "15 to 19 years"
      , "20 to 24 years"
      , "25 to 29 years"
      , "30 or more years"
      ]
    , question 9 "Do you code as a hobby?" $ single
      [ "Yes"
      , "No"
      ]
    , question 10 "Have you contributed to any open source projects?" $ single
      [ "Yes"
      , "No"
      ]
    ]
  , section 8 "Meta"
    [ question 0 "Did you take any previous surveys?" $ multi Other.Forbid
      [ "2020"
      , "2019"
      , "2018"
      , "2017"
      ]
    , question 1 "How did you hear about this survey?" $ multi Other.Allow
      [ "Reddit"
      , "Twitter"
      , "Haskell Weekly"
      , "Slack"
      , "Lobsters"
      , "Discord"
      , "Telegram"
      , "Discourse"
      , "In person"
      , "Mailing lists"
      , "IRC"
      , "Matrix/Riot"
      , "Mastodon"
      , "GitHub"
      -- , "Gitter"
      -- , "Zulip"
      ]
    ]
  , section 9 "Free response"
    [ question 0 "If you wanted to convince someone to use Haskell, what would you say?" Answer.Free
    , question 1 "If you could change one thing about Haskell, what would it be?" Answer.Free
    ]
  ]

section :: Natural.Natural -> String -> [Question.Question] -> Section.Section
section index title questions = Section.Section
  { Section.index = index
  , Section.title = Text.pack title
  , Section.questions = Vector.fromList questions
  }

question :: Natural.Natural -> String -> Answer.Answer -> Question.Question
question index prompt answer = Question.Question
  { Question.index = index
  , Question.prompt = Text.pack prompt
  , Question.answer = answer
  }

single :: [String] -> Answer.Answer
single = Answer.Single . Vector.fromList . fmap Text.pack

multi :: Other.Other -> [String] -> Answer.Answer
multi other = Answer.Multi other . Vector.fromList . fmap Text.pack

extension :: [String] -> Answer.Answer
extension = Answer.Extension . Vector.fromList . fmap Text.pack

likert :: Answer.Answer
likert = Answer.Single . Vector.fromList $ fmap Text.pack
  [ " Strongly agree"
  , "Agree"
  , "Neutral"
  , "Disagree"
  , "Strongly disagree"
  ]