From e9d5d9aff1cc2046149d3e5dcd9f4ef0f2a334a1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2015 14:45:14 -0400 Subject: remove toSimpleProp It didn't do what I thought it did with a RevertableProperty; it always returned Nothing because even if the input properties to are NoInfo, it casts them to HasInfo. Even if it had worked, it lost type safety. Better to export the Property NoInfo that is used in a RevertableProperty, so it can be used directly. --- doc/todo/RevertableProperty_with_NoInfo.mdwn | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 doc/todo/RevertableProperty_with_NoInfo.mdwn (limited to 'doc/todo/RevertableProperty_with_NoInfo.mdwn') diff --git a/doc/todo/RevertableProperty_with_NoInfo.mdwn b/doc/todo/RevertableProperty_with_NoInfo.mdwn new file mode 100644 index 00000000..3b4a61a9 --- /dev/null +++ b/doc/todo/RevertableProperty_with_NoInfo.mdwn @@ -0,0 +1,18 @@ +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. -- cgit v1.3-2-g0d8e From 73ad89d9734bace04b68e078fa1d46ccee6a396b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2015 15:04:05 -0400 Subject: propellor spin --- doc/todo/RevertableProperty_with_NoInfo.mdwn | 3 +++ 1 file changed, 3 insertions(+) (limited to 'doc/todo/RevertableProperty_with_NoInfo.mdwn') diff --git a/doc/todo/RevertableProperty_with_NoInfo.mdwn b/doc/todo/RevertableProperty_with_NoInfo.mdwn index 3b4a61a9..e778ff85 100644 --- a/doc/todo/RevertableProperty_with_NoInfo.mdwn +++ b/doc/todo/RevertableProperty_with_NoInfo.mdwn @@ -16,3 +16,6 @@ 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. + +Hmm, if RevertableProperty were made a constructor in the Property GADT, +this would need to be done, and that would also allow for -- cgit v1.3-2-g0d8e From 5d8bd485cbd4c88bcc09146118d1431d13a152cc Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 25 Jan 2015 15:08:40 -0400 Subject: propellor spin --- doc/todo/RevertableProperty_with_NoInfo.mdwn | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'doc/todo/RevertableProperty_with_NoInfo.mdwn') diff --git a/doc/todo/RevertableProperty_with_NoInfo.mdwn b/doc/todo/RevertableProperty_with_NoInfo.mdwn index e778ff85..e9c1eb5d 100644 --- a/doc/todo/RevertableProperty_with_NoInfo.mdwn +++ b/doc/todo/RevertableProperty_with_NoInfo.mdwn @@ -17,5 +17,13 @@ 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. -Hmm, if RevertableProperty were made a constructor in the Property GADT, -this would need to be done, and that would also allow for +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. -- cgit v1.3-2-g0d8e