Skip to content

Instantly share code, notes, and snippets.

@co-dan
Created August 18, 2013 07:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save co-dan/6260479 to your computer and use it in GitHub Desktop.
Save co-dan/6260479 to your computer and use it in GitHub Desktop.
src/Diagrams/Trail.hs:150:1:
Can't make a derived instance of `Transformable (SegTree v)'
(even with cunning newtype deriving):
it is not type-safe to use GeneralizedNewtypeDeriving on this class;
the last parameter of `Transformable' is at role N
In the stand-alone deriving instance for
`(HasLinearMap v, InnerSpace v, OrderedField (Scalar v)) =>
Transformable (SegTree v)'
--- Diagrams.Core.Transform:
-- | Type class for things @t@ which can be transformed.
class HasLinearMap (V t) => Transformable t where
-- | Apply a transformation to an object.
transform :: Transformation (V t) -> t -> t
--- Diagrams.Trail
newtype SegTree v = SegTree
{ getSegTree :: FingerTree (SegMeasure v) (Segment Closed v) }
deriving (Eq, Ord, Show)
-- But!
-- V (SegTree v) can be different from V (FingerTree (SegMeasure v) (Segment Closed v)) because of newtypes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment