diff --git a/message-index/messages/GHC-45102/example1/.gitignore b/message-index/messages/GHC-45102/example1/.gitignore new file mode 100644 index 00000000..6e8ed1bb --- /dev/null +++ b/message-index/messages/GHC-45102/example1/.gitignore @@ -0,0 +1 @@ +**/dist-newstyle/* \ No newline at end of file diff --git a/message-index/messages/GHC-45102/example1/after/cabal.project b/message-index/messages/GHC-45102/example1/after/cabal.project new file mode 100644 index 00000000..5da9073f --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/cabal.project @@ -0,0 +1,3 @@ +packages: fruits/ +packages: vegatables/ +packages: salad/ \ No newline at end of file diff --git a/message-index/messages/GHC-45102/example1/after/fruits/Tomatoes.hs b/message-index/messages/GHC-45102/example1/after/fruits/Tomatoes.hs new file mode 100644 index 00000000..a4ccc374 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/fruits/Tomatoes.hs @@ -0,0 +1 @@ +module Tomatoes where diff --git a/message-index/messages/GHC-45102/example1/after/fruits/fruits.cabal b/message-index/messages/GHC-45102/example1/after/fruits/fruits.cabal new file mode 100644 index 00000000..8b465734 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/fruits/fruits.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 + +name: fruits +version: 0.0.1 +license: MIT +author: Jappie +maintainer: hi@jappie.me +build-type: Simple + +library + exposed-modules: Tomatoes + build-depends: base + default-language: Haskell2010 diff --git a/message-index/messages/GHC-45102/example1/after/salad/Salad.hs b/message-index/messages/GHC-45102/example1/after/salad/Salad.hs new file mode 100644 index 00000000..08c4cb90 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/salad/Salad.hs @@ -0,0 +1,5 @@ +{-# LANGUAGE PackageImports #-} + +module Salad where + +import "vegetables" Tomatoes diff --git a/message-index/messages/GHC-45102/example1/after/salad/salad.cabal b/message-index/messages/GHC-45102/example1/after/salad/salad.cabal new file mode 100644 index 00000000..e1e4c1dc --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/salad/salad.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 + +name: salad +version: 0.0.1 +license: MIT +author: Jappie +maintainer: hi@jappie.me +build-type: Simple + +library + exposed-modules: Salad + build-depends: base, fruits, vegetables + default-language: Haskell2010 diff --git a/message-index/messages/GHC-45102/example1/after/vegatables/Tomatoes.hs b/message-index/messages/GHC-45102/example1/after/vegatables/Tomatoes.hs new file mode 100644 index 00000000..a4ccc374 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/vegatables/Tomatoes.hs @@ -0,0 +1 @@ +module Tomatoes where diff --git a/message-index/messages/GHC-45102/example1/after/vegatables/vegetables.cabal b/message-index/messages/GHC-45102/example1/after/vegatables/vegetables.cabal new file mode 100644 index 00000000..246b4199 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/after/vegatables/vegetables.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 + +name: vegetables +version: 0.0.1 +license: MIT +author: Jappie +maintainer: hi@jappie.me +build-type: Simple + +library + exposed-modules: Tomatoes + build-depends: base + default-language: Haskell2010 diff --git a/message-index/messages/GHC-45102/example1/before/cabal.project b/message-index/messages/GHC-45102/example1/before/cabal.project new file mode 100644 index 00000000..5da9073f --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/cabal.project @@ -0,0 +1,3 @@ +packages: fruits/ +packages: vegatables/ +packages: salad/ \ No newline at end of file diff --git a/message-index/messages/GHC-45102/example1/before/fruits/Tomatoes.hs b/message-index/messages/GHC-45102/example1/before/fruits/Tomatoes.hs new file mode 100644 index 00000000..a4ccc374 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/fruits/Tomatoes.hs @@ -0,0 +1 @@ +module Tomatoes where diff --git a/message-index/messages/GHC-45102/example1/before/fruits/fruits.cabal b/message-index/messages/GHC-45102/example1/before/fruits/fruits.cabal new file mode 100644 index 00000000..8b465734 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/fruits/fruits.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 + +name: fruits +version: 0.0.1 +license: MIT +author: Jappie +maintainer: hi@jappie.me +build-type: Simple + +library + exposed-modules: Tomatoes + build-depends: base + default-language: Haskell2010 diff --git a/message-index/messages/GHC-45102/example1/before/salad/Salad.hs b/message-index/messages/GHC-45102/example1/before/salad/Salad.hs new file mode 100644 index 00000000..5b4afdb1 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/salad/Salad.hs @@ -0,0 +1,3 @@ +module Salad where + +import Tomatoes diff --git a/message-index/messages/GHC-45102/example1/before/salad/salad.cabal b/message-index/messages/GHC-45102/example1/before/salad/salad.cabal new file mode 100644 index 00000000..e1e4c1dc --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/salad/salad.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 + +name: salad +version: 0.0.1 +license: MIT +author: Jappie +maintainer: hi@jappie.me +build-type: Simple + +library + exposed-modules: Salad + build-depends: base, fruits, vegetables + default-language: Haskell2010 diff --git a/message-index/messages/GHC-45102/example1/before/vegatables/Tomatoes.hs b/message-index/messages/GHC-45102/example1/before/vegatables/Tomatoes.hs new file mode 100644 index 00000000..a4ccc374 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/vegatables/Tomatoes.hs @@ -0,0 +1 @@ +module Tomatoes where diff --git a/message-index/messages/GHC-45102/example1/before/vegatables/vegetables.cabal b/message-index/messages/GHC-45102/example1/before/vegatables/vegetables.cabal new file mode 100644 index 00000000..246b4199 --- /dev/null +++ b/message-index/messages/GHC-45102/example1/before/vegatables/vegetables.cabal @@ -0,0 +1,13 @@ +cabal-version: 3.0 + +name: vegetables +version: 0.0.1 +license: MIT +author: Jappie +maintainer: hi@jappie.me +build-type: Simple + +library + exposed-modules: Tomatoes + build-depends: base + default-language: Haskell2010 diff --git a/message-index/messages/GHC-45102/example1/index.md b/message-index/messages/GHC-45102/example1/index.md new file mode 100644 index 00000000..b552a19a --- /dev/null +++ b/message-index/messages/GHC-45102/example1/index.md @@ -0,0 +1,16 @@ +--- +title: Lambda syntax in `case` expression +--- + +When pattern matching with a `case` expression, backslash (`\`) is not required before the pattern. + +## Error Message + +```haskell +LambdaInCase.hs:6:5: error: [GHC-00482] + Lambda-syntax in pattern. + Pattern matching on functions is not possible. + | +6 | \a -> a + | ^^^^^^^ +``` diff --git a/message-index/messages/GHC-45102/index.md b/message-index/messages/GHC-45102/index.md new file mode 100644 index 00000000..9f48d026 --- /dev/null +++ b/message-index/messages/GHC-45102/index.md @@ -0,0 +1,46 @@ +--- +title: Ambiguous module name from multiple packages +summary: A module with the same name was exported from multiple packages +severity: error +introduced: 9.6.1 +--- + + +When two packages export a module of the same name, ghc doesn't know which you +want to import. + +The solution is to use package import. + +So if we've two packages: + ++ package fruits exports tomatoes: +```haskell +module Tomatoes where +``` + ++ and package vegetables exports tomatoes: + +```haskell +module Tomatoes where +``` + +then our package salad program will cause an error: + +``` +module Salad where +import Tomatoes +``` + +The solution is to be specific with package imports: + +``` + +{-# LANGUAGE PackageImports #-} + +module Salad where + +import "vegetables" Tomatoes +``` + +alternatively you could patch the upstream libraries, +but package imports is usually easiest.