Proposal: ValidateMonoLiterals - Initial bikeshed discussion

Merijn Verstraaten merijn at inconsistent.nl
Tue Feb 10 08:41:22 UTC 2015


Hi Adam,

> On 9 Feb 2015, at 17:44, Adam Gundry <adam at well-typed.com> wrote:
> In the absence of a coherent story for polymorphism, I think the right
> thing to do is to be able to specify a particular validator, rather than
> try to have type inference determine a monomorphic type and otherwise
> get stuck...

I was planning to write a TH library for this sort of thing anyway, I was just curious if people had better solutions for the polymorphic story/solutions to take away this annoyance. But maybe a better solution in this direction is Gershom's solution to allow proper compile time functions.

> ...so is the right solution to introduce Typed TH quasiquoters for
> expressions? Sorry, I presumed such a thing existed, as Typed TH is
> rather regrettably underdocumented. Is there any particular difficulty
> with them, or is it just a Small Matter of Programming?

I don't actually know the answer to this, it was one of the questions I was hoping to answer in this discussion :)

> I think the lack of Lift instances is a separate problem; while it looks
> like 7.10 will be better in this respect and dataToExpQ goes a fair way,
> I agree that making them easier to generate would be nice. Perhaps a
> generics-based default method combined with DeriveAnyClass would make
> "deriving Lift" possible?

It's not directly related to whatever solution we pick, but I do think it's an important issue. There's currently a TH library for deriving them, but from what I've seen about writing them by hand I don't understand how GHC couldn't trivially generate them for most (all?) ADTs.

Cheers,
Merijn
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20150210/6d57e5e4/attachment-0001.sig>


More information about the ghc-devs mailing list