File tree Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Expand file tree Collapse file tree 2 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -730,7 +730,7 @@ substringNix start len str =
730730attrNamesNix
731731 :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m )
732732attrNamesNix =
733- (fmap getDeeper . toValue . fmap makeNixStringWithoutContext . sort . M. keys)
733+ (fmap (coerce :: CoerceDeeperToNValue t f m ) . toValue . fmap makeNixStringWithoutContext . sort . M. keys)
734734 <=< fromValue @ (AttrSet (NValue t f m ))
735735
736736attrValuesNix
@@ -1441,7 +1441,7 @@ readDirNix nvpath =
14411441 detectFileTypes
14421442 items
14431443
1444- getDeeper <$> toValue (M. fromList itemsWithTypes)
1444+ (coerce :: CoerceDeeperToNValue t f m ) <$> toValue (M. fromList itemsWithTypes)
14451445
14461446fromJSONNix
14471447 :: forall e t f m . MonadNix e t f m => NValue t f m -> m (NValue t f m )
Original file line number Diff line number Diff line change @@ -27,12 +27,15 @@ import Nix.Frames
2727import Nix.String
2828import Nix.Value
2929import Nix.Value.Monad
30- import Nix.Thunk
30+ import Nix.Thunk ( MonadThunk ( force ) )
3131import Nix.Utils
3232
33- newtype Deeper a = Deeper { getDeeper :: a }
33+ newtype Deeper a = Deeper a
3434 deriving (Typeable , Functor , Foldable , Traversable )
3535
36+ type CoerceDeeperToNValue t f m = Deeper (NValue t f m ) -> NValue t f m
37+ type CoerceDeeperToNValue' t f m = Deeper (NValue' t f m (NValue t f m )) -> NValue' t f m (NValue t f m )
38+
3639{-
3740
3841IMPORTANT NOTE
@@ -83,7 +86,7 @@ fromMayToDeeperValue t v =
8386 do
8487 v' <- fromValueMay v
8588 maybe
86- (throwError $ Expectation @ t @ f @ m t $ Free $ getDeeper v)
89+ (throwError $ Expectation @ t @ f @ m t $ Free $ (coerce :: CoerceDeeperToNValue' t f m ) v)
8790 pure
8891 v'
8992
@@ -313,8 +316,8 @@ instance ( Convertible e t f m
313316 , FromValue a m (NValue' t f m (NValue t f m ))
314317 )
315318 => FromValue a m (Deeper (NValue' t f m (NValue t f m ))) where
316- fromValueMay = fromValueMay . getDeeper
317- fromValue = fromValue . getDeeper
319+ fromValueMay = fromValueMay . (coerce :: CoerceDeeperToNValue' t f m )
320+ fromValue = fromValue . (coerce :: CoerceDeeperToNValue' t f m )
318321
319322
320323-- * ToValue
You can’t perform that action at this time.
0 commit comments