Title :
Type classes in Mercury
Author :
Jeffery, David ; Henderson, Fergus ; Somogyi, Zoltan
Author_Institution :
Dept. of Comput. Sci. & Software Eng., Melbourne Univ., Parkville, Vic., Australia
fDate :
6/22/1905 12:00:00 AM
Abstract :
The type systems of functional languages such as Haskell have recently become more powerful and expressive. They not only allow programmers to write code that works on values of any type (genericity), they also allow programmers to require that a particular type belongs to a given type class (constrained genericity). Such code may use any of the methods of the type class, since every type that is a member of the type class must implement those methods. This capability makes it significantly easier to express solutions to many common problems, and promotes code reuse. Incorporating type classes in a logic programming language provides some new challenges. In this paper, we explain how we have extended Mercury´s type system to include support for type classes. We show that type classes integrate very nicely with Mercury´s mode, determinism and uniqueness systems, and describe how our implementation works
Keywords :
logic programming languages; type theory; Mercury; code reuse; functional languages; logic programming language; type system; type systems; Computer science; Electrical capacitance tomography; Identity-based encryption; Logic programming; Programming profession; Runtime; Software engineering; Software systems;
Conference_Titel :
Computer Science Conference, 2000. ACSC 2000. 23rd Australasian
Conference_Location :
Canberra, ACT
Print_ISBN :
0-7695-0518-X
DOI :
10.1109/ACSC.2000.824391