Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add PrintDot instances for Word32 and Word64 #56

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Data/GraphViz/Printing.hs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ import Data.Char (toLower)
import qualified Data.Set as Set
import Data.String (IsString(..))
import Data.Version (Version(..))
import Data.Word (Word16, Word8)
import Data.Word (Word64, Word32, Word16, Word8)

#if !(MIN_VERSION_base (4,11,0))

Expand Down Expand Up @@ -191,6 +191,12 @@ instance PrintDot Word8 where
instance PrintDot Word16 where
unqtDot = int . fromIntegral

instance PrintDot Word32 where
unqtDot = unqtDot . toInteger

instance PrintDot Word64 where
unqtDot = unqtDot . toInteger

instance PrintDot Double where
-- If it's an "integral" double, then print as an integer. This
-- seems to match how Graphviz apps use Dot.
Expand Down