module Data.PlaneGraph.AdjRep( Gr(..)
, Vtx(..)
, Face(..)
) where
import Data.PlanarGraph.AdjRep(Gr(..), Face(..))
import Data.Aeson
import Data.Geometry.Point
import GHC.Generics (Generic)
data Vtx v e r = Vtx { Vtx v e r -> Int
id :: Int
, Vtx v e r -> Point 2 r
loc :: Point 2 r
, Vtx v e r -> [(Int, e)]
adj :: [(Int,e)]
, Vtx v e r -> v
vData :: v
} deriving ((forall x. Vtx v e r -> Rep (Vtx v e r) x)
-> (forall x. Rep (Vtx v e r) x -> Vtx v e r)
-> Generic (Vtx v e r)
forall x. Rep (Vtx v e r) x -> Vtx v e r
forall x. Vtx v e r -> Rep (Vtx v e r) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v e r x. Rep (Vtx v e r) x -> Vtx v e r
forall v e r x. Vtx v e r -> Rep (Vtx v e r) x
$cto :: forall v e r x. Rep (Vtx v e r) x -> Vtx v e r
$cfrom :: forall v e r x. Vtx v e r -> Rep (Vtx v e r) x
Generic, a -> Vtx v e b -> Vtx v e a
(a -> b) -> Vtx v e a -> Vtx v e b
(forall a b. (a -> b) -> Vtx v e a -> Vtx v e b)
-> (forall a b. a -> Vtx v e b -> Vtx v e a) -> Functor (Vtx v e)
forall a b. a -> Vtx v e b -> Vtx v e a
forall a b. (a -> b) -> Vtx v e a -> Vtx v e b
forall v e a b. a -> Vtx v e b -> Vtx v e a
forall v e a b. (a -> b) -> Vtx v e a -> Vtx v e b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> Vtx v e b -> Vtx v e a
$c<$ :: forall v e a b. a -> Vtx v e b -> Vtx v e a
fmap :: (a -> b) -> Vtx v e a -> Vtx v e b
$cfmap :: forall v e a b. (a -> b) -> Vtx v e a -> Vtx v e b
Functor)
instance (ToJSON r, ToJSON v, ToJSON e) => ToJSON (Vtx v e r) where
toEncoding :: Vtx v e r -> Encoding
toEncoding = Options -> Vtx v e r -> Encoding
forall a.
(Generic a, GToJSON' Encoding Zero (Rep a)) =>
Options -> a -> Encoding
genericToEncoding Options
defaultOptions
instance (FromJSON r, FromJSON v, FromJSON e) => FromJSON (Vtx v e r)