From 18966a2954b8209034ede8389fc6bde2779dbb2b Mon Sep 17 00:00:00 2001 From: Mark Seemann Date: Mon, 13 Jan 2025 16:51:51 +0100 Subject: [PATCH] Prepare article for publication --- ...cawr-sandwich.html => 2025-01-13-recawr-sandwich.html} | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename _posts/{2024-10-29-recawr-sandwich.html => 2025-01-13-recawr-sandwich.html} (94%) diff --git a/_posts/2024-10-29-recawr-sandwich.html b/_posts/2025-01-13-recawr-sandwich.html similarity index 94% rename from _posts/2024-10-29-recawr-sandwich.html rename to _posts/2025-01-13-recawr-sandwich.html index 285f3d01..9e7cd1bb 100644 --- a/_posts/2024-10-29-recawr-sandwich.html +++ b/_posts/2025-01-13-recawr-sandwich.html @@ -2,7 +2,7 @@ layout: post title: "Recawr Sandwich" description: "A pattern variation." -date: 2024-10-29 13:58 UTC +date: 2025-01-13 15:52 UTC tags: [Functional Programming, Design Patterns] image: "/content/binary/impureim-superset-of-recawr.png" image_alt: "A subset labeled 'Recawr Sandwiches' contained in a superset labeled 'Impureim Sandwiches'." @@ -14,7 +14,7 @@ {{ page.description }}

- After writing the articles Collecting and handling result values and Short-circuiting an asynchronous traversal, I realized that it might be valuable to describe a more disciplined variation of the Impureim Sandwich pattern. + After writing the articles Collecting and handling result values and Short-circuiting an asynchronous traversal, I realized that it might be valuable to describe a more disciplined variation of the Impureim Sandwich pattern.

The book Design Patterns describes each pattern over a number of sections. There's a description of the overall motivation, the structure of the pattern, UML diagrams, examples code, and more. One section discusses various implementation variations. I find it worthwhile, too, to explicitly draw attention to a particular variation of the more overall Impureim Sandwich pattern. @@ -55,7 +55,7 @@

Precipitating example #

- To be clear, I've been applying the Recawr Sandwich pattern for years, but it sometimes takes a counter-example before you realize that some implicit, tacit knowledge should be made explicit. This happened to me as I was discussing this implementation of Impureim Sandwich: + To be clear, I've been applying the Recawr Sandwich pattern for years, but it sometimes takes a counter-example before you realize that some implicit, tacit knowledge should be made explicit. This happened to me as I was discussing this implementation of Impureim Sandwich:

// Impure
@@ -121,7 +121,7 @@ 

  • Picture archivist in Haskell
  • Picture archivist in F#
  • The Command Handler contravariant functor
  • -
  • A restaurant sandwich
  • +
  • A restaurant sandwich
  • In other words, I'm just retroactively giving these examples a more specific label.