ermine language

3
Edward Kmett⏏️ @kmett

@nuttycom No. local type classes lead to lack of confluence of instance resolution. This is bad. scalaz lies to itself pretending it has it.

2013-07-17 01:21:54
Edward Kmett⏏️ @kmett

@nuttycom My reflection package in Haskell provides a consistent way to make 'local instances' that doesn't violate confluence.

2013-07-17 01:22:27
Dan P @copumpkin

@nuttycom @kmett just pass dictionaries in :) automatic resolution without uniqueness is madness!

2013-07-17 01:22:33
Eugene Burmako @eugene_burmako

@kmett Also what’s your stance towards macros as implemented in Scala? Did you feel the need for something similar in Ermine?

2013-07-17 01:31:44
Dan P @copumpkin

@nuttycom @kmett canonical example is Haskell's Data.Map vs. Scala's SortedMap. Former can have efficient merge operations, latter can't.

2013-07-17 02:28:34
Dan P @copumpkin

@nuttycom @kmett more generally, problems where structure of data is affected by instance choice. Implicits don't supersede typeclasses!

2013-07-17 02:29:39
Dan P @copumpkin

@nuttycom @kmett unless of course you get to Agda where you can index the Map by the ordering used :) and it rejects more than one match

2013-07-17 02:33:54
James Iry @jamesiry

@nuttycom @kmett The classic example have a Set of Things that uses different definitions of equality at different points in the program.

2013-07-17 02:53:21
James Iry @jamesiry

@nuttycom @kmett In Scala the answer is usually to stuff the Eq definition into the set at construction time, but that's not enforced.

2013-07-17 02:54:01
James Iry @jamesiry

@nuttycom @kmett Would be easy to write a Set that takes the Eq definition at each put and get operation.

2013-07-17 02:54:34
Edward Kmett⏏️ @kmett

@jamesiry @nuttycom Correct. But this leads to issues. You now can't know two Eq's are equivalent, so you can't use hedge unions and worse.

2013-07-17 02:57:02
Edward Kmett⏏️ @kmett

@jamesiry @nuttycom We already move the Ord constraint to get/set. Much of scalaz actually _assumes_ confluence that doesn't hold in scala.

2013-07-17 02:58:37
Edward Kmett⏏️ @kmett

@cartazio @copumpkin @nuttycom hedge union requires consistent ordering, and gives better asymptotics than the direct insertions.

2013-07-17 02:59:27
Edward Kmett⏏️ @kmett

@jamesiry @nuttycom The problem is in scala if you do so, there is no confluence ensuring you get the right instance so you get bad results

2013-07-17 03:01:51
Edward Kmett⏏️ @kmett

@jamesiry @nuttycom This approach works for Set, but not for many other constructions. e.g. autolifting for monad transformers

2013-07-17 03:02:52
Edward Kmett⏏️ @kmett

@jamesiry @nuttycom Consider (Yoneda f), that 'inherits' properties from f. It's a Monad if f is, a Comonad if f is.. Where do the dicts go?

2013-07-17 03:21:35
@nutty.land / @nuttycom@icosahedron.website @nuttycom

@kmett @jamesiry Well, I'm not sure that the typeclasses we have are as general as they could be anyway: https://t.co/teO9P8eFtw

2013-07-17 05:18:19
Edward Kmett⏏️ @kmett

@nuttycom @jamesiry "Restricted" typeclasses mean you can no longer use polymorphic recursion at all.

2013-07-17 05:21:54
Edward Kmett⏏️ @kmett

@nuttycom @jamesiry They also expose a ton of operational details of methods that use them. Many constructions cease to be canonical.

2013-07-17 05:22:41
Edward Kmett⏏️ @kmett

@ppedemon @puffnfresh @runarorama Unlike the bluejelly approach we only compile down a core rather than a bytecode. http://t.co/DflCOGeTL7

2013-07-17 05:35:16
Brian McKenna @puffnfresh

@kmett what relations are you using when you say that local type-classes/implicits break confluence?

2013-07-17 05:54:17
Brian McKenna @puffnfresh

Awesome things @kmett says: "Dependent types are easy to use and understand"

2013-07-17 06:07:14