From e4f9d020c2ae566817e6b453d771a3a0521ccf51 Mon Sep 17 00:00:00 2001 From: Karl Ostmo Date: Sun, 14 Jul 2024 13:56:16 -0700 Subject: [PATCH] add docstrings --- .../Game/Scenario/Topography/Structure/Recognition/Type.hs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Type.hs b/src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Type.hs index 8f9f5bb56..58bb25500 100644 --- a/src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Type.hs +++ b/src/swarm-topography/Swarm/Game/Scenario/Topography/Structure/Recognition/Type.hs @@ -39,6 +39,9 @@ import Swarm.Game.Universe (Cosmic, offsetBy) import Swarm.Language.Syntax.Direction (AbsoluteDir) import Text.AhoCorasick (StateMachine) +-- | A 'NamedStructure' has its own newtype name ('StructureName'), but we +-- standardize on 'Text' here to avoid parameterizing our 'NamedOriginal' +-- datatype on bespoke name types. type OriginalName = Text -- | A "needle" consisting of a single cell within @@ -129,6 +132,10 @@ data StructureRow b a = StructureRow , rowContent :: SymbolSequence a } +-- | This wrapper facilitates naming the original structure +-- (i.e. the "payload" for recognition) +-- for the purpose of both UI display and internal uniqueness, +-- while remaining agnostic to its internals. data NamedOriginal a = NamedOriginal { getName :: OriginalName , orig :: a