advent-0.1.0.0: Advent of Code common library
Copyright(c) Eric Mertens 2018
LicenseISC
Maintaineremertens@gmail.com
Safe HaskellNone
LanguageHaskell2010

Advent.Coord3

Description

 
Synopsis

Documentation

data Coord3 Source #

Three-dimensional coordinate: x, y, z

Constructors

C3 !Int !Int !Int 

Instances

Instances details
Data Coord3 Source # 
Instance details

Defined in Advent.Coord3

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Coord3 -> c Coord3 #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Coord3 #

toConstr :: Coord3 -> Constr #

dataTypeOf :: Coord3 -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Coord3) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Coord3) #

gmapT :: (forall b. Data b => b -> b) -> Coord3 -> Coord3 #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Coord3 -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Coord3 -> r #

gmapQ :: (forall d. Data d => d -> u) -> Coord3 -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> Coord3 -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Coord3 -> m Coord3 #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Coord3 -> m Coord3 #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Coord3 -> m Coord3 #

Generic Coord3 Source # 
Instance details

Defined in Advent.Coord3

Associated Types

type Rep Coord3 
Instance details

Defined in Advent.Coord3

Methods

from :: Coord3 -> Rep Coord3 x #

to :: Rep Coord3 x -> Coord3 #

Ix Coord3 Source # 
Instance details

Defined in Advent.Coord3

Num Coord3 Source #

Vector arithmetic

Instance details

Defined in Advent.Coord3

Show Coord3 Source # 
Instance details

Defined in Advent.Coord3

Eq Coord3 Source # 
Instance details

Defined in Advent.Coord3

Methods

(==) :: Coord3 -> Coord3 -> Bool #

(/=) :: Coord3 -> Coord3 -> Bool #

Ord Coord3 Source # 
Instance details

Defined in Advent.Coord3

type Rep Coord3 Source # 
Instance details

Defined in Advent.Coord3

origin :: Coord3 Source #

Alias for 0, 0, 0

manhattan :: Coord3 -> Coord3 -> Int Source #

Sum of absolute value of differences in each of the 3 axes.

boundingBox :: Foldable f => f Coord3 -> Maybe (Coord3, Coord3) Source #

Find the upper-left and lower-right coordinates that inclusively contain all the coordinates in a list of coordinates.

mapCoord :: (Int -> Int) -> Coord3 -> Coord3 Source #

Apply a function to the y and x coordinate

zipCoord :: (Int -> Int -> Int) -> Coord3 -> Coord3 -> Coord3 Source #

Use a function pairwise on x and y coordinates of the two arguments