Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,862
    • Issues 4,862
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 455
    • Merge requests 455
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #11982
Closed
Open
Created Apr 26, 2016 by Simon Peyton Jones@simonpjDeveloper

Typechecking fails for parallel monad comprehensions with polymorphic let (GHC 7.10.3 through 8.6.3)

{-# LANGUAGE MonadComprehensions, ParallelListComp #-}

module Foo where

foo xs ys = [ (f y True, f x 'c')
            | let f _ z = z, x <- xs
            | y <- ys ]

This fails with

Foo.hs:5:52: error:
    * Cannot instantiate unification variable `t0'
      with a type involving foralls: forall t2 t3. t3 -> t2 -> t2
        GHC doesn't yet support impredicative polymorphism
    * In a stmt of a monad comprehension:
        let f _ z = z, x <- xs |  y <- ys
      In the expression:
        [(f y True, f x 'c') | let f _ z = z, x <- xs |  y <- ys]
      In an equation for `foo':
          foo xs ys
            = [(f y True, f x 'c') | let f _ z = z, x <- xs |  y <- ys]

NB: ApplicativeDo has a related problem: the implementation is quite different and has the effect of monomorphising the let-bound variable.

Trac metadata
Trac field Value
Version 7.10.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Edited Mar 10, 2019 by vdukhovni
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking