Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Iris rejects Extend function instance with invalid kind

Closed
#601 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
node.js, rust
Domain
compilers

Research direction

Reproduce the disagreement using spago.yaml and src/Main.purs, first running spago build and the Node command, then iris build --quiet --color never. Investigate Iris's handling of the Extend expression at src/Main.purs:9 and the resulting CannotUnify diagnostics. Done means Iris compiles this reproduction without errors, matching purs's successful result.

Written by the indexing model from the issue text.

Description

With purs 0.15.15, Iris 0.1.1, Spago 1.0.3 and Node 22.16.0, create these two files in a fresh directory:

spago.yaml:

package:
  name: extend-function-repro
  dependencies:
    - control
    - effect
    - console
workspace:
  packageSet:
    registry: 81.1.0

src/Main.purs:

module Main where

import Prelude
import Control.Extend as Extend
import Effect (Effect)
import Effect.Console (log)

main :: Effect Unit
main = log (show (Extend.extend (\f -> f "B") (\s -> s <> "!") "A"))

Run from that directory with spago, purs and iris on PATH:

spago build
node -e 'import("./output/Main/index.js").then(m => m.main())'
iris build --quiet --color never

Observed: spago build succeeds with zero errors and purs's output prints "AB!". Iris exits with status 1, reporting two CannotUnify errors at src/Main.purs:9 (Cannot unify 'Type' with '?[invalid kind]'), followed by NoInstanceFound: Show ?[invalid function application] and compilation failed. The latter diagnostic may be cascading; the internal cause is not established. This is a compile disagreement, not a runtime mismatch.

The expression uses the Semigroup String => Extend ((->) String) instance from control 6.0.0: evaluating the extended function at "A" asks the input function for "B", yielding "AB!". The resolved registry dependencies are control 6.0.0, prelude 6.0.2, newtype 5.0.0, safe-coerce 2.0.0, unsafe-coerce 6.0.0, effect 4.0.0 and console 6.1.0. The generated spago.lock for this two-file reproduction has SHA-256 c54a52bb0a07f41b163cc3f844ae27449ff19980919fecb92c72243264918f26.

Dominant language
Rust
Stars
117
Forks
11
Avg merge
4h 22m
Merged PRs (30d)
126

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from purefunctor/purescript-iris

All issues in purefunctor/purescript-iris

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.