#2399: Template Haskell: support for view patterns
---------------------------------+------------------------------------------
Reporter: fons | Owner:
Type: feature request | Status: new
Priority: low | Milestone: _|_
Component: Template Haskell | Version: 6.11
Severity: normal | Resolution:
Keywords: | Difficulty: Unknown
Testcase: | Os: Unknown/Multiple
Architecture: Unknown/Multiple |
---------------------------------+------------------------------------------
Changes (by porges):
* version: 6.9 => 6.11
Comment:
I came across this limitation also, while trying to write something to
emulate Erlang's BitSyntax.
Erlang allows you to write:
<<H:2,T:6>> = <<"A">>
And then H and T are both bound to 1. Similarly:
<<01000001>> == <<"A">>
is true.
I was hoping to be able to write a quasiquoter to do something like this:
highBitSet :: Word8 → Bool
highBitSet [$bits| H:1, _:7 |] = H
But this currently is not possible (AFAIK!). So, basically I'd like to put
a vote in for this.
Would this be a hard change to make?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2399#comment:11>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs