Are there any language extensions or language descendants of Haskell that contribute to expressiveness, especially when handling instances?

Sometimes I come across a β€œfunction” that Haskell only matches instances, namely

instance (a ~ NewDataTyp b) => C a 

will now match any type, i.e. writing another C instance declaration in your program will be an error, even if it cannot conflict because of the context of a ~ NewDataTyp b . From time to time, a lot of effort is required to overcome; I had to rebuild hundreds of lines of code to avoid this limitation.

Are there language extensions or descendant languages ​​(Curry? Agda?) That are designed with a higher priority for expressiveness? This can bring sacrifice (a) the openness of the world of styles (b) a polynomial definition of time.

edit - for those who are interested in the question, this page may also be of interest: http://www.haskell.org/haskellwiki/Future_of_Haskell

+8
haskell typeclass overlapping-instances
source share
1 answer

Why it costs Scala accepts a more or less literal translation of what you just wrote. I'm not sure how useful this is.

 trait C[T] case class NewDataType[T]() implicit def letItBeInjectiveWhyNot[K[_],T]: K[T] =:= K[T] implicit def cIsh[A,S](implicit ev: A =:= NewDataType[S]): C[A] implicit def another: C[Int] implicitly[C[NewDataType[String]]] implicitly[C[Int]] 
+1
source share

All Articles