transient-haskell / transient

A full stack, reactive architecture for general purpose programming. Algebraic and monadically composable primitives for concurrency, parallelism, event handling, transactions, multithreading, Web, and distributed computing with complete de-inversion of control (No callbacks, no blocking, pure state)
MIT License
630 stars 28 forks source link

Cannot use an untyped expression (e.g. error and throw) as the last expression #62

Closed harendra-kumar closed 5 years ago

harendra-kumar commented 7 years ago

This program won't compile:

main = keep $ error "Raised ErrorCall exception"

But this compiles fine:

main = keep $ error "Raised ErrorCall exception" >> return ()

That's because keep has a Typeable constraint. Is there a way around this? If not we should at least document this behavior.

agocorona commented 7 years ago

the Typeable constraint is used by exit to return from the keep block. It can be called at any place of the computation and to check that the type match it needs the result to be typeable....