7
Cebirsel Veri Tiplerini C # - veya Java benzeri bir dilde nasıl kodlarsınız?
Cebirsel Veri Tipleri ile kolayca çözülebilen bazı problemler vardır, örneğin bir Liste tipi kısaca şöyle ifade edilebilir: data ConsList a = Empty | ConsCell a (ConsList a) consmap f Empty = Empty consmap f (ConsCell a b) = ConsCell (f a) (consmap f b) l = ConsCell 1 (ConsCell 2 …