diff options
author | Bodigrim <andrew.lelechenko@gmail.com> | 2022-11-19 11:59:03 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-11-25 04:38:28 -0500 |
commit | 5943e739f8060bcc9867ef048a462f2c465fde00 (patch) | |
tree | d9107917e28bf3e7680662984af701dc1ae6a821 /libraries/template-haskell/Language/Haskell/TH/Syntax.hs | |
parent | d198a19ae08fec797121e3907ca93c5840db0c53 (diff) | |
download | haskell-5943e739f8060bcc9867ef048a462f2c465fde00.tar.gz |
Assorted fixes to avoid Data.List.{head,tail}
Diffstat (limited to 'libraries/template-haskell/Language/Haskell/TH/Syntax.hs')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs index 0c74758fa6..37de9717b0 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -1133,8 +1133,9 @@ addrToByteArrayName = helper where helper :: HasCallStack => Name helper = - case head (getCallStack ?callStack) of - (_, SrcLoc{..}) -> mkNameG_v srcLocPackage srcLocModule "addrToByteArray" + case getCallStack ?callStack of + [] -> error "addrToByteArrayName: empty call stack" + (_, SrcLoc{..}) : _ -> mkNameG_v srcLocPackage srcLocModule "addrToByteArray" addrToByteArray :: Int -> Addr# -> ByteArray |