Module name, eg. the Foo.Bar in
something =
Foo.Bar.x + 1Converts from file path to its expected module name.
Additionally needs the source directory from elm.json.
Returns Nothing if the source directory doesn't agree with the file path.
expectedModuleName { sourceDirectory = "src", filePath = "src/Foo.elm" }
--> Just "Foo"
expectedModuleName { sourceDirectory = "src", filePath = "lib/Foo.elm" }
--> Nothing
Just a
Stringalias, instead of atypewrapper. We generally use records with explanatory field names where two Strings would be next to each other, to protect against swapping them accidentally.