[Haskell-cafe] TH clause Pat selection
Ozgur Akgun
ozgurakgun at gmail.com
Thu Jun 20 22:47:49 CEST 2013
Hi.
On 19 June 2013 23:23, Brian Lewis <brian at lorf.org> wrote:
> The problem is, I don't know how to generate the function's clauses.
> "foo 0 = ..." seems to be a LitP pattern. But "foo True = ..." seems to
> be a ConP pattern. The appropriate pattern depends on type c.
>
I've used haskell-src-meta for this purpose before. See:
http://hackage.haskell.org/packages/archive/haskell-src-meta/0.6.0.2/doc/html/Language-Haskell-Meta-Parse.html#v:parsePat
Hope this helps,
Ozgur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130620/0e5b328f/attachment.htm>
More information about the Haskell-Cafe
mailing list