Skip to content

Commit

Permalink
use a Constraint synonym instead of empty class
Browse files Browse the repository at this point in the history
  • Loading branch information
byorgey committed Dec 16, 2016
1 parent cddd6e6 commit 2e51c50
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Diagrams/Core/Style.hs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE GADTs #-}
Expand Down Expand Up @@ -105,7 +106,7 @@ import Linear.Vector
-- simply guarantees 'Typeable' and 'Semigroup' constraints. The
-- 'Semigroup' instance for an attribute determines how it will combine
-- with other attributes of the same type.
class (Typeable a, Semigroup a) => AttributeClass a
type AttributeClass a = (Typeable a, Semigroup a)

-- | An existential wrapper type to hold attributes. Some attributes
-- are simply inert/static; some are affected by transformations;
Expand Down

1 comment on commit 2e51c50

@cchalmers
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you keep the class and write a (Typeable a, Semigroup a) => AttributeClass a instance then you don't need constraint kinds. The diagrams-lib build is broken on 7.8 because of this. (You could add ConstraintKinds to every module that uses it on -lib but that seems like more work).

Also I am actually uses this class in my rewrite to address #84.

Please sign in to comment.