Jim - it's worth looking at the proposal for views, proposed by Warren Burton et al, accessible from
http://haskell.galois.com/cgi-bin/haskell-prime/trac.cgi/wiki/Views regards Simon T On Thu, 9 Feb 2006, Jim Apple wrote: > Sometimes I'd like to use a smart constructor but have pattern > matching as well. There has been talk elsewhere of allowing export of > data constructors for /matching/ but not for /construction/: > > --------module One--------- > data Picky a = Nil | One a > picky x = if some_complex_thing x then One x else Nil > --------module Two--------- > f x = g $ picky x > > g Nil y = y > g (One x) y = x > > h Nil = One True > ----------------- > > I'd like for the function g to be fine and the function h to get a > complaint like "error: no constructor 'One'" or, even better, "error: > 'One' only works in pattern matching" > > Jim > _______________________________________________ > Haskell-prime mailing list > Haskell-prime@haskell.org > http://haskell.org/mailman/listinfo/haskell-prime > _______________________________________________ Haskell-prime mailing list Haskell-prime@haskell.org http://haskell.org/mailman/listinfo/haskell-prime