Commit 366f5a8d authored by Oleg Grenrus's avatar Oleg Grenrus Committed by GitHub
Browse files

Merge pull request #3976 from phadej/from-components-null

Fail if null components
parents 850b68b5 8b4ac72d
......@@ -87,10 +87,12 @@ fromString string = fromComponents (split string)
-- separated by dots.
fromComponents :: [String] -> ModuleName
fromComponents components'
| null components' = error zeroComponents
| all validModuleComponent components' = ModuleName (stlFromStrings components')
| otherwise = error badName
where
badName = "ModuleName.fromComponents: invalid components " ++ show components'
zeroComponents = "ModuleName.fromComponents: zero components"
badName = "ModuleName.fromComponents: invalid components " ++ show components'
-- | The module name @Main@.
--
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment