Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

please provide Vec example #84

Open
espguy opened this issue Mar 10, 2023 · 0 comments
Open

please provide Vec example #84

espguy opened this issue Mar 10, 2023 · 0 comments

Comments

@espguy
Copy link

espguy commented Mar 10, 2023

Augmenting the "examples/simple" code with a Vec data type:

import           Data.Nat                                     (Nat(S, Z))
import           Data.Vec.Lazy                                (Vec(VNil, (:::)))

data Input = Input
  { iInt32 :: C Int32,
    iDouble :: C Double,
    iVec :: Vec ('S ('S 'Z)) (C Int32)
  }
  deriving (Generic)

yields

simple/Main.hs:10:8: error:
    • No instance for (Categorifier.C.CTypes.GArrays.GArrays
                         (categorifier-c-recursion-0.1:Categorifier.C.Recursion.HFix
                            Categorifier.C.CExpr.Types.Core.CExprF)
                         (Categorifier.C.CExpr.Cat.TargetOb.TargetOb
                            (Data.Vec.Lazy.Vec
                               ('Data.Nat.S ('Data.Nat.S 'Data.Nat.Z))
                               (Categorifier.C.KTypes.C.C GHC.Int.Int32))))
        arising from a use of ‘writeCFiles’
    • In the expression:
        writeCFiles "/tmp" "simple_example" fCategorified
      In an equation for ‘main’:
          main = writeCFiles "/tmp" "simple_example" fCategorified
   |
10 | main = writeCFiles "/tmp" "simple_example" fCategorified

there appears to be GArrays instance here

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

No branches or pull requests

1 participant