Movatterモバイル変換


[0]ホーム

URL:


{-# LANGUAGE Trustworthy #-}------------------------------------------------------------------------------- |-- Module      :  GHC.Stack-- Copyright   :  (c) The University of Glasgow 2011-- License     :  see libraries/base/LICENSE---- Maintainer  :  cvs-ghc@haskell.org-- Stability   :  internal-- Portability :  non-portable (GHC Extensions)---- Access to GHC's call-stack simulation---- @since 4.5.0.0-----------------------------------------------------------------------------{-# LANGUAGE MagicHash, NoImplicitPrelude, ImplicitParams, RankNTypes #-}moduleGHC.Stack(errorWithStackTrace,-- * Profiling call stackscurrentCallStack,whoCreated,-- * HasCallStack call stacksCallStack,HasCallStack,callStack,emptyCallStack,freezeCallStack,fromCallSiteList,getCallStack,popCallStack,prettyCallStack,pushCallStack,withFrozenCallStack,-- * Source locationsSrcLoc(..),prettySrcLoc,-- * InternalsCostCentreStack,CostCentre,getCurrentCCS,getCCSOf,clearCCS,ccsCC,ccsParent,ccLabel,ccModule,ccSrcSpan,ccsToStrings,renderStack)whereimportGHC.Stack.CCSimportGHC.Stack.TypesimportGHC.IOimportGHC.BaseimportGHC.ListimportGHC.Exception-- | Like the function 'error', but appends a stack trace to the error-- message if one is available.---- @since 4.7.0.0{-# DEPRECATEDerrorWithStackTrace"'error' appends the call stack now"#-}-- DEPRECATED in 8.0.1errorWithStackTrace::String->aerrorWithStackTracex=unsafeDupablePerformIO$dostack<-ccsToStrings=<<getCurrentCCSxifnullstackthenthrowIO(ErrorCallx)elsethrowIO(ErrorCallWithLocationx(renderStackstack))-- | Pop the most recent call-site off the 'CallStack'.---- This function, like 'pushCallStack', has no effect on a frozen 'CallStack'.---- @since 4.9.0.0popCallStack::CallStack->CallStackpopCallStackstk=casestkofEmptyCallStack->errorWithoutStackTrace"popCallStack: empty stack"PushCallStack__stk'->stk'FreezeCallStack_->stk{-# INLINEpopCallStack#-}-- | Return the current 'CallStack'.---- Does *not* include the call-site of 'callStack'.---- @since 4.9.0.0callStack::HasCallStack=>CallStackcallStack=case?callStackofEmptyCallStack->EmptyCallStack_->popCallStack?callStack{-# INLINEcallStack#-}-- | Perform some computation without adding new entries to the 'CallStack'.---- @since 4.9.0.0withFrozenCallStack::HasCallStack=>(HasCallStack=>a)->awithFrozenCallStackdo_this=-- we pop the stack before freezing it to remove-- withFrozenCallStack's call-sitelet?callStack=freezeCallStack(popCallStackcallStack)indo_this

[8]ページ先頭

©2009-2025 Movatter.jp