From d91c6bb446d0284f096cc6cfc9a7f9ac7f8afb1e Mon Sep 17 00:00:00 2001 From: LLLL Colonq Date: Sun, 14 Jan 2024 19:01:03 -0500 Subject: Add fig-bless --- fig-utils/src/Fig/Prelude.hs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'fig-utils/src/Fig/Prelude.hs') 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 -- cgit v1.2.3