r/programminghumor • • Jan 16 '25

Semantic code

Post image
7.6k Upvotes

130 comments sorted by

View all comments

1

u/LoL_Lindq101 Jan 17 '25

Actually used in haskell like

f val | val==0    = "was zero"
      | otherwise = "non-zero"

The funny thing is that it is not a part of the syntax of the language (like if or else would be). It is literally defined as a synonym for true

otherwise = true