Re: [Haskell-cafe] ghc 7.0.3 view patterns and exhaustiveness

2011-09-21 Thread Brent Yorgey
On Tue, Sep 20, 2011 at 10:31:58PM -0400, Richard Cobbe wrote: I'm starting to play around with GHC's support for view patterns, and I'm running into what appears to be an annoying limitation of the implementation. GHC 7.0.3 (32-bit), MacOS 10.6.8. First module; defines an abstract type

Re: [Haskell-cafe] ghc 7.0.3 view patterns and exhaustiveness

2011-09-21 Thread Twan van Laarhoven
On 2011-09-21 22:06, Brent Yorgey wrote: On Tue, Sep 20, 2011 at 10:31:58PM -0400, Richard Cobbe wrote: numVarRefs :: Term - Integer numVarRefs (view - Var _) = 1 numVarRefs (view - App rator rand) = numVarRefs rator + numVarRefs rand numVarRefs (view - Lam _ body) =

[Haskell-cafe] ghc 7.0.3 view patterns and exhaustiveness

2011-09-20 Thread Richard Cobbe
I'm starting to play around with GHC's support for view patterns, and I'm running into what appears to be an annoying limitation of the implementation. GHC 7.0.3 (32-bit), MacOS 10.6.8. First module; defines an abstract type provides a (trivial) view for it. module Term(Term, TermView(..),