recover-rtti-0.1.0.0: Recover run-time type information from the GHC heap
Safe HaskellNone
LanguageHaskell2010

Debug.RecoverRTTI.Util

Synopsis

Existentials

data Some (f :: k -> Type) where Source #

Constructors

Some :: forall f a. f a -> Some f 

Instances

Instances details
Show (Some Classified) Source # 
Instance details

Defined in Debug.RecoverRTTI.Classify

elimKnownSymbol :: String -> (forall n. KnownSymbol n => Proxy n -> r) -> r Source #

Constraints

keepRedundantConstraint :: c => proxy c -> () Source #

Can be used to silence individual "redundant constraint" warnings

foo :: ConstraintUsefulForDebugging => ...
foo =
    ..
  where
    _ = keepRedundantConstraint (Proxy @ConstraintUsefulForDebugging))

Traversable

checkEmptyTraversable :: Traversable t => t a -> Either a (t Void) Source #

Check if a traversable data structure is empty

Returns evidence: an element of the data-structure if it's non-empty, or evidence that it is empty otherwise.

Lists

dropEnds :: forall a. [a] -> Maybe (a, [a], a) Source #

Drop the ends of a list

dropEnds "abcde" == Just ('a',"bcd",'e')

SOP

data VerifiedSize (n :: Nat) (a :: Type) where Source #

Constructors

VerifiedSize :: forall n a (xs :: [Type]). (SListI xs, Length xs ~ n) => NP (K a) xs -> VerifiedSize n a 

verifySize :: Sing n -> [a] -> Maybe (VerifiedSize n a) Source #