summaryrefslogtreecommitdiff
path: root/fig-utils/src/Fig/Prelude.hs
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2024-01-14 19:01:03 -0500
committerLLLL Colonq <llll@colonq>2024-01-14 19:01:03 -0500
commitd91c6bb446d0284f096cc6cfc9a7f9ac7f8afb1e (patch)
treebbe259dee2c6d869570565618a3aa86a00e9f5b3 /fig-utils/src/Fig/Prelude.hs
parentb27c50d962c43dfc3660d28fc0a096966c5a1066 (diff)
Add fig-bless
Diffstat (limited to 'fig-utils/src/Fig/Prelude.hs')
-rw-r--r--fig-utils/src/Fig/Prelude.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/fig-utils/src/Fig/Prelude.hs b/fig-utils/src/Fig/Prelude.hs
index 6db69cf..4513b59 100644
--- a/fig-utils/src/Fig/Prelude.hs
+++ b/fig-utils/src/Fig/Prelude.hs
@@ -1,3 +1,5 @@
+{-# Language UndecidableInstances #-}
+
module Fig.Prelude
( quot, mod, rem, quotRem
, module GHC.Num
@@ -45,6 +47,7 @@ module Fig.Prelude
, log
, Pretty(..)
+ , Fix(..), unFix
) where
import Prelude (quot, mod, rem, quotRem)
@@ -117,3 +120,11 @@ class Pretty a where
instance Pretty Void where
pretty _ = ""
+
+newtype Fix f = Fix { unFix :: f (Fix f) }
+unFix :: Fix f -> f (Fix f)
+unFix (Fix x) = x
+instance Pretty (f (Fix f)) => Pretty (Fix f) where
+ pretty (Fix x) = pretty x
+instance Show (f (Fix f)) => Show (Fix f) where
+ show (Fix x) = show x