
13 Apr
2009
13 Apr
'09
1:18 a.m.
ah, Int vs Integer, i didn't see that at all. Thats kind of weird, i thought 1 could be either one. This works
funResultTy (typeOf FooC) (typeOf (1::Int)) Just ParseG.Foo
but
funResultTy (typeOf FooC) (typeOf $ fromIntegral 1) Nothing
doesn't so, how do i actually do something with this? is there a way that i can pull out the computation? Like there is a -> TypeRep, is there a TypeRep -> a function? cast doesn't seem to do what i want
let a::Foo = fromJust $ cast $ fromJust $ funResultTy (typeOf FooC) (typeOf (1::Int)) a *** Exception: Maybe.fromJust: Nothing