Skip to content

Instantly share code, notes, and snippets.

@ggVGc
Created August 1, 2022 13:14
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 ggVGc/e127758549621bbe189211c9500eafde to your computer and use it in GitHub Desktop.
Save ggVGc/e127758549621bbe189211c9500eafde to your computer and use it in GitHub Desktop.
debug :: c -> String -> c
debug = flip trace
tracef :: (String, a -> String) -> a -> a
tracef (msg, f) v = trace (msg ++ ":\n" ++ f v) v
debugf :: Show r => a -> (String, a -> r) -> a
debugf v (msg, f) = trace (msg ++ " " ++ show (f v)) v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment