@@ -110,6 +110,24 @@ import Streamly.Internal.System.IO (unsafeInlineIO, defaultChunkSize)
110110
111111#include "DocTestDataArray.hs"
112112
113+-------------------------------------------------------------------------------
114+-- Notes
115+-------------------------------------------------------------------------------
116+
117+-- IMPORTANT:
118+
119+-- We need to be careful while using unsafePerformIO when array creation is
120+-- involved.
121+--
122+-- * We need to make sure the unsafe IO line does not float out of the binding.
123+-- * The order of the IO actions should be sane. For example, `touch` after `f`.
124+--
125+-- Assume the unsafe IO action floats up. If it makes sense given this
126+-- assumption, it's probably OK to use usafe IO.
127+--
128+-- A general approach should be never to use unsafe IO where Array creation is
129+-- involved or touch is involved.
130+
113131-------------------------------------------------------------------------------
114132-- Array Data Type
115133-------------------------------------------------------------------------------