relax a bit and let us find the best way to do a module system
What this even means? I cannot write?
and maybe help us
Am I not doing this?
If you have your own vision - tell me. Right now you sound like a gatekeeper
relax a bit and let us find the best way to do a module system
What this even means? I cannot write?
and maybe help us
Am I not doing this?
If you have your own vision - tell me. Right now you sound like a gatekeeper
I had difficulty expressing it. I think it should have been âweâll figure outâ. That DuplicateModule -error needs to go like you said in the start. Btw. Albert Y. C. Lai told me a potential known solution to it and I would have not known to ask if you had not written this post.
I have no vision about this one. However I see that you hate what Purescript offers you right now with module/import declarations, and I do not hate it as much.
Why Iâm unable to hate purescriptâs module/import system is because I know this problem is very hard, and that purescript community figures out how to do it right eventually. Who knows perhaps youâll figure it out, at least youâve helped it out.
Well⌠I have one thing to say. That you donât see implementation names in the import declarations might be a feature, given that your problem with them is solved. Those things separate the interfaces from their implementations. This could be useful since purescript has multiple target platforms, Javascript is only the one of them.
@srghma I found this issue https://github.com/purescript/purescript/issues/3493 in the âIntend to Implementâ section, I think that itâs related. I see that a few have already voted, maybe we need to post it on slack in order to get more votes.
The next step is to understand in detail the changes needed - I think that it will help the maintainers or whoever is capable of implementing and it will keep this issue from just floating.
Since I am not too sure of the procedures myself, a goal that seems realistic to me is to try and see if we can move this issue to a stage where there is a potential agreement based on the vote and the details that the maintainers/implementer might need.
That you donât see implementation names in the import declarations might be a feature, given that your problem with them is solved. Those things separate the interfaces from their implementations.
could you explain more
This could be useful since purescript has multiple target platforms, Javascript is only the one of them.
I cannot imagine a language that couldnât support
import "@noname/other-strings/String" as OtherString
added a comment to the issue you posted
maybe we need to post it on slack in order to get more votes
I could, but I donât want to bother, tnx anyway
to try and see if we can move this issue
I have mentioned in comment, letâs see how it goes
Just so you know, this issue is unlikely to get any real maintainer attention until (at the very least) after 0.14 is out.
@srghma My two cents about this detail:
I always hated the directory structure
âŚ
and wanted to write about
Since PureScript doesnât enforce module names matching the directory structure, you can actually have whatever structure you want. For example, you could have the Default.purs
file under Foo/
, but write module Foo where
at the top of that file.
Personally, Iâve been using structure like this:
| Foo/
| Foo.purs -- module Foo where
| Foo1.purs -- module Foo.Foo1 where
| Foo2.purs -- module Foo.Foo2 where
| Bar/
| Bar.purs
| Bar1.purs
| Bar2.purs
You pointed out that when you import a module.
import Data.String.Extra
Then youâd have to do spago install strings-extra
but it requires you to remember this and I agree this is an annoying thing having to recall.
Ok. Iâll explain more about the interface/implementation separation.
If you have function, eg. camelCase :: String -> String, this is an interface that lives in Data.String.Extra
The strings-extra
is an implementation, a means to fill up the module Data.String.Extra
. However something else can do this fill-in as well.
This is a generic system and if we look at something else like DOM interface or alternatively SDL or OpenGL. Depending on your target platform, different libraries might fill these up, or same library need to be configured differently.
Now I do not know if youâre right and we should just do it your way. Your proposed syntax at least could coexist with the old syntax.
sorry for late reply
The
strings-extra
is an implementation, a means to fill up the moduleData.String.Extra
. However something else can do this fill-in as well.
the same could be possible with import style
import "@contrib/strings-extra" as StringsExtra
( Foo(Bar)
)
just change
purs compile --output output \
--package @contrib/strings-extra:.spago/@contrib/strings-extra/v9.9.9/src \
to
purs compile --output output \
--package @contrib/strings-extra:.spago/@my/strings-extra/v9.9.9/src \
though Iâm not a fan of this
I would rather import it as
purs compile --output output \
--package @my/strings-extra:.spago/@my/strings-extra/v9.9.9/src \
and change code everywhere to
import "@my/strings-extra" as StringsExtra
( Foo(Bar)
)
to clearly see that itâs different package