I have been reading "learn you haskell for great good", and in this part:
"let’s put a string that represents a person in a script and then load that script in GHCi:
mysteryDude = "Person { firstName =\"Michael\"" ++
", lastName =\"Diamond\"" ++
", age = 43}"
We wrote our string across several lines like this for increased readability. If we want to read that string, we need to tell Haskell which type we expect in return:
ghci> read mysteryDude :: Person
But I don't know how to create the 'script', it's in mysteryDude.hs file, and then I need to load it with >:l mysteryDude.hs
Or what. But I tried it and I got this error:
*Main> read mysteryDude.hs :: Person
<interactive>:50:23: error:
Not in scope: type constructor or class ‘Person’
*Main> read mysterDude.hs :: Person
I see that in the web here, they change it, and don't do it in the same way, so, maybe it's an error.
But even if in this example is an error I would like to know how to write a 'script' and load data from it.
data PersoninsidemysteryDude.hs?mysteryDude.hsimport it?