path: root/doc
diff options
authorJoey Hess2019-07-02 00:45:48 -0400
committerJoey Hess2019-07-02 00:45:48 -0400
commit9241f54cf269e7ce3c9897ff66a9bfa2eb1ab64b (patch)
treedf2c9643e4ffdb37a16b4fbbfeade894a0001400 /doc
parent665ea0d3d9e1b0e90278fd659dee0ef8642030da (diff)
point to branch
Diffstat (limited to 'doc')
1 files changed, 2 insertions, 22 deletions
diff --git a/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn b/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn
index 95f86143..d21c92fe 100644
--- a/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn
+++ b/doc/todo/use_ghc_8.0_custom_compile_errors.mdwn
@@ -6,27 +6,7 @@ For example, a RevertableProperty is sometimes used where only a regular
Property is accepted. In this case, the error could suggest that the user
apply `setupRevertableProperty` to extract the setup side of the RevertableProperty.
-And, when a Property HasInfo is provided to ensureProperty, propellor could
-explain, in the compile error, why it can't let the user do that.
-Custom errors need a type class to be used. So, could do something like this:
- class NeedsProperty a where
- withProperty :: (Property metatype -> b) -> b
- instance NeedsProperty (Property metatype) where withProperty = id
- instance TypeError (Text "Use setupRevertableProperty ...")
- => NeedsProperty RevertableProperty where
- withProperty = error "unreachable"
-(While propellor needs to be buildable with older versions of ghc,
-the `instance TypeError` can just be wrapped in an ifdef to make it only be
-used by the new ghc.)
-> The new type-errors library builds a lot of stuff on top of this.
-> Its ability to detect "stuckness" seems like it may be able to catch
-> the very long type errors that we sometimes see when using propellor, and
-> whittle them down to a more useful error. --[[Joey]]
+> The `custom-error-types` branch has this implemented quite nicely.
+> Unfortunately, it ran into a ghc bug <>
[[!tag user/joey]]