[Haskell-cafe] makeFields without lenses

Nicola Gigante nicola.gigante at gmail.com
Sat Oct 4 12:44:53 UTC 2014


Il giorno 04/ott/2014, alle ore 13:03, Benjamin Edwards <edwards.benj at gmail.com> ha scritto:

> The compiler automatically provides accessor functions already.
> You can't have more than one function with the same name in the same module without a qualified import.
> 

Yes, that’s exactly the problem solved by makeFields. 
You declare the fields with a different name for each type
but you get a lens with the same name for each type by
declaring the suitable type class and instances.

What I was asking is if is it possible to do the same
generating simple functions instead of lenses.

The functions generated by the compiler with the
record syntax are not what I want, because the name
must be unique for any single type.

> Ben
> 

Thanks,
Nicola



More information about the Haskell-Cafe mailing list