Skip to content

Issue with updating purescript-partial to v0.14.0 #15

Closed

Description

@JordanMartinez

I noticed that this library is not included in the list for purescript/purescript#3942 I'm pretty sure it should be since it's part of the purescript org's repos.

Anyway, while working on it, I got this compiler error:

./compile.sh partial
[warn] WARNING: wasn't able to check if your package set import is frozen
[1/2 WarningParsingModule] .spago/partial/v2.0.1/src/Partial.purs:12:1

  12  foreign import crashWith :: forall a. Partial => String -> a
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  Constraints are deprecated in foreign imports and will be removed in a future release. Omit the constraint instead and update the foreign module accordingly.

[2/2 WarningParsingModule] .spago/partial/v2.0.1/src/Partial/Unsafe.purs:12:1

  12  foreign import unsafePartial :: forall a. (Partial => a) -> a
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  Constraints are deprecated in foreign imports and will be removed in a future release. Omit the constraint instead and update the foreign module accordingly.

           Src   Lib   All
Warnings   0     2     2  
Errors     0     0     0  
[info] Build succeeded.

I don't know how else unsafePartial could be written without using a (Partial => a) in the FFI. Thoughts?

Activity

  1. garyb commented on Oct 4, 2020

    @garyb
    Member

    We can change it so the implementation is like other FFI situations we have - rename the foreign imports to _crashWith and _unsafePartial and drop the constraint from them, remove them from the exports, and then define exported values like unsafePartial = _unsafePartial, adding the constraint to those.

  2. JordanMartinez commented on Oct 8, 2020

    @JordanMartinez
    ContributorAuthor

    Closed by #16

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions