I'm writing a simulation and I have to define a data type for a process. The data type includes a process name and execution time. What would be the consequences of using a synonym for [m]([Char], Int)[m] rather a new data type (data Proc = Proc [Char] Int)
?
Name:
Anonymous2009-05-02 4:05
A new data type is distinct from (Char,Int) so it won't inherit any type classinstances, such as Functor ((,) a).
But more importantly, if you're likely to be using ([Char], Int) to mean something different elsewhere, and they could be confused, then you should probably distinguish them with data or newtype.