summaryrefslogtreecommitdiffstats
path: root/app/Pretty.hs
diff options
context:
space:
mode:
authorLibravatar Fabian Kirchner <kirchner@posteo.de>2024-08-12 18:03:00 +0200
committerLibravatar Fabian Kirchner <kirchner@posteo.de>2024-08-12 18:03:00 +0200
commit9c71a73775ddb2965fd2f792321900a87d2d5592 (patch)
treed6dde2482aa1fe8664699d0d695c99ae8d4331f8 /app/Pretty.hs
parentd2522987a78a3c8b616c9b5f343a940ec15bd3ed (diff)
feat: add weather forecast
Diffstat (limited to 'app/Pretty.hs')
-rw-r--r--app/Pretty.hs6
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