diff options
Diffstat (limited to 'app/Pretty.hs')
-rw-r--r-- | app/Pretty.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/app/Pretty.hs b/app/Pretty.hs index 8621a41..07b3296 100644 --- a/app/Pretty.hs +++ b/app/Pretty.hs @@ -36,6 +36,12 @@ instance Pretty String where instance Pretty Float where pretty = pretty . Diagram 1 . (: []) +instance (Pretty a) => Pretty (Maybe a) where + pretty maybeA = + case maybeA of + Nothing -> Lit Nothing "n/a" + Just a -> pretty a + data Diagram a = Diagram Int a deriving (Functor, Show) diagram :: Int -> a -> Diagram a |