title: What is the syntax used in this function definition of Cardano?
body: <p>How to interpret <a href="https://github.com/input-output-hk/cardano-node/blob/9d59676141f9a0210a964191cb5f64f0d68d4d0c/cardano-cli/src/Cardano/CLI/Run/Friendly.hs#L112" rel="nofollow noreferrer">this function</a>:</p>
  <pre><code>friendlyValidityRange
    :: CardanoEra era
    -&gt; (TxValidityLowerBound era, TxValidityUpperBound era)
    -&gt; Aeson.Value
  friendlyValidityRange era = \case
    ShelleyTtl ttl -&gt; object [&quot;time to live&quot; .= ttl]
    (lowerBound, upperBound)
      | isLowerBoundSupported || isUpperBoundSupported -&gt;
          object
            [ ...
            ]
      | otherwise -&gt; Null
   where
    isLowerBoundSupported = isJust $ validityLowerBoundSupportedInEra era
    isUpperBoundSupported = isJust $ validityUpperBoundSupportedInEra era
  </code></pre>
  <p>I thought the <code>friendlyValidityRange</code> function utilize the <em>partial function</em> concept, but still failed to understand it.
  How can <code>friendlyValidityRange</code>'s <code>era</code> and <code>(lowerBound, upperBound)</code> parameters be passed in such separated way?</p>
  <p>I try to mimic it use follow demo, still unable to finished it.</p>
  <pre><code>
  module Main where
  
  data Age = Child | Adult
  
  -- Function that accept two agrs: Age, (weightMin, weightMax) , and return health description string
  weightAnalyse :: Age -&gt; (Int, Int) -&gt; String
  weightAnalyse age = \case
      Child    -&gt;  ?  -- how to comsume the (min, max) tuple
      Adult    -&gt;  ? 
      
  main :: IO ()
  main = do
    weightAnalyse Child (30, 60)
    weightAnalyse Adult (60, 130)
  </code></pre>