We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
getVertices
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)
The text was updated successfully, but these errors were encountered:
This seems to work:
import Text.GLTF.Loader as Gltf import Lens.Micro import Linear.V3 import qualified Data.Vector as V getVertices :: Gltf -> V.Vector (V3 Float) getVertices gltf = V.concatMap getVertices' (gltf ^. _meshes) where getVertices' mesh = V.concatMap (^. _meshPrimitivePositions) (mesh ^. _meshPrimitives)
Sorry, something went wrong.
You're right, I never updated the docs after I switched to Vectors. Feel free to open a PR with the updated example. If not I'll eventually get to it
No branches or pull requests
produces the following error:
The text was updated successfully, but these errors were encountered: