Skip to content

let binding tuple of lenses error not an expression

This error seems to be fixed in GHC Head +/- 10 commits, but exists in GHC 8.0.1. I was told it might be a useful test case.

λ> :t userId
userId
  :: (RElem UserId rs (RIndex UserId rs), Functor f) =>
     (Int -> f Int) -> Record rs -> f (Record rs)
λ> let recLenses = userId &: Nil
λ> :t recLenses
recLenses
  :: (Functor f, RElem UserId rs (RIndex UserId rs)) =>
     Record '[s :-> ((Int -> f Int) -> Record rs -> f (Record rs))]
λ> :t recUncons
recUncons :: Record (s :-> a : rs) -> (a, Record rs)
λ> :t recUncons recLenses
recUncons recLenses
  :: (Functor f, RElem UserId rs (RIndex UserId rs)) =>
     ((Int -> f Int) -> Record rs -> f (Record rs), Record '[])
λ> let (l, ls) = recUncons recLenses

<no location info>: error:
    not an expression: ‘let (l, ls) = recUncons recLenses’
Trac metadata
Trac field Value
Version 8.0.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information