Skip to content

Instantly share code, notes, and snippets.

@dustinlacewell
Created September 7, 2021 05:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dustinlacewell/97858ec608a9f6903d92593abd69bba5 to your computer and use it in GitHub Desktop.
Save dustinlacewell/97858ec608a9f6903d92593abd69bba5 to your computer and use it in GitHub Desktop.
baseOrdinal :: Int
baseOrdinal = ord 'a'
reduceOrdinal :: Char -> Int
reduceOrdinal char = ord char - baseOrdinal
adjustOrdinal amount = (+ amount) . reduceOrdinal
moduloOrdinal amount = (`mod` 26) . adjustOrdinal amount
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment