
How would we implement
{{{ hlength :: HList l -> Int hlength Nil = 0 hlength (Cons _ xs) = 1 + hlength xs }}}
then? (Bear in mind that we have no access to the type parameter `l` at runtime.)
I think this sort of thing could only work with a type family rather
#10048: {-# UNPACK #-} support for size-indexed types -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: Type: feature request | Status: closed Priority: normal | Milestone: Component: Compiler | Version: 7.11 Resolution: invalid | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: None/Unknown | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by dfeuer): * status: new => closed * resolution: => invalid Comment: Replying to [comment:1 rwbarton]: than a GADT (and even then I haven't thought about whether it actually could work). Ah, you make a very good point. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10048#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler