Skip to content

Instantly share code, notes, and snippets.

module KDT
( KDT
, empty
, makeFrom
, make
, inRange
, inRangeMatching
) where
import Data.Monoid ((<>))
import Control.Applicative
import Control.Monad.ST.Safe
import qualified Data.Vector.Unboxed as IU
import qualified Data.Vector.Unboxed.Mutable as U
-- Mutable world
data World s = World
{ _souls :: !(U.STVector s Int)
, _positions :: !(U.STVector s (Float,Float))
}
{-# LANGUAGE BangPatterns #-}
{-
Row/Column storage grid where each node is an 8x8 chunk of bytes.
-}
module ByteGrid
( ByteGrid
, make
, readUnsafe
{-# LANGUAGE BangPatterns #-}
module Main where
import qualified ByteGrid as BG
main = do
let bg0 = BG.make (512,512) 0
doThings bg0 0 0
{-# LANGUAGE BangPatterns #-}
{-
Row/Column storage grid where each node is an 8x8 chunk of bytes.
-}
module ByteGrid
( ByteGrid
, make
, readUnsafe