News for hackers. Stuff that matters.
Re:We found a division by zero bug in FFmpeg with a vibecode... by _jackdk_ on Thursday August 27, 2026 @08:51PM (#49473131)
The blog link I mentioned avoids this cost with literals, by providing using a required type argument to check the string length at compile time without TH. It requires a relatively recent GHC:

    make :: forall symbol -> (IsNonEmptySymbol symbol) => NonEmptyText

    type family IsNonEmptySymbol symbol :: Constraint where
      IsNonEmptySymbol "" = Unsatisfiable (Text "Expected a non-empty string")
      IsNonEmptySymbol _ = (()::Constraint) -- empty constraint is always satisfied

There are no comments on this comment yet.