Skip to content

Commit

Permalink
Export Default from Prelude.
Browse files Browse the repository at this point in the history
  • Loading branch information
cchalmers committed Mar 11, 2015
1 parent f3b535b commit f3da7fe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Diagrams/Prelude.hs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ module Diagrams.Prelude

-- * Convenience re-exports

-- | For working with default values. Diagrams also exports 'with',
-- an alias for 'def'.
, module Data.Default.Class

-- | For representing and operating on colors.
, module Data.Colour

Expand Down Expand Up @@ -80,6 +84,7 @@ import Control.Lens hiding (argument, at, backwards,
none, outside, singular, transform,
( # ), (...), (.>), (<.>))
import Data.Active
import Data.Default.Class
import Data.Colour hiding (AffineSpace (..), atop,
over)
import Data.Colour.Names hiding (tan)
Expand Down

4 comments on commit f3da7fe

@byorgey
Copy link
Member

Choose a reason for hiding this comment

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

What's the rationale for this re-export? I don't know why one would typically need the Default class; and we export with that can be used instead of def. I ask particularly because this breaks some code in the website (def clashes with another def defined in System.Console.CmdArgs).

@byorgey
Copy link
Member

Choose a reason for hiding this comment

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

I suppose it is useful when making functions that take records of optional arguments, in diagrams style...

@cchalmers
Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, the clash with cmdargs is unfortunate but it looks they do the same thing anyway. I added it because sometimes the word def makes more sense, and you can define instances with it.

I had a look and def doesn't seem to clash and much else and we normally use optparse-applicative. I'd like it stay in the prelude but I'm not overly bothered.

@byorgey
Copy link
Member

Choose a reason for hiding this comment

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

Yeah, let's leave it in. After I commented it out and recompiled, a bunch of things in -contrib and elsewhere broke, and I realized fixing that would be even more annoying. =)

Please sign in to comment.