darcs

Patch 2413 WIP - making Apply into an MPTC

Title WIP - making Apply into an MPTC
Superseder Nosy List ganesh
Related Issues
Status in-discussion Assigned To
Milestone

Created on 2024-06-16.23:10:22 by ganesh, last changed 2024-07-25.09:54:55 by bfrk.

Files
File name Status Uploaded Type Edit Remove
enable-multiparamtypeclasses-by-default.dpatch bfrk, 2024-07-25.09:54:52 application/x-darcs-patch
make-objectidofpatch-into-an-explicit-type-family.dpatch dead ganesh, 2024-06-16.23:10:22 application/x-darcs-patch
patch-preview.txt dead ganesh, 2024-06-16.23:10:22 text/x-darcs-patch
patch-preview.txt bfrk, 2024-07-25.09:54:52 text/x-darcs-patch
See mailing list archives for discussion on individual patches.
Messages
msg24016 (view) Author: ganesh Date: 2024-06-16.23:10:22
I thought I'd have a look at what making Apply
into an MPTC looks like.

I've given up for now as it looks like a lot of work.

Some highlights:

The extra parameter gets all over the place. Perhaps
that's a good thing as it makes things more explicit,
but it's a lot of changes.

For example I was surprised to discover it in the core
of V2.Non and in matchers. A lot of explicit type applications
will likely be needed to propagate it around.

I also had to extract several classes from RepoPatch/PrimPatch
in order to avoid the extra parameter also bleeding into them
and then infecting various other code that didn't really depend
on it.

3 patches for repository darcs-unstable@darcs.net:/opt/darcs/screened:

patch 32736380b14ae146aaf4d7bc8a788a36d3f7d1dd
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Sat Jun 15 20:27:18 BST 2024
  * make ObjectIdOfPatch into an explicit type family

patch 0f17e40826864ea9d163c444c6e0df3cd98aa50e
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Sat Jun 15 20:43:52 BST 2024
  * enable MultiParamTypeClasses by default

patch aa8ea33934afda7d114fc652295ef5fa33188c83
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jun 17 00:05:16 BST 2024
  * WIP: Apply as an MPTC
Attachments
msg24070 (view) Author: bfrk Date: 2024-07-25.09:54:52
I have rebased them to current screened and completed the work you started.

This is still very much experimental. I'll have to see if adding more Apply
instances with different state types really works out as I would like it to.
It will certainly add even more constraints like the ones I added in
D.P.RepoPatch.

One thing that irks me is that we loose the ability to express the
coincidence of apply states for p and (PrimOf p) which should hold for /any/
state type. Even further, the Apply instances for all RepoPatch types are
generically given by

  apply p = applyPrimFL (effect p)

Can we use quantified constraints to at least express the requirement that
forall s. (PrimPatchBase p, PrimApply s (PrimOf p)) => Apply s p ?

(That would be a very good reason to drop support for ghc < 8.6).

3 patches for repository https://darcs.net/screened:

patch 7794fd4ee1b00d5360591e7cfb4874a5923e5f6e
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Sat Jun 15 21:43:52 CEST 2024
  * enable MultiParamTypeClasses by default

patch 8a86aa01254a3ca680b46e374669fc4caba2ad65
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Sat Jun 15 21:27:18 CEST 2024
  * make ObjectIdOfPatch into an explicit type family

patch 6dcacf7d99a88da0f2cfe71fd772f4c0c0e36e2b
Author: Ganesh Sittampalam <ganesh@earth.li>
Date:   Mon Jun 17 01:05:16 CEST 2024
  * WIP: Apply as an MPTC
Attachments
History
Date User Action Args
2024-06-16 23:10:22ganeshcreate
2024-06-16 23:11:43ganeshsetstatus: needs-screening -> in-discussion
title: make ObjectIdOfPatch into an explicit ty... (and 2 more) -> WIP - making Apply into an MPTC
2024-07-25 09:54:55bfrksetfiles: + patch-preview.txt, enable-multiparamtypeclasses-by-default.dpatch
messages: + msg24070