|
| 1 | +module Flora.Normalise where |
| 2 | + |
| 3 | +import Data.List qualified as List |
| 4 | +import Data.Maybe (isJust) |
| 5 | +import Data.Text (Text) |
| 6 | + |
| 7 | +normaliseCategory :: Text -> Maybe Text |
| 8 | +normaliseCategory string = |
| 9 | + if isJust $ List.find (\(_, name, _) -> name == string) floraCategories |
| 10 | + then Just string |
| 11 | + else case string of |
| 12 | + "Algorithm" -> Just "Algorithms" |
| 13 | + "Crypto" -> Just "Cryptography" |
| 14 | + "CLI" -> Just "CLI & TUI Development" |
| 15 | + "TUI" -> Just "CLI & TUI Development" |
| 16 | + "Command Line" -> Just "CLI & TUI Development" |
| 17 | + "CommandLine" -> Just "CLI & TUI Development" |
| 18 | + "Numeric" -> Just "Mathematics" |
| 19 | + "Numerical" -> Just "Mathematics" |
| 20 | + "Numerics" -> Just "Mathematics" |
| 21 | + "Arithmetic" -> Just "Mathematics" |
| 22 | + "Number Theory" -> Just "Mathematics" |
| 23 | + "Math" -> Just "Mathematics" |
| 24 | + "Mathematics" -> Just "Mathematics" |
| 25 | + "mathematics" -> Just "Mathematics" |
| 26 | + "Maths" -> Just "Mathematics" |
| 27 | + "Algebra" -> Just "Mathematics" |
| 28 | + "Graph" -> Just "Mathematics" |
| 29 | + "Graphs" -> Just "Mathematics" |
| 30 | + "Geometry" -> Just "Mathematics" |
| 31 | + "Tropical Geometry" -> Just "Mathematics" |
| 32 | + "Parser Builder" -> Just "Parsers" |
| 33 | + "Parser Combinators" -> Just "Parsers" |
| 34 | + "Parser" -> Just "Parsers" |
| 35 | + "ParserCombinators" -> Just "Parsers" |
| 36 | + "Parsers" -> Just "Parsers" |
| 37 | + "Parsing" -> Just "Parsers" |
| 38 | + "Parsing Text" -> Just "Parsers" |
| 39 | + "Network" -> Just "Network Development" |
| 40 | + "Data Network" -> Just "Network Development" |
| 41 | + "Network APIs" -> Just "Network Development" |
| 42 | + "Network Control" -> Just "Network Development" |
| 43 | + "NetworkAPI" -> Just "Network Development" |
| 44 | + "NetworkAPIs" -> Just "Network Development" |
| 45 | + "Networking" -> Just "Network Development" |
| 46 | + "Web" -> Just "Web Development" |
| 47 | + "Yesod" -> Just "Web Development" |
| 48 | + "Javascript" -> Just "Web Development" |
| 49 | + "OpenAPI" -> Just "Web Development" |
| 50 | + "Snap" -> Just "Web Development" |
| 51 | + "Servant" -> Just "Web Development" |
| 52 | + "Servant Web" -> Just "Web Development" |
| 53 | + "Web development" -> Just "Web Development" |
| 54 | + "Happstack" -> Just "Web Development" |
| 55 | + "Semantic Web" -> Just "Web Development" |
| 56 | + "Optics" -> Just "Lenses" |
| 57 | + "Lens" -> Just "Lenses" |
| 58 | + "Conduit" -> Just "Streaming" |
| 59 | + "Streamly" -> Just "Streaming" |
| 60 | + "Pipes" -> Just "Streaming" |
| 61 | + "Monad" -> Just "Monads" |
| 62 | + "MonadIO" -> Just "Monads" |
| 63 | + "Transformers" -> Just "Monads" |
| 64 | + "Monad Transformers" -> Just "Monads" |
| 65 | + "Mtl" -> Just "Monads" |
| 66 | + "User interfaces" -> Just "GUI" |
| 67 | + "User interface" -> Just "GUI" |
| 68 | + "UserInterface" -> Just "GUI" |
| 69 | + "UI" -> Just "GUI" |
| 70 | + "User Interfaces" -> Just "GUI" |
| 71 | + "graphics" -> Just "Graphics" |
| 72 | + "Code Generation" -> Just "FFI" |
| 73 | + "Foreign binding" -> Just "FFI" |
| 74 | + "Elm" -> Just "FFI" |
| 75 | + "TypeScript" -> Just "FFI" |
| 76 | + "Java" -> Just "FFI" |
| 77 | + "JVM" -> Just "FFI" |
| 78 | + "Jvm" -> Just "FFI" |
| 79 | + "Erlang" -> Just "FFI" |
| 80 | + "PHP" -> Just "FFI" |
| 81 | + "Foreign" -> Just "FFI" |
| 82 | + "Types" -> Just "Type System" |
| 83 | + "Validity" -> Just "Testing" |
| 84 | + "QuickCheck" -> Just "Testing" |
| 85 | + "Test" -> Just "Testing" |
| 86 | + "Sound" -> Just "Audio" |
| 87 | + "Algorithmic Music Composition" -> Just "Audio" |
| 88 | + "Automatic Music Generation" -> Just "Audio" |
| 89 | + "Music" -> Just "Audio" |
| 90 | + "Zip" -> Just "Compression" |
| 91 | + "ZLib" -> Just "Compression" |
| 92 | + "Tar" -> Just "Compression" |
| 93 | + "Cloud" -> Just "Cloud Computing" |
| 94 | + "Google" -> Just "Cloud Computing" |
| 95 | + "AWS" -> Just "Cloud Computing" |
| 96 | + "Compilers/Interpreters" -> Just "Compilers and Interpreters" |
| 97 | + "Interpreters" -> Just "Compilers and Interpreters" |
| 98 | + "Compiler" -> Just "Compilers and Interpreters" |
| 99 | + "DSL" -> Just "Compilers and Interpreters" |
| 100 | + "Database" -> Just "Databases" |
| 101 | + "PostgreSQL" -> Just "Databases" |
| 102 | + "NLP" -> Just "Natural Language Processing" |
| 103 | + "Japanese Natural Language Processing" -> Just "Natural Language Processing" |
| 104 | + "Natural Language" -> Just "Natural Language Processing" |
| 105 | + "Natural Language Processing" -> Just "Natural Language Processing" |
| 106 | + "Stemming" -> Just "Natural Language Processing" |
| 107 | + "Natural-language-processing" -> Just "Natural Language Processing" |
| 108 | + "Containers" -> Just "Data Structures" |
| 109 | + "Game" -> Just "Game Development" |
| 110 | + "Game Engine" -> Just "Game Development" |
| 111 | + "Concurrent" -> Just "Concurrency" |
| 112 | + "Parallel" -> Just "Parallelism" |
| 113 | + "Distributed Computing" -> Just "Distributed Systems & Computation" |
| 114 | + "Filesystem" -> Just "Systems Programming" |
| 115 | + "system" -> Just "Systems Programming" |
| 116 | + "System" -> Just "Systems Programming" |
| 117 | + "SYstem" -> Just "Systems Programming" |
| 118 | + "Embedded" -> Just "Systems Programming" |
| 119 | + "Distribution" -> Just "Package Distribution" |
| 120 | + "Trace" -> Just "Profiling" |
| 121 | + "Debug" -> Just "Profiling" |
| 122 | + "Debugging" -> Just "Profiling" |
| 123 | + "OpenTelemetry" -> Just "Telemetry" |
| 124 | + "Metrics" -> Just "Telemetry" |
| 125 | + "Regex" -> Just "Text" |
| 126 | + _ -> Nothing |
| 127 | + |
| 128 | +floraCategories :: [(Text, Text, Text)] |
| 129 | +floraCategories = |
| 130 | + [ ("algorithms", "Algorithms", "Algorithms implemented in Haskell, like sorting, searching") |
| 131 | + , ("audio", "Audio", "Process digital signal, make music") |
| 132 | + , ("bioinformatics", "Bioinformatics", "Methods and software for the analysis of biological data") |
| 133 | + , ("cloud", "Cloud Computing", "Bindings to Cloud Computing platforms") |
| 134 | + , ("command-line", "CLI & TUI tooling", "Libraries to develop command-line interfaces") |
| 135 | + , ("compilers-interpreters", "Compilers and Interpreters", "Tooling to create compilers and interpreters") |
| 136 | + , ("compression", "Data compression", "Reducing the size of things") |
| 137 | + , ("concurrency", "Concurrency", "Concurrent programming techniques and tools") |
| 138 | + , ("cryptography", "Cryptography", "Algorithms for encrypting and hashing data") |
| 139 | + , ("data-structures", "Data Structures", "Data structures, whether purely functional or mutable") |
| 140 | + , ("databases", "Databases", "Database drivers and interfaces") |
| 141 | + , ("development", "Development", "Development helpers, integration with other languages") |
| 142 | + , ("distributed", "Distributed Systems & Computation", "Tooling and techniques for writing distributed systems") |
| 143 | + , ("distribution", "Package Distribution", "Building, Packaging and Distributing software in Haskell") |
| 144 | + , ("ffi", "FFI", "Working with other languages and generating bindings") |
| 145 | + , ("frp", "FRP", "Functional Reactive Programming") |
| 146 | + , ("game-dev", "Game Development", "Libraries used for game development") |
| 147 | + , ("generics", "Generics", "Working with Haskell's Generics mechanism") |
| 148 | + , ("graphics", "Graphics", "Programming the system's rendering APIs") |
| 149 | + , ("gui", "GUI", "Creating graphical user interfaces") |
| 150 | + , ("hardware", "Hardware", "Digital circuit description and hardware interfacing") |
| 151 | + , ("json", "JSON", "Parsing, producing and manipulating JSON") |
| 152 | + , ("language", "Language", "Interfacing with other programming languages from Haskell") |
| 153 | + , ("lenses", "Lenses", "Functional references such as Lenses, Folds and Traversals") |
| 154 | + , ("maths", "Mathematics", "Numerical and Mathematical packages") |
| 155 | + , ("monads", "Monads", "Effectful sequential computations") |
| 156 | + , ("network", "Network Development", "Connection pools, DNS, HTTP, API clients and network protocols") |
| 157 | + , ("nlp", "Natural Language Processing", "Tooling to work with natural languages") |
| 158 | + , ("parallelism", "Parallelism", "Parallel programming") |
| 159 | + , ("parser-implementations", "Parser Implementations", "Parsing data formats") |
| 160 | + , ("parsers", "Parsers", "Libraries to ingest and parse data") |
| 161 | + , ("parsing", "Parsing", "Parser generators, combinators and tools to help with parsing") |
| 162 | + , ("physics", "Physics", "The study of matter, its consituents, motion, and behaviour") |
| 163 | + , ("prelude", "Prelude", "Libraries that provide default imports") |
| 164 | + , ("profiling", "Profiling", "Measure the behaviour of your programs") |
| 165 | + , ("streaming", "Streaming", "Data streaming for continuous processing") |
| 166 | + , ("system", "Systems Programming", "Programming and communicating with the Operating System") |
| 167 | + , ("telemetry", "Telemetry", "Systems Observability") |
| 168 | + , ("template-haskell", "Template Haskell", "Metaprogramming with Template Haskell") |
| 169 | + , ("testing", "Testing", "Test frameworks") |
| 170 | + , ("text", "Text", "Working with textual data and algorithms") |
| 171 | + , ("type-system", "Type System", "Enhancing the Haskell type system") |
| 172 | + , ("web", "Web Development", "Programming for the web") |
| 173 | + , ("xml", "XML", "Libraries to consume and produce XML documents") |
| 174 | + ] |
0 commit comments