{-
Copyright 2015 Martin Buck
This file is part of H2D.
H2D is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
H2D is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with H2D.  If not, see <http://www.gnu.org/licenses/>.
-}

{-# LANGUAGE FlexibleInstances #-}
module Moveable where

import Types2D
import Base2D

class Moveable a where
    move :: a -> Vec2D -> a

instance Moveable Vec2D where
    move (Vec2D a b) (Vec2D x y) = Vec2D (a+x) (b+y)

instance Moveable Path2D where
    move path delta  = chunkParMap pointChunkSize (move delta) path
