andrewMacmurray / haskell-book-solutions

Solutions to exercises in Haskell Programming from first principles
MIT License
38 stars 5 forks source link

Does not type check #21

Closed BebeSparkelSparkel closed 6 years ago

BebeSparkelSparkel commented 6 years ago

https://github.com/andrewMacmurray/haskell-book-solutions/blob/f4fd386187c03828d1736d9a43642ab4f0ec6462/src/ch11/vehicles.hs#L45

andrewMacmurray commented 6 years ago

@BebeSparkelSparkel really? Mine compiles and runs fine, is there something specific you did to assert it doesn't type check?

BebeSparkelSparkel commented 6 years ago

Now that I'm looking at this more closely it seems that the book may have changed so that Plane only has one attribute

data Vehicle = Car Manufacturer Price
             | Plane Airline
             deriving (Eq, Show)

Thanks for checking on this

andrewMacmurray commented 6 years ago

@BebeSparkelSparkel Ah that makes sense, I should probably either add the version of the book I used or update the exercise, cheers for letting me know 👍

BebeSparkelSparkel commented 6 years ago

Np you're welcome