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
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) =
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(..),