What's the difference between type and data type in Haskell?

前端 未结 2 865
醉梦人生
醉梦人生 2021-02-05 00:35

I\'m a little confused as to the difference between a type and a data type in Haskell.

From the literature I have enc

2条回答
  •  旧时难觅i
    2021-02-05 01:27

    Type and data type refer to exactly the same concept.

    The Haskell keywords type and data are different, though: data allows you to introduce a new algebraic data type, while type just makes a type synonym.

    See the Haskell wiki for details.

提交回复
热议问题