Skip to content
This repository was 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

@gcsolaroli

Description

@gcsolaroli

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions