I just started Haskell, and I was trying to create a simple Number data type that has one Int, for example:
data Number = Num Int deriving (Read, Show)
Then I tried to make read "1234" :: Number , hoping it would give something like Num 1234 , but it seems that instead I get "Exception: Prelude.read: no parse". Is there anything else I am missing?
source share