frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

New York Budget Bill Mandates File Scans for 3D Printers

https://reclaimthenet.org/new-york-3d-printer-law-mandates-firearm-file-blocking
1•bilsbie•20s ago•0 comments

The End of Software as a Business?

https://www.thatwastheweek.com/p/ai-is-growing-up-its-ceos-arent
1•kteare•1m ago•0 comments

Exploring 1,400 reusable skills for AI coding tools

https://ai-devkit.com/skills/
1•hoangnnguyen•2m ago•0 comments

Show HN: A unique twist on Tetris and block puzzle

https://playdropstack.com/
1•lastodyssey•5m ago•0 comments

The logs I never read

https://pydantic.dev/articles/the-logs-i-never-read
1•nojito•6m ago•0 comments

How to use AI with expressive writing without generating AI slop

https://idratherbewriting.com/blog/bakhtin-collapse-ai-expressive-writing
1•cnunciato•7m ago•0 comments

Show HN: LinkScope – Real-Time UART Analyzer Using ESP32-S3 and PC GUI

https://github.com/choihimchan/linkscope-bpu-uart-analyzer
1•octablock•8m ago•0 comments

Cppsp v1.4.5–custom pattern-driven, nested, namespace-scoped templates

https://github.com/user19870/cppsp
1•user19870•9m ago•1 comments

The next frontier in weight-loss drugs: one-time gene therapy

https://www.washingtonpost.com/health/2026/01/24/fractyl-glp1-gene-therapy/
1•bookofjoe•12m ago•1 comments

At Age 25, Wikipedia Refuses to Evolve

https://spectrum.ieee.org/wikipedia-at-25
1•asdefghyk•14m ago•3 comments

Show HN: ReviewReact – AI review responses inside Google Maps ($19/mo)

https://reviewreact.com
2•sara_builds•15m ago•1 comments

Why AlphaTensor Failed at 3x3 Matrix Multiplication: The Anchor Barrier

https://zenodo.org/records/18514533
1•DarenWatson•16m ago•0 comments

Ask HN: How much of your token use is fixing the bugs Claude Code causes?

1•laurex•19m ago•0 comments

Show HN: Agents – Sync MCP Configs Across Claude, Cursor, Codex Automatically

https://github.com/amtiYo/agents
1•amtiyo•20m ago•0 comments

Hello

1•otrebladih•22m ago•1 comments

FSD helped save my father's life during a heart attack

https://twitter.com/JJackBrandt/status/2019852423980875794
2•blacktulip•24m ago•0 comments

Show HN: Writtte – Draft and publish articles without reformatting, anywhere

https://writtte.xyz
1•lasgawe•26m ago•0 comments

Portuguese icon (FROM A CAN) makes a simple meal (Canned Fish Files) [video]

https://www.youtube.com/watch?v=e9FUdOfp8ME
1•zeristor•28m ago•0 comments

Brookhaven Lab's RHIC Concludes 25-Year Run with Final Collisions

https://www.hpcwire.com/off-the-wire/brookhaven-labs-rhic-concludes-25-year-run-with-final-collis...
2•gnufx•30m ago•0 comments

Transcribe your aunts post cards with Gemini 3 Pro

https://leserli.ch/ocr/
1•nielstron•34m ago•0 comments

.72% Variance Lance

1•mav5431•35m ago•0 comments

ReKindle – web-based operating system designed specifically for E-ink devices

https://rekindle.ink
1•JSLegendDev•37m ago•0 comments

Encrypt It

https://encryptitalready.org/
1•u1hcw9nx•37m ago•1 comments

NextMatch – 5-minute video speed dating to reduce ghosting

https://nextmatchdating.netlify.app/
1•Halinani8•38m ago•1 comments

Personalizing esketamine treatment in TRD and TRBD

https://www.frontiersin.org/articles/10.3389/fpsyt.2025.1736114
1•PaulHoule•39m ago•0 comments

SpaceKit.xyz – a browser‑native VM for decentralized compute

https://spacekit.xyz
1•astorrivera•40m ago•0 comments

NotebookLM: The AI that only learns from you

https://byandrev.dev/en/blog/what-is-notebooklm
2•byandrev•40m ago•2 comments

Show HN: An open-source starter kit for developing with Postgres and ClickHouse

https://github.com/ClickHouse/postgres-clickhouse-stack
1•saisrirampur•41m ago•0 comments

Game Boy Advance d-pad capacitor measurements

https://gekkio.fi/blog/2026/game-boy-advance-d-pad-capacitor-measurements/
1•todsacerdoti•41m ago•0 comments

South Korean crypto firm accidentally sends $44B in bitcoins to users

https://www.reuters.com/world/asia-pacific/crypto-firm-accidentally-sends-44-billion-bitcoins-use...
2•layer8•42m ago•0 comments
Open in hackernews

FizzBuzz Through Monoids

https://entropicthoughts.com/fizzbuzz-through-monoids
16•kqr•8mo ago

Comments

lgas•8mo ago
I wrote a similar implementation a while back[1]. The major difference is that mine only allows rules of the form "n is divisible by m" whereas the one from the post allows arbitrary predicates over n. Wouldn't be that hard to update though.

[1] https://gist.github.com/lgastako/d4fa392cbe85cbfae7dfa5e18c1...

throwaway81523•8mo ago
Code is a little too fancy though it's easy to fall into that temptation with Haskell. Particularly though, using the Monoid instance on strings ties you to concatenating the strings together. There was an example the other day where the strings had to be separated by spaces and terminated by an exclam point ("Fizz Buzz!"). My solution used lists straightforwardly instead of Monoids. It goes to 110 instead of 100 since 105 is 3*5*7.

    import           Data.List (intercalate)

    fizzle :: Int -> String
    fizzle n =
        let ws = [(3,"Fizz"),(5,"Buzz"),(7,"Bazz")]
            a = [s | (d,s) <- ws, n`rem`d == 0]
        in case a of []        -> show n
                     otherwise -> intercalate " " a ++ "!"

    main = mapM_ (putStrLn . fizzle) [1..110]
kqr•8mo ago
Another way to do it would be

    newtype Words = Words { getWords :: String }

    instance Semigroup Words where
      Words a <> Words b = Words (a <> " " <> b)

    instance Monoid Words where
      mempty = Words mempty

    fizzbuzz i =
      maybe (show i) (<> "!") . fmap getWords . mconcat $
        [ Words "fizz" <$ guard (rem i 3 == 0)
        , Words "buzz" <$ guard (rem i 5 == 0)
        ]
but at this point I agree lists might be more clear.
theamk•8mo ago
it always amazes me how Haskell uses the very complex approaches for a very simple problem. Do you want a design that generalizes to zork? Here it is:

    def fizzbuzz(i):
        return "".join((["fizz"] if (i % 3) == 0 else []) + 
                       (["buzz"] if (i % 5) == 0 else [])
                      ) or str(i)
 
    for i in range(1, 101):
        print(fizzbuzz(i))
here is "indication of good modularity" with no monoid in sight, and we did not have to import 3 extra libraries either.