From 250e3beae7a961fc740f775a563c303b4cc390fe Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 1 Aug 2024 22:04:52 +0200 Subject: Initial --- src/Data/StableName/Extra.hs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/Data/StableName/Extra.hs (limited to 'src/Data/StableName/Extra.hs') diff --git a/src/Data/StableName/Extra.hs b/src/Data/StableName/Extra.hs new file mode 100644 index 0000000..f568740 --- /dev/null +++ b/src/Data/StableName/Extra.hs @@ -0,0 +1,17 @@ +{-# LANGUAGE BangPatterns #-} +{-# OPTIONS_GHC -fno-full-laziness -fno-cse #-} +module Data.StableName.Extra ( + StableName, + makeStableName', +) where + +import GHC.StableName +import System.IO.Unsafe + + +-- | This function evaluates its argument to WHNF and returns a stable name for +-- the evaluation result. This function is not referentially transparent and is +-- implemented using 'unsafePerformIO'. +{-# NOINLINE makeStableName' #-} +makeStableName' :: a -> StableName a +makeStableName' !x = unsafePerformIO (makeStableName x) -- cgit v1.2.3-70-g09d2