
13 Apr
2011
13 Apr
'11
6:29 p.m.
On Thursday 14 April 2011 00:14:19, blackcat@pro-ns.net wrote:
I've got some values in GHCi that look like
Just (Left (Blah [stuff]))
and I'd like to pull out the (Blah [stuff]) to operate on it. Is there a way to do this directly in GHCi without writing a helper function?
I'm not quite sure what you want, you can bind the Blah [stuff] to a name using a pattern-match, perhaps that's what you want. After the fact: ghci> let Just (Left blah) = it ghci> doSomethingWith blah or ghci> case it of Just (Left blah) -> doSomethingWith blah Before: replace 'it' with the expression generating Just (Left (Blah [stuff])).