IO is a type constructor, not a value constructor. Type constructor is defined in left hand side of data/type/newtype, can be used in right hand side of type signature. Value constructor is defined in right hand side of data/type/newtype, only it can be used in pattern match. Value constructor and type constructor may have same name or not.
i.e.
data Foo a = Bar a | ACG
Foo is type constructor, Bar and ACG are value constructor.
没看real world haskell是我2015,2016年最大的遗憾。
原来英文版还是看得懂的,可惜当年疯狂找中文版,翻译的丢三落四的破烂中文版。
网友评论