Is there a Haskell equivalent of OOP's abstract classes, using algebraic data types or polymorphism?

后端 未结 3 1649
说谎
说谎 2021-01-30 17:22

In Haskell, is it possible to write a function with a signature that can accept two different (although similar) data types, and operate differently depending on what type is pa

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-30 18:02

    It sounds like you might want to read up on typeclasses.

提交回复
热议问题