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
8b4ac72d
Commit
8b4ac72d
authored
Oct 12, 2016
by
Oleg Grenrus
Browse files
Fail if null components
parent
34eecf48
Changes
1
Hide whitespace changes
Inline
Side-by-side
Cabal/Distribution/ModuleName.hs
View file @
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@.
--
...
...
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