wren ng thornton
wren at freegeek.org
Wed Oct 16 22:22:46 UTC 2013
On 10/16/13 5:06 PM, Wvv wrote:
> I try to write a function "liftN", but I'm not satisfied with result.
> lift :: (MonadTrans t) => Monad m => m a -> t m a
> liftN n
> | n < 1 = error "liftN: n<1"
> | n == 1 = lift
> | otherwise = lift . (liftN (n-1))
> 1) I know(?), that it is impossible to write liftN now: typechecker can't
> decide which signature it is.
You should check out the solutions for encoding polyvariadic functions, e.g.
More information about the Haskell-Cafe