Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Replaces Gleam-based static site generator with functionally equivalent Haskell implementation.

Changes

  • New Haskell implementation (app/Main.hs, site-generator.cabal)

    • Parses content/index.djot config file (key-value pairs)
    • Generates HTML and CSS to dist/ directory
    • Exception handling with IOException
  • CI/CD update (.github/workflows/deploy.yml)

    • Switched from erlef/setup-beam (Gleam) to haskell-actions/setup@v2
    • Build: cabal buildcabal run site-generator
  • Test suite (test/Test.hs)

    • Verifies output file generation
  • Cleanup

    • Removed Gleam files: gleam.toml, manifest.toml, src/, old tests
    • Updated .gitignore for Haskell artifacts (dist-newstyle/, *.hi, *.o)
    • Updated README.md with Haskell prerequisites and commands

Implementation notes

Parsing handles flexible whitespace with dropWhile isSpace to match Gleam's string.trim behavior:

parseConfig :: String -> [(String, String)]
parseConfig content = 
  let processLine line = case break (== ':') line of
        (key, ':':rest) -> Just (trim key, trim rest)
        _ -> Nothing
  in foldr (\line acc -> maybe acc (:acc) (processLine line)) [] (lines content)

Generated HTML/CSS output is byte-identical to original implementation.

Original prompt

This section details on the original issue you should resolve

<issue_title>Rewrite this in Haskell</issue_title>
<issue_description>Rewrite this in Haskell</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 4 commits December 12, 2025 18:37
Co-authored-by: maxh213 <6373588+maxh213@users.noreply.github.com>
Co-authored-by: maxh213 <6373588+maxh213@users.noreply.github.com>
Co-authored-by: maxh213 <6373588+maxh213@users.noreply.github.com>
Co-authored-by: maxh213 <6373588+maxh213@users.noreply.github.com>
Copilot AI changed the title [WIP] Rewrite codebase in Haskell Rewrite static site generator from Gleam to Haskell Dec 12, 2025
Copilot AI requested a review from maxh213 December 12, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rewrite this in Haskell

2 participants