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