[Haskell-cafe] Can I have an alias for selector?

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Fri Nov 18 08:30:32 CET 2011


On 18 November 2011 18:16, Magicloud Magiclouds
<magicloud.magiclouds at gmail.com> wrote:
> Hi,
>  For example: "data A = B { c :: Int }". Then I must use it this way
> "(B 0) { c = 1 }". Anyway I could make it like "(B 0) { d = 1 }"?

No, but you *can* write a function of type `B -> Int -> B' to do it for you.

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com



More information about the Haskell-Cafe mailing list