1

The following does not work, how do I fix it?

Prelude Control.Lens> (2, 3, 4) ^. alongside _1 _2

<interactive>:19:14:
    Couldn't match type ‘(s0, s'0)’ with ‘(t0, t1, t2)’
    Expected type: Getting (a, a') (t0, t1, t2) (a, a')
      Actual type: LensLike
                     (Const (a, a')) (s0, s'0) (t3, t'0) (a, a') (a, a')
    In the second argument of ‘(^.)’, namely ‘alongside _1 _2’
    In the expression: (2, 3, 4) ^. alongside _1 _2

What I wanted was (2, 3).

Naveen Kumar Alone
  • 7,536
  • 5
  • 36
  • 57
yong
  • 3,583
  • 16
  • 32
  • 2
    See here: http://stackoverflow.com/questions/26722458/using-a-lens-to-read-multiple-fields/26723075#26723075 `alongside` only works with a two-element tuple. – danidiaz Dec 30 '14 at 13:29
  • Did you want a getter or a full lens? – AndrewC Dec 31 '14 at 00:38

0 Answers0