Skip to content
This repository has been archived by the owner on Oct 23, 2018. It is now read-only.

showPerson signature definition in section 5.7 doesn't work (using Purescript 0.12) #134

Open
gcsolaroli opened this issue Jun 17, 2018 · 0 comments

Comments

@gcsolaroli
Copy link

Following the book running the examples with Purescript 0.12 I had an issue with code snippets on sections 5.7 (Record Patterns and Row Polymorphism).

When declaring the function 'showPerson' following code listed in the book

 showPerson :: { first :: String, last :: String } -> String

I was not able to use to print out details of records with extra fields.

In order to get the desired behaviour, I had to change the declared signature, with the signature show a few lines below as output of :type showPerson:

 showPerson :: forall r. { firstName :: String, lastName :: String | r } -> String

I haven't tested this issue with prior version of the compiler.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant