↧
Answer by Dan D. for Haskell - data type functions
You mean something like:addLengths x y = INCH ((convert x) + (convert y))There might be more parentheses than required.The use of the INCH constructor is not a type cast.
View ArticleHaskell - data type functions
I'm learning Haskell and started looking over data types. I tried doing a simple example with converting Yard and feet to inches with a data type defined as LengthUnit. I want to add two LengthUnit...
View Article