title: Which is the use of curly braces in Haskell?
body: <p>The code below</p>
  
  <pre><code>getSpareBuffer :: Handle__ -&gt; IO (BufferMode, CharBuffer)
  getSpareBuffer Handle__{haCharBuffer=ref, 
                      haBuffers=spare_ref,
                      haBufferMode=mode}
   = do
     case mode of
       NoBuffering -&gt; return (mode, error "no buffer!")
       _ -&gt; do
            bufs &lt;- readIORef spare_ref
            buf  &lt;- readIORef ref
            case bufs of
              BufferListCons b rest -&gt; do
                  writeIORef spare_ref rest
                  return ( mode, emptyBuffer b (bufSize buf) WriteBuffer)
              BufferListNil -&gt; do
                  new_buf &lt;- newCharBuffer (bufSize buf) WriteBuffer
                  return (mode, new_buf)
  </code></pre>
  
  <p>is from the GHC source code (<a href="https://gitlab.haskell.org/ghc/ghc/-/blob/7627eab5dd882eb6f1567e3ae95c6c770830a5eb/libraries/base/GHC/IO/Handle/Text.hs#L647" rel="nofollow noreferrer">ghc-7.4.1\libraries\base\GHC\IO\Handle\Text.hs</a>). I want to know why the code uses curly braces in place of the arguments. And how the variables <code>haCharBuffer, haBuffers, haBufferMode</code> take values from <code>ref, spare_ref</code> and <code>mode</code>. These values haven't defined. </p>
  
  <p>Another fragment of code from GHC that needs clarification is this:</p>
  
  <pre><code>flushByteWriteBuffer :: Handle__ -&gt; IO ()
  flushByteWriteBuffer h_@Handle__{..} = do
    bbuf &lt;- readIORef haByteBuffer
    when (not (isEmptyBuffer bbuf)) $ do
      bbuf' &lt;- Buffered.flushWriteBuffer haDevice bbuf
      writeIORef haByteBuffer bbuf'
  </code></pre>
  
  <p>In the codefile <code>ghc-7.4.1\libraries\base\GHC\IO\Handle\Internals.hs</code>
  Which is the use of dots inside the braces (<code>{..}</code>)?</p>