From 78d36bce24cb5b2a5e183d531d0e3a227e7041c9 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 13 Apr 2020 15:20:56 +0200 Subject: [PATCH] Update hacking doc --- HACKING.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/HACKING.md b/HACKING.md index 59179e6..a6419f7 100644 --- a/HACKING.md +++ b/HACKING.md @@ -16,7 +16,23 @@ I consider haskell-TLS an interesting experiment, but not a battle-tested and pe ### Optics instead of lens -They're a little safer (less Monoid weirdness with view) and have better error messages. Consider: `view (_Just . to (++ "abc")) Nothing` (lens) vs `view (_Just % to (++ "abc")) Nothing` (optics). The latter does not compile (good). +They're a little safer (less Monoid weirdness with view) and have better error messages. Consider the following wit lens + +``` +> view (_Just . to (++ "abc")) Nothing +"" +``` + +vs optics + +``` +view (_Just % to (++ "abc")) Nothing + +:2:1: error: + • An_AffineFold cannot be used as A_Getter + • In the expression: view (_Just % to (++ "abc")) Nothing + In an equation for ‘it’: it = view (_Just % to (++ "abc")) Nothing +``` ### Strict and StrictData on by default