Newest at the top
2025-02-07 11:42:56 +0100 | alp_ | (~alp@2001:861:8ca0:4940:cbb9:a4bc:2367:1426) (Remote host closed the connection) |
2025-02-07 11:41:32 +0100 | alp_ | (~alp@2001:861:8ca0:4940:cbb9:a4bc:2367:1426) |
2025-02-07 11:41:14 +0100 | alp_ | (~alp@2001:861:8ca0:4940:9b7d:225:6dca:3) (Remote host closed the connection) |
2025-02-07 11:40:28 +0100 | alp | (~alp@2001:861:8ca0:4940:c543:753a:35f:61ff) (Ping timeout: 272 seconds) |
2025-02-07 11:39:50 +0100 | alp_ | (~alp@2001:861:8ca0:4940:9b7d:225:6dca:3) |
2025-02-07 11:39:32 +0100 | alp_ | (~alp@2001:861:8ca0:4940:c66f:9510:c543:5c5b) (Remote host closed the connection) |
2025-02-07 11:39:26 +0100 | tcard | (~tcard@2400:4051:5801:7500:cf17:befc:ff82:5303) tcard |
2025-02-07 11:38:07 +0100 | alp_ | (~alp@2001:861:8ca0:4940:c66f:9510:c543:5c5b) |
2025-02-07 11:37:50 +0100 | alp_ | (~alp@2001:861:8ca0:4940:5fab:379e:f5b9:17db) (Remote host closed the connection) |
2025-02-07 11:37:47 +0100 | JuanDaugherty | ColinRobinson |
2025-02-07 11:36:25 +0100 | alp_ | (~alp@2001:861:8ca0:4940:5fab:379e:f5b9:17db) |
2025-02-07 11:34:42 +0100 | alp | (~alp@2001:861:8ca0:4940:c543:753a:35f:61ff) |
2025-02-07 11:34:26 +0100 | alp | (~alp@2001:861:8ca0:4940:d783:3ed4:b3b2:7c8f) (Remote host closed the connection) |
2025-02-07 11:33:00 +0100 | alp | (~alp@2001:861:8ca0:4940:d783:3ed4:b3b2:7c8f) |
2025-02-07 11:32:44 +0100 | alp | (~alp@2001:861:8ca0:4940:41b4:15ba:b9c5:e001) (Remote host closed the connection) |
2025-02-07 11:32:20 +0100 | akegalj | (~akegalj@141-136-207-93.dsl.iskon.hr) (Ping timeout: 244 seconds) |
2025-02-07 11:32:20 +0100 | ubert | (~Thunderbi@2a02:8109:ab8a:5a00:3bd7:f04:27ee:5a69) ubert |
2025-02-07 11:32:05 +0100 | <tomsmeding> | somehow :) |
2025-02-07 11:31:57 +0100 | <tomsmeding> | I think you can do the same in ocaml |
2025-02-07 11:31:46 +0100 | <tomsmeding> | in haskell, you can't satisfy that Ord constraint unless you know what the 'k' type is, monomorphically, or unless you have that 'k' as a parameter yourself and get the Ord instance from your caller |
2025-02-07 11:31:24 +0100 | JuanDaugherty | (~juan@user/JuanDaugherty) JuanDaugherty |
2025-02-07 11:31:19 +0100 | alp | (~alp@2001:861:8ca0:4940:41b4:15ba:b9c5:e001) |
2025-02-07 11:31:02 +0100 | alp | (~alp@2001:861:8ca0:4940:d5b5:2163:e0a9:7a7f) (Remote host closed the connection) |
2025-02-07 11:30:04 +0100 | remedan | (~remedan@ip-62-245-108-153.bb.vodafone.cz) remedan |
2025-02-07 11:27:53 +0100 | remedan | (~remedan@ip-62-245-108-153.bb.vodafone.cz) (Quit: Bye!) |
2025-02-07 11:27:35 +0100 | misterfish | (~misterfis@31-161-39-137.biz.kpn.net) misterfish |
2025-02-07 11:27:01 +0100 | <tomsmeding> | the types look different, but as you say, ocaml is the one that's more flexible, not haskell |
2025-02-07 11:26:44 +0100 | <tomsmeding> | I'm not sure it can! That's my point |
2025-02-07 11:26:36 +0100 | <neiluj> | sure, thanks! just wanted to see if haskell could solve my problem more easily, and it seems so :) |
2025-02-07 11:26:16 +0100 | <tomsmeding> | wherever you export your t, also make sure that module exports a compare function |
2025-02-07 11:25:56 +0100 | <neiluj> | plus it's more explicit, so easier to know which function gets called |
2025-02-07 11:25:54 +0100 | <tomsmeding> | you might need to visit some ocaml-specific forum to ask for more specific guidance. But I think you can get what you want in ocaml :) |
2025-02-07 11:25:35 +0100 | <tomsmeding> | right |
2025-02-07 11:25:34 +0100 | <neiluj> | for that type |
2025-02-07 11:25:28 +0100 | <neiluj> | given a type t, in ocaml, i can implement to instances of Ord with different comparison functions |
2025-02-07 11:24:48 +0100 | <neiluj> | well ocaml functors are more flexible as you can implement multiple instances of a module type for some type, while in haskell you'd need a newtype |
2025-02-07 11:24:05 +0100 | <neiluj> | instead of f :: Ord t => t -> t (where the Ord is implicit in the function call) |
2025-02-07 11:22:57 +0100 | <neiluj> | for ex: val f : (type t) (module Ord with type t = t) -> t -> t |
2025-02-07 11:22:34 +0100 | <tomsmeding> | in other words, I don't see anything yet here that you fundamentally can't do in ocaml but you can do in haskell |
2025-02-07 11:22:20 +0100 | <neiluj> | in a sense, you can emulate typeclasses in ocaml with functors, but you have to explicitly specify the module signature, while haskell does that for you with typeclasses |
2025-02-07 11:22:18 +0100 | notzmv | (~umar@user/notzmv) (Remote host closed the connection) |
2025-02-07 11:21:54 +0100 | <tomsmeding> | or perhaps this means that the whole bindings package needs to live inside that module? |
2025-02-07 11:21:41 +0100 | <tomsmeding> | neiluj: Ideally you'd need to have a module that defines your wrapping of GEN, which (among other things) defines a compare function so that it satisfies Map.OrderedType. The module's internals are abstract. However, somehow the rest of your library would need to be able to access those internals nevertheless |
2025-02-07 11:20:36 +0100 | misterfish | (~misterfis@h239071.upc-h.chello.nl) (Ping timeout: 252 seconds) |
2025-02-07 11:20:31 +0100 | <tomsmeding> | neiluj: I see! Then it makes sense. :) |
2025-02-07 11:20:20 +0100 | <tomsmeding> | merijn: sorry for being tardy. Yes, we need both styles of TH, hence this being a switch you can also _not_ turn on. But it's probably even better to do this with slice granularity, not module granularity :) |
2025-02-07 11:20:12 +0100 | <neiluj> | tomsmeding: precisely, and any module whose signature is a superset of some module signature S can be accepted as an instance of S whenever some function or functor expects an S |
2025-02-07 11:19:09 +0100 | <tomsmeding> | (That would be classic object-oriented style, C++/Java style) |
2025-02-07 11:18:57 +0100 | <tomsmeding> | an alternate design could be that when defining an ocaml module, you have to specify (by name) which signatures it implements, and then it doesn't implement any others. |
2025-02-07 11:18:16 +0100 | <tomsmeding> | i.e. go-style, not C++/Java style? |