Add note on importing `Data.Generics.Labels` in Lens reference
I'm learning up on the basics of Shpadoinkle currently; when I was working on how to compose different Html
types using lens, I ran into the error
Could not deduce (GHC.OverloadedLabels.IsLabel
"_foo"
((Foo.State -> f Foo.State) -> State -> f State))
arising from the overloaded label ‘#_Foo’
(maybe you haven't applied a function to enough arguments?)
when trying to use OverloadedLabels
for my lens. There's a small note about generic-lens
at the beginning, but its not very clear that users need to
- Add
generic-lens
into ourbuild-depends
list in the cabel file - Need to import
Data.Generics.Labels
in any modules where we wish to use label lenses.
I realize this isn't a Shpadoinkle specific issue, and any well seasoned Haskell programmer probably knows this inherently, but adding a note in here will make it easier for newcomers. Took me a few days to figure out. Thanks!