Skip to content

the getVertices example may be outdated #1

@madjestic

Description

@madjestic
getVertices :: Gltf -> [V3 Float]
getVertices gltf = concatMap getVertices' (gltf ^. _meshes)
  where getVertices' mesh = concatMap (^. _meshPrimitivePositions) (mesh ^. _meshPrimitives)

produces the following error:

    • Couldn't match type: vector-0.12.3.1:Data.Vector.Vector
                             (V3 Float)
                     with: [b]
      Expected: Getting [b] MeshPrimitive [b]
        Actual: (vector-0.12.3.1:Data.Vector.Vector (V3 Float)
                 -> Data.Functor.Const.Const
                      [b] (vector-0.12.3.1:Data.Vector.Vector (V3 Float)))
                -> MeshPrimitive -> Data.Functor.Const.Const [b] MeshPrimitive
    • In the expression: _meshPrimitivePositions
      In the first argument of ‘concatMap’, namely
        ‘(^. _meshPrimitivePositions)’
      In the expression:
        concatMap (^. _meshPrimitivePositions) (mesh ^. _meshPrimitives)
    • Relevant bindings include
        getVertices' :: Mesh -> [b] (bound at app/Mandelbrot_glTF.hs:380:9)
    |
380 |   where getVertices' mesh = concatMap (^. _meshPrimitivePositions) (mesh ^. _meshPrimitives)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions