Skip to content

bring explicit IO (Haskell-like) checks to C# for the sake of purity 🦋

License

Notifications You must be signed in to change notification settings

amankkg/io-tag-parody

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

io-tag-parody

bring explicit IO tag checks to C# for the sake of purity 🦋

TL;DR usages of types/members decorated with System.ObsoleteAttribute in non-obsolete code cause 🔥compile-time🔥 warnings (or errors, if configured so)

Example:

using WithIO = System.ObsoleteAttribute; // fancy alias

void Foo()
{
  // ... any non-IO code
  Bar(); // error, `Bar` cannot be used here since `Foo` is not decorated with [WithIO]
}

[WithIO] // explicitly state that this function is impure
void Bar()
{
  // ... any IO code, interaction with filesystem || database || network etc.
}

Solution contains demo application, which is (intentionally) in compile error state.

Inspired by https://www.haskell.org/tutorial/io.html

About

bring explicit IO (Haskell-like) checks to C# for the sake of purity 🦋

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages