Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,334
    • Issues 4,334
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 369
    • Merge Requests 369
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #15043

Closed
Open
Opened Apr 16, 2018 by Domen Kožar@domenkozarReporter

A more aggressive version of -fprint-expanded-synonyms that prints all type synonyms

Using GHC 8.2.2 and stack build --ghc-options=-fprint-expanded-synonyms I have the following type synonym for servant:

type Get302 (cts :: [*]) (hs :: [*]) = Verb 'GET 302 cts
  (Headers (Header "Location" String ': hs) NoContent)

and get the following error message when String is mismatched for Text:

        • Couldn't match type ‘Text’ with ‘[Char]’
          Expected type: AsServerT App
                         :- ("login"
                             :> ("callback"
                                 :> (QueryParam "code" Text
                                     :> (QueryParam "state" Text
                                         :> MyApp.Types.Servant.Get302
                                              '[PlainText]
                                              '[Header "Set-Cookie" SetCookie,
                                                Header "Set-Cookie" SetCookie]))))
            Actual type: Maybe Code
                         -> Maybe Text
                         -> App
                              (Headers
                                 '[Header "Location" Text, Header "Set-Cookie" SetCookie,
                                   Header "Set-Cookie" SetCookie]
                                 NoContent)

The error is confusing as type synonym is not expanded and offending Header is missing from the output in the expected type.

Edited Mar 10, 2019 by Ryan Scott
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#15043