Skip to content

Generalize op2 type parameter.#64

Merged
dmjio merged 5 commits into
masterfrom
modify-op2
May 23, 2026
Merged

Generalize op2 type parameter.#64
dmjio merged 5 commits into
masterfrom
modify-op2

Conversation

@dmjio
Copy link
Copy Markdown
Member

@dmjio dmjio commented May 22, 2026

Generalizes op2 return type so lookup can unify.

src/ArrayFire/Index.hs:52:22: error: [GHC-25897]
    • Couldn't match type ‘a’ with ‘Int’
      Expected: Array a
        Actual: Array Int
      ‘a’ is a rigid type variable bound by
        the type signature for:
          ArrayFire.Index.lookup :: forall a.
                                    Array a -> Array Int -> Int ->
Array a
        at src/ArrayFire/Index.hs:(44,1)-(51,12)
    • In the second argument of ‘op2’, namely ‘b’
      In the first argument of ‘($)’, namely ‘op2 a b’
      In the expression:
        op2 a b $ \ p x y -> af_lookup p x y (fromIntegral n)
    • Relevant bindings include
        a :: Array a (bound at src/ArrayFire/Index.hs:52:8)
        lookup :: Array a -> Array Int -> Int -> Array a
          (bound at src/ArrayFire/Index.hs:52:1)
   |
52 | lookup a b n = op2 a b $ \p x y -> af_lookup p x y (fromIntegral
n)
   |                      ^
Error: cabal: Failed to build arrayfire-0.7.0.0.

@dmjio dmjio merged commit 50ce116 into master May 23, 2026
1 check passed
@dmjio dmjio deleted the modify-op2 branch May 23, 2026 08:13
@dmjio dmjio mentioned this pull request May 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant