Giter VIP home page Giter VIP logo

quadtree's Introduction

QuadTree

QuadTree library for Haskell, with lens support built in.

You can find documentation for the library here!

quadtree's People

Contributors

ashleymoni avatar schell avatar mgajda avatar isovector avatar

Stargazers

Yuki Langley avatar Matthew avatar John avatar Milán Nagy avatar Luke Meyers avatar hussein-aitlahcen avatar Aesa Kamar avatar Jason Hickner avatar Michael Litchard avatar Ra Kowalski avatar Masashi Fujita avatar  avatar Frank Cash avatar Chris A. avatar Violet Hynes avatar

Watchers

Michael Litchard avatar James Cloos avatar  avatar

quadtree's Issues

filterTree returning list

Hi, thank you for your library!

I've started using it to store terrain (rectangles) for an OpenGL project. fmap/tmap'ing over the QuadTree has worked very well so far.

However, I would now like to cull some of the terrain using the camera's position and angle. I thought I might use filterTree to create a new, slimmer QuadTree, but it seems to return a list.

I have two questions / issues:

  1. Does filterTree explore a node's children if the node itself fails the filter test?
  2. Is there a reason behind returning a list instead of a new QuadTree?

Thanks!

Open to small PR?

Hello! Are you open to a small pull request contribution along the lines of the following?

-- |Unsafe sanity test lens that makes sure a given location index exists
-- within the relevant 'QuadTree'.
verifyLocation :: HCS => Location -> Lens' (QuadTree a) (QuadTree a)
verifyLocation index f qt
  | index `outOfBounds` qt = error $ ""
    ++ "Location index out of QuadTree bounds."
    ++ " Attempted index: " ++ show index ++ ","
    ++ " Max index: " ++ show (treeLength qt - 1, treeWidth qt - 1)
  | otherwise              = f qt

type HCS = HasCallStack

If so I intend to clean up and submit one.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.