Skip to content

Instantly share code, notes, and snippets.

View mhuisi's full-sized avatar
馃尨
Away until 2025-01-12

Marc Huisinga mhuisi

馃尨
Away until 2025-01-12
  • Lean FRO
  • Munich, Germany
View GitHub Profile
def normalize (s : String) : String := Id.run do
let s := s.dropWhile (路.isWhitespace) |>.dropRightWhile (路.isWhitespace)
let lines := s.splitOn "\n"
|>.map (fun s => s.dropWhile (路.isWhitespace) |>.dropRightWhile (路.isWhitespace))
let mut r := ""
for i in [0:lines.length-1] do
let line := lines[i]!
if line.endsWith "." || line.endsWith ":" then
r := r ++ line ++ "\\n"
else if line == "" then