So I was writing some code today and I go this error message and had some comments

  /*****/packages/ux/web/*********git /******/*****/Web/Web.hs:124:21: error:
        * Couldn't match expected type `WidgetConfig t ChartJSData'
                      with actual type `ChartJSData'
        * In the first argument of `chart', namely `chartData'
          In a stmt of a 'do' block: _ <- chart chartData
          In the expression:
            do { el "h1" $ text "CHART!";
                 let chartData = ...;
                 _ <- chart chartData;
                 return $ constDyn () }
        * Relevant bindings include
            testChart :: m (Dynamic t ())
              (bound at src/*****/******/Web/Web.hs:107:1)

First of all the problem is that the ChartJSData needs to be wrapped in the WidgetConfig data-structure. The problem is that the error message gives you know idea of how to do that. There is probably a function of the form a -> WidgetConfig t a somewhere.

It would make for a much better developer experience if the error message could say “Try function Module.function”

In addition, the code that it shows me has been de-sugared, so the code that it shows me is not actually the code I wrote.