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