Created
August 4, 2016 17:18
-
-
Save devhawk/738bd16986018a1307e7f6750c608c5e to your computer and use it in GitHub Desktop.
F# Indent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| open System | |
| // helper function to indent an indexedTextWriter and automatically un-indent | |
| // when disposed | |
| let indent (itw : System.CodeDom.Compiler.IndentedTextWriter) = | |
| let current = itw.Indent | |
| itw.Indent <- current + 1 | |
| { new IDisposable with | |
| member x.Dispose() = itw.Indent <- current } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment