docs: format section comments nicely

This commit is contained in:
wi11-holdsworth 2025-10-01 14:22:55 +10:00
parent 3a11e7132f
commit df8bd3290f

View file

@ -52,7 +52,7 @@ import Data.List
import Data.Set qualified as S import Data.Set qualified as S
import Debug.Trace import Debug.Trace
-- datatypes -- -- ==== DATA STRUCTURES =======================================================
type GameState = [[Pitch]] type GameState = [[Pitch]]
@ -75,10 +75,7 @@ instance Show Octave where
instance Show Pitch where instance Show Pitch where
show (Pitch note octave) = show note ++ show octave show (Pitch note octave) = show note ++ show octave
-- ==== REQUIRED FUNCTIONS ====================================================
--
-- required functions --
toPitch :: String -> Maybe Pitch toPitch :: String -> Maybe Pitch
toPitch [note, octave] = Pitch <$> charToNote note <*> charToOctave octave toPitch [note, octave] = Pitch <$> charToNote note <*> charToOctave octave
@ -136,9 +133,8 @@ initialGuess = (chord, chords)
nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState) nextGuess :: ([Pitch], GameState) -> (Int, Int, Int) -> ([Pitch], GameState)
nextGuess (prevGuess, chord : chords) _ = (chord, chords) nextGuess (prevGuess, chord : chords) _ = (chord, chords)
-- -- ==== HELPER FUNCTIONS ======================================================
-- helper functions --
allChords :: [[Pitch]] allChords :: [[Pitch]]
allChords = allChords =
@ -170,5 +166,3 @@ matches xs ys = maximum permutationMatches
where where
permutationMatches = map (pairwiseMatches xs) (permutations ys) permutationMatches = map (pairwiseMatches xs) (permutations ys)
pairwiseMatches xs ys = length $ filter (uncurry (==)) $ zip xs ys pairwiseMatches xs ys = length $ filter (uncurry (==)) $ zip xs ys
--