module Clash.Sized.Internal where
formatRange ::
(Ord a, Show a) =>
a ->
a ->
String
formatRange :: a -> a -> String
formatRange a
n a
m
| a
m a -> a -> Bool
forall a. Ord a => a -> a -> Bool
< a
n = String
"<empty range>"
| a
m a -> a -> Bool
forall a. Eq a => a -> a -> Bool
== a
n = Char
'[' Char -> String -> String
forall a. a -> [a] -> [a]
: a -> String -> String
forall a. Show a => a -> String -> String
shows a
n String
"]"
| Bool
otherwise = Char
'[' Char -> String -> String
forall a. a -> [a] -> [a]
: a -> String
forall a. Show a => a -> String
show a
n String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
".." String -> String -> String
forall a. [a] -> [a] -> [a]
++ a -> String -> String
forall a. Show a => a -> String -> String
shows a
m String
"]"