From d7d7abe6a29b65a285e2326555a827e7cad14fd7 Mon Sep 17 00:00:00 2001 From: Gabriella Gonzalez Date: Sat, 5 Oct 2024 17:15:47 -0700 Subject: [PATCH] `dhall to-directory-tree`: Fix support for empty `Map`s Fixes https://github.com/dhall-lang/dhall-haskell/issues/2598 --- dhall/src/Dhall/DirectoryTree.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dhall/src/Dhall/DirectoryTree.hs b/dhall/src/Dhall/DirectoryTree.hs index fec32bea4..05da91909 100644 --- a/dhall/src/Dhall/DirectoryTree.hs +++ b/dhall/src/Dhall/DirectoryTree.hs @@ -179,8 +179,8 @@ toDirectoryTree allowSeparators path expression = case expression of RecordLit keyValues -> Map.unorderedTraverseWithKey_ process $ recordFieldValue <$> keyValues - ListLit (Just (Record [ ("mapKey", recordFieldValue -> Text), ("mapValue", _) ])) [] -> - return () + ListLit (Just (App List (Record [ ("mapKey", recordFieldValue -> Text), ("mapValue", _) ]))) [] -> + Directory.createDirectoryIfMissing allowSeparators path ListLit _ records | not (null records)