GithubHelp home page GithubHelp logo

Comments (3)

OvermindDL1 avatar OvermindDL1 commented on July 26, 2024

My basic opinion right now: I see value in default implementations of signatures/interfaces but would like to consider more specificity than open appears to provide. Thoughts? Links to papers most definitely appreciated :D

There was talk in the OCaml area somewhat recently about the same but they'd not settled on a syntax, however it would be very nice to have. The suggestions that I remember were something like:

open Module.Name.[fun1; fun2]
open Module.Name.{fun1, fun2}
open Module.Name.(fun1, fun2)
open (fun1, fun2) from Module.Name (* This one was shut down fast due to parser concerns at the time *)
open fun1, fun2 from Module.Name (* This one was shut down fast due to parser concerns at the time *)
(* And a few others that I do not recall off hand, similar with import too *)

The main boon of include was being able to override prior defined functions in your own file though, adding in let rec with let being nonrec by default would allow for that.

from alpaca.

j14159 avatar j14159 commented on July 26, 2024

Something like open module.[fun1, fun2/arity] is quite consistent with the existing function import syntax for sure and I do see the advantage in being able to pull in default implementations. I'm not sure about things "opened" overriding the definitions in the module though - that seems sort of backwards to me but I might be thinking about this wrong.

A couple of things off the top of my head:

  • minor but maybe a different word than open, like adopt or inherit to clearly show that we're making these functions part of the module pulling them in?
  • not completely thought through yet but this feels like we're going to need an actual module type and system here and probably signatures/interfaces. Any particular thoughts on this? Favourite papers or implementations?

from alpaca.

OvermindDL1 avatar OvermindDL1 commented on July 26, 2024

I'd always be a fan of bringing in OCaml's module system whole-sale (and its implicit modules PR too).

from alpaca.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.