0

Are there any conventions used in F# to highlight functions that are pure vs having side effects?

I've seen that there is a Pure attribute in the Contracts namespace; but this looks to be a helper for CodeContracts. Do people even bother trying to highlight pure functions in F#?

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275
  • 2
    Think about how you would identify impure functions and you might see how this gets complicated. i.e. functions relying on other functions or referenced functions done in other languages. – Guy Coder Oct 29 '13 at 13:39
  • I've never seen any such convention and as Guy Coder points out it would be rather impractical for several reasons. – Onorio Catenacci Oct 29 '13 at 14:06
  • This is interesting https://twitter.com/sforkmann/status/395710341415706624 – Danny Tuppeny Oct 31 '13 at 06:35
  • @GuyCoder Just because it's complicated doesn't mean there isn't value in it. – Danny Tuppeny Nov 02 '13 at 12:47
  • I didn't say there wasn't value in it. I too would like to know them but didn't pursue to a proof of concept do to the complications. If you do find an answer or create the code I would be interested. – Guy Coder Nov 06 '13 at 23:38

0 Answers0