@@ -50,7 +50,7 @@ import qualified Paths_purescript as Paths
5050data ErrorMessage
5151 = UnsupportedModulePath String
5252 | InvalidTopLevel
53− | UnableToParseModule
53+ | UnableToParseModule String
5454 | UnsupportedExport
5555 | ErrorInModule ModuleIdentifier ErrorMessage
5656 deriving Show
@@ -109,8 +109,10 @@ printErrorMessage (UnsupportedModulePath s) =
109109 ]
110110printErrorMessage InvalidTopLevel =
111111 [ "Expected a list of source elements at the top level." ]
112−printErrorMessage UnableToParseModule =
113− [ "The module could not be parsed." ]
112+printErrorMessage (UnableToParseModule err) =
113+ [ "The module could not be parsed:"
114+ , err
115+ ]
114116printErrorMessage UnsupportedExport =
115117 [ "An export was unsupported. Exports can be defined in one of two ways: "
116118 , " 1) exports.name = ..."
@@ -530,7 +532,7 @@ bundle :: forall m. (Applicative m, MonadError ErrorMessage m)
530532 -> m String
531533bundle inputStrs entryPoints mainModule namespace = do
532534 input <- forM inputStrs $ \(ident, js) -> do
533− ast <- either (const $ throwError $ ErrorInModule ident UnableToParseModule) pure $ parse js (moduleName ident)
535+ ast <- either (throwError . ErrorInModule ident . UnableToParseModule) pure $ parse js (moduleName ident)
534536 return (ident, ast)
535537
536538 let mids = S.fromList (map (moduleName . fst) input)