Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

better implementation for AddT

  • Loading branch information...
1 parent bbf5211 commit f8eb9d17eb51bd9e68c11e3e0c2c4ce2caa344af @shangaslammi shangaslammi committed
Showing with 12 additions and 0 deletions.
  1. +12 −0 2011/
12 2011/
@@ -536,6 +536,18 @@ so that you know for certain that you are not mixing up screen coordinates with
All the code written for this post can be viewed and downloaded [here](
+## Updates
+### 2011-12-21 21:13 UTC
+The user ryani over at the [reddit thread]( made a great point about `AddT`. Since the typeclass doesn't contain any methods, it doesn't make much sense to use a typeclass with associated types. You can simply use a top level type family, which also gets rid of the requirement for UndecidableInstances. This is a big deal, as the aforementioned extension has a lot of drawbacks.
+type family AddT a b
+type instance AddT D1 b = Succ b
+type instance AddT (Succ a) b = Succ (AddT a b)
Sami Hangaslammi <[](mailto://>

0 comments on commit f8eb9d1

Please sign in to comment.
Something went wrong with that request. Please try again.