Open
Description
The proposal indicates that any pattern match on a value of type Int#
, Char#
, etc. should be considered linear consumption. Presumably, this would include wildcard matches with an underscore as well. So, this should typecheck:
foo :: Int ->. Bool
foo (I# _) = True
This doesn't currently work, and it causes me to reach for unsafeCoerce more than I otherwise would. It would be nice if the wrappers over also had the same (or similar behavior). This would let me simplify the above example to:
foo :: Int ->. Bool
foo !_ = True
I think the bang pattern is important here. Without it, we don't force the primitive Int#
value.
Metadata
Metadata
Assignees
Labels
No labels