Skip to content

Commit 38ac1fe

Browse files
committed
Builtins: Prim: rm newtype accessor
1 parent 80c763e commit 38ac1fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/Nix/Builtins.hs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ import Text.Regex.TDFA ( Regex
9494

9595
-- ** Nix Builtins Haskell type level
9696

97-
newtype Prim m a = Prim { runPrim :: m a }
97+
newtype Prim m a = Prim (m a)
9898

9999
data BuiltinType = Normal | TopLevel
100100
data Builtin v =
@@ -114,7 +114,7 @@ instance
114114
, ToValue a m (NValue t f m)
115115
)
116116
=> ToBuiltin t f m (Prim m a) where
117-
toBuiltin _ p = toValue =<< runPrim p
117+
toBuiltin _ p = toValue @a @m =<< coerce p
118118

119119
instance
120120
( MonadNix e t f m
@@ -1407,12 +1407,12 @@ hashStringNix nsAlgo ns =
14071407
mkHash s = hash $ encodeUtf8 s
14081408

14091409

1410-
placeHolderNix :: MonadNix e t f m => NValue t f m -> m (NValue t f m)
1410+
placeHolderNix :: forall t f m e . MonadNix e t f m => NValue t f m -> m (NValue t f m)
14111411
placeHolderNix p =
14121412
do
14131413
t <- fromStringNoContext =<< fromValue p
14141414
h <-
1415-
runPrim $
1415+
coerce @(Prim m NixString) @(m NixString) $
14161416
(hashStringNix `on` makeNixStringWithoutContext)
14171417
"sha256"
14181418
("nix-output:" <> t)

0 commit comments

Comments
 (0)