Lack of companion binding - what does it mean? How it works?

I train from LYAH.

The phoneBook.hs file contains the following code:

phoneBook :: [(String, String)]

When I try to compile the above code, I get the following error:

* Home>: download "/home/optimight/phoneBook.hs" [1 of 1] Compiling Main (/home/optimight/phoneBook.hs, interpreted)

/home/optimight/phoneBook.hs:1:1: Typical signature for "phoneBook" has no accompanying binding. Failure, modules loaded: no.

The question is added after the brano answer and the subsequent comment on this answer: How do we provide an implementation for the above type signature?

If I add this:

type phoneBook = [(String, String)]

I get the following error:

> : "/home/optimight/phoneBook.hs" [1 1] Main (/home/optimight/phoneBook.hs, )

/home/optimight/phoneBook.hs:2:6:      : phoneBook , : none

+5
2

.

phoneBook :: [(String, String)] - .

+6

, i.e. type PhoneBook = [(String, String)].

, (), , . :

phoneBook :: [(String, String)]
phoneBook = undefined

undefined [(String, String)], . [("Person","Number")].

+1

All Articles