[Haskell-beginners] Unwrap an expression?

Christopher Howard christopher.howard at frigidcode.com
Sat Sep 3 00:23:40 CEST 2011


Perhaps this is a dumb question, but I was pondering the whole "Lazy" 
aspect of Haskell, and was curious: is there someway you could create a 
function "M", which you could pass an expression into, so that...

M (f (g... (n (x)) ...)) returns f

and/or returns the inner value (g... (n (x)) ...)

I don't know if that breaks the whole "referential transparency" idea or 
not, but with all those lambda calculus tricks I've heard about, and the 
lazy evaluation, I thought it would be worth asking.

-- 
frigidcode.com
theologia.indicium.us



More information about the Beginners mailing list