Tuple predicates in Template Haskell

Yorick Laupa yo.eight at gmail.com
Fri Jan 3 23:13:40 UTC 2014


Hi,

I try to make my way through #7021 [1]. Unfortunately, there is nothing in
the ticket about what should be expected from the code given as example.

I came with an implementation and I would like feedback from you guys. So,
considering this snippet:

--

{-# LANGUAGE ConstraintKinds #-}

type IOable a = (Show a, Read a)

foo :: IOable a => a
foo = undefined

-- 

This is what I got now when pretty-printing TH.Info after reify "foo" call:

VarI Tuple.foo (ForallT [PlainTV a_1627398594] [TupleP 2 [AppT (ConT
GHC.Show.Show) (VarT a_1627398594),AppT (ConT GHC.Read.Read) (VarT
a_1627398594)]] (VarT a_1627398594)) Nothing (Fixity 9 InfixL)

Does that sound right to you ?

Thanks for your time

-- Yorick

[1] https://ghc.haskell.org/trac/ghc/ticket/7021
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20140104/5405d544/attachment.html>


More information about the ghc-devs mailing list