diff --git a/src/fn_ptr.rs b/src/fn_ptr.rs index 6815ce0c..3b9350cb 100644 --- a/src/fn_ptr.rs +++ b/src/fn_ptr.rs @@ -13,9 +13,19 @@ use std::{ /// A general function pointer, which may carry additional (i.e. curried) argument values /// to be passed onto a function during a call. -#[derive(Debug, Clone, Hash)] +#[derive(Clone, Hash)] pub struct FnPtr(Identifier, StaticVec); +impl fmt::Debug for FnPtr { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if !self.is_curried() { + write!(f, "Fn({})", self.fn_name()) + } else { + f.debug_tuple("Fn").field(&self.0).field(&self.1).finish() + } + } +} + impl FnPtr { /// Create a new function pointer. #[inline(always)]