I have the following two type definitions in Haskell which are from Thompsons 'Craft of Functional Programmingi', Second Edition, 1999.
type ShopItem = (String,Int)
type Basket = [ShopItem]
When I try to create my own 'selector function' on these types as such:
name :: ShopItem -> String
price :: ShopItem -> Int
GHCI gives me the following error.
The type signature for ‘name’ lacks an accompanying binding
Why isn't 'name' bound to the String element of the ShopItem tuple and likewise for 'price'?
Is this older syntax that is no longer acceptable in the current version of GHCI? I'm using version 7.10.3 on current Linux Mint 18.
nameandpricebut without writing the implementation. - Alec