Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
366f5a8d
Commit
366f5a8d
authored
Oct 12, 2016
by
Oleg Grenrus
Committed by
GitHub
Oct 12, 2016
Browse files
Merge pull request #3976 from phadej/from-components-null
Fail if null components
parents
850b68b5
8b4ac72d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/ModuleName.hs
View file @
366f5a8d
...
...
@@ -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@.
--
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment