Skip to content

please provide Vec example #84

@espguy

Description

@espguy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions