You might not encounter it, as ImplicitParams isn't common, but it has a nice answer. Note that `HasCallStack` is implemented as an implicit parameter: (?callstack :: CallStack).
{-# LANGUAGE TypeOperators, LambdaCase, RankNTypes #-}
import GHC.Stack
type a ?-> b = HasCallStack => a -> b
foo :: a ?-> a
foo x = x
map' :: (a ?-> b) -> [a] ?-> [b]
map' f = \case
[] -> []
(x:xs) -> f x : map f xs
ohno :: Int ?-> String
ohno 5 = error "Five is my least favorite number."
ohno x = show x
main = print $ map' ohno [1..10]
*Main> main
["1","2","3","4","*** Exception: Five is my least favorite number.
CallStack (from HasCallStack):
error, called at /home/matt/impl.hs:16:10 in main:Main
ohno, called at /home/matt/impl.hs:19:21 in main:Main
f, called at /home/matt/impl.hs:13:23 in main:Main
map', called at /home/matt/impl.hs:19:16 in main:Main