There is a Haskell function called headMay [1] that returns a Maybe, but the Prelude head function throws when given an empty list.<p>Either way, pure code can throw exceptions in Haskell.  Consider division by zero for example.<p>[1] <a href="https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;safe-0.3.9&#x2F;docs&#x2F;Safe.html" rel="nofollow">https:&#x2F;&#x2F;hackage.haskell.org&#x2F;package&#x2F;safe-0.3.9&#x2F;docs&#x2F;Safe.htm...</a>