-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
additional types + computing weights from scratch
- Loading branch information
Showing
8 changed files
with
227 additions
and
137 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
hgeometry/src/HGeometry/Plane/LowerEnvelope/Connected/Separator/Type.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
{-# LANGUAGE TemplateHaskell #-} | ||
-------------------------------------------------------------------------------- | ||
-- | | ||
-- Module : HGeometry.Plane.LowerEnvelope.Separator.Type | ||
-- Copyright : (C) Frank Staals | ||
-- License : see the LICENSE file | ||
-- Maintainer : Frank Staals | ||
-- | ||
-- A Separator for ap lanar graph | ||
-- | ||
-------------------------------------------------------------------------------- | ||
module HGeometry.Plane.LowerEnvelope.Connected.Separator.Type | ||
( Separator(Separator), separator, inside, outside | ||
) where | ||
|
||
import Control.Lens hiding (inside,outside) | ||
|
||
-------------------------------------------------------------------------------- | ||
|
||
-- | A separator | ||
data Separator a = Separator { _separator :: a | ||
, _inside :: a | ||
, _outside :: a | ||
} | ||
deriving (Show,Eq,Functor,Foldable,Traversable) | ||
|
||
makeLenses ''Separator | ||
|
||
instance Semigroup a => Semigroup (Separator a) where | ||
(Separator sep is os) <> (Separator sep' is' os') = | ||
Separator (sep <> sep') (is <> is') (os <> os') | ||
|
||
instance (Monoid a) => Monoid (Separator a) where | ||
mempty = Separator mempty mempty mempty |
Oops, something went wrong.