summaryrefslogtreecommitdiff
path: root/doc/todo/RevertableProperty_with_NoInfo.mdwn
blob: e9c1eb5d20642e7459b375c515aaf22991f527bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
Currently, a RevertableProperty's Properties always both HasInfo. This
means that if a Property NoInfo is updated to be a RevertableProperty, and
someplace called ensureProperty on it, that will refuse to compile.

The workaround is generally to export the original NoInfo property under
a different name, so it can still be used with ensureProperty.

This could be fixed:

	data RevertableProperty i1 i2 where
		RProp :: Property i1 -> Property i2 -> RevertableProperty i1 i2

However, needing to write "RevertableProperty HasInfo NoInfo" is quite
a mouthful!

Since only 2 places in the propellor source code currently need to deal
with this, it doesn't currently seem worth making the change, unless a less
intrusive way can be found.

Probably related would be to make RevertableProperty a constructor in the
Property GADT, which would allow more property combinators to work on
RevertableProperties. That would look like:

	data Propety i where
		...
		RProp :: Property i1 -> Property i2 -> Property (CInfo i1 i2)

In this case, there's only one Info/NoInfo encompassing both sides, and
so ensureProperty could only be used on it if both sides were NoInfo.