From 06d5dbb2d72b5b74bcc776c446a21a590d93b697 Mon Sep 17 00:00:00 2001 From: "Niels G. W. Serup" Date: Sat, 9 Nov 2024 23:13:37 +0100 Subject: [PATCH] Add a little documentation --- byg/src/Byg/DependencyGenerator.hs | 3 +++ byg/src/Byg/DependencyRunner.hs | 7 +++++++ byg/src/Byg/Functions.hs | 1 + byg/src/Byg/Types.hs | 5 +++-- byg/src/Byg/Types/Date.hs | 1 + byg/src/Byg/Types/Dependency.hs | 2 ++ byg/src/Byg/Types/Functions.hs | 2 ++ byg/src/Byg/Types/Token.hs | 2 ++ byg/src/Byg/Types/Value.hs | 2 ++ 9 files changed, 23 insertions(+), 2 deletions(-) diff --git a/byg/src/Byg/DependencyGenerator.hs b/byg/src/Byg/DependencyGenerator.hs index 2fd7fe6..2f75b27 100644 --- a/byg/src/Byg/DependencyGenerator.hs +++ b/byg/src/Byg/DependencyGenerator.hs @@ -1,5 +1,8 @@ {-# LANGUAGE GADTs #-} {-# LANGUAGE FunctionalDependencies #-} + +-- | Combinators for generating a list of dependencies between calculations, to +-- be executed later in DependencyRunner. module Byg.DependencyGenerator ( DepGenM , DepGenM' diff --git a/byg/src/Byg/DependencyRunner.hs b/byg/src/Byg/DependencyRunner.hs index b74ecdf..3a8bd05 100644 --- a/byg/src/Byg/DependencyRunner.hs +++ b/byg/src/Byg/DependencyRunner.hs @@ -1,4 +1,11 @@ {-# LANGUAGE MonoLocalBinds #-} + +-- | Run the actual operations from the generated dependencies from DependencyGenerator. +-- +-- This does not work fully as intended right now (computes more than strictly +-- needed) and needs to be rewritten in a more testable way. The idea is to only +-- evaluate something if a future operation depends on it, which is reflected in +-- the ValueExistence type. module Byg.DependencyRunner ( DepRunM , runDeps diff --git a/byg/src/Byg/Functions.hs b/byg/src/Byg/Functions.hs index 6d499e5..4150c5e 100644 --- a/byg/src/Byg/Functions.hs +++ b/byg/src/Byg/Functions.hs @@ -1,3 +1,4 @@ +-- | All byg functions. module Byg.Functions ( module Byg.Functions.Image , module Byg.Functions.Pandoc diff --git a/byg/src/Byg/Types.hs b/byg/src/Byg/Types.hs index dff6ae5..91b027b 100644 --- a/byg/src/Byg/Types.hs +++ b/byg/src/Byg/Types.hs @@ -1,13 +1,14 @@ +-- | All byg types. module Byg.Types ( module Byg.Types.Token , module Byg.Types.Value , module Byg.Types.Functions , module Byg.Types.Date - , Dependency + , module Byg.Types.Dependency ) where import Byg.Types.Token import Byg.Types.Value import Byg.Types.Functions import Byg.Types.Date -import Byg.Types.Dependency (Dependency) +import Byg.Types.Dependency diff --git a/byg/src/Byg/Types/Date.hs b/byg/src/Byg/Types/Date.hs index 8a06911..4edf1f3 100644 --- a/byg/src/Byg/Types/Date.hs +++ b/byg/src/Byg/Types/Date.hs @@ -1,3 +1,4 @@ +-- | Date functions. module Byg.Types.Date ( Date(..) , formatDate diff --git a/byg/src/Byg/Types/Dependency.hs b/byg/src/Byg/Types/Dependency.hs index bafe0cb..ea9815c 100644 --- a/byg/src/Byg/Types/Dependency.hs +++ b/byg/src/Byg/Types/Dependency.hs @@ -1,4 +1,6 @@ {-# LANGUAGE GADTs #-} + +-- | Keeps track of the graph of calculation dependencies. module Byg.Types.Dependency ( Action(..) , F(..) diff --git a/byg/src/Byg/Types/Functions.hs b/byg/src/Byg/Types/Functions.hs index bf2436d..c2e2924 100644 --- a/byg/src/Byg/Types/Functions.hs +++ b/byg/src/Byg/Types/Functions.hs @@ -1,4 +1,6 @@ {-# LANGUAGE FunctionalDependencies #-} + +-- | Calculation function types. module Byg.Types.Functions ( IsFunctionIO(..) ) where diff --git a/byg/src/Byg/Types/Token.hs b/byg/src/Byg/Types/Token.hs index 9ed28a2..fe1de91 100644 --- a/byg/src/Byg/Types/Token.hs +++ b/byg/src/Byg/Types/Token.hs @@ -1,4 +1,6 @@ {-# LANGUAGE GADTs #-} + +-- | Tokens represent future values. module Byg.Types.Token ( Token(..) ) where diff --git a/byg/src/Byg/Types/Value.hs b/byg/src/Byg/Types/Value.hs index f0d2af0..9828b2d 100644 --- a/byg/src/Byg/Types/Value.hs +++ b/byg/src/Byg/Types/Value.hs @@ -1,4 +1,6 @@ {-# LANGUAGE MonoLocalBinds #-} + +-- | Small wrapper over the Dynamic type. module Byg.Types.Value ( Value(..) , toValue