finos / morphir-elm

Tools to work with the Morphir IR in Elm.
https://package.elm-lang.org/packages/finos/morphir-elm/latest
Apache License 2.0
46 stars 65 forks source link

Consider supporting elm/url #1140

Open kmudrick opened 9 months ago

kmudrick commented 9 months ago

Is your feature request related to a problem? Please describe.

I'd love to be able to leverage the elm/url package - in particular, the ability to do url encoding and decoding

Describe the solution you'd like

Being able to import/use elm/url or the equivalent from Morphir

I've considered implementing the function I need (percentEncode) in pure elm using the EcmaScript spec for the equivalent (which is what the Elm Kernel seems to use under the covers anyway)

DamianReeves commented 9 months ago

@stephengoldbaum and @AttilaMihaly I actually think exposing a Url type is useful for Morphir, use of a Url for location and indexing concepts have come up in various business scenarios as Url is about addressing not just web work.

I'd be happy to submit a PR to add this.

stephengoldbaum commented 9 months ago

This is like UUID in terms of structured string types. Should we add each of these as unique types or add support for Typed Strings like Bosque has?

On Thu, Feb 8, 2024 at 11:40 PM Damian Reeves @.***> wrote:

@stephengoldbaum https://github.com/stephengoldbaum and @AttilaMihaly https://github.com/AttilaMihaly I actually think exposing a Url type is useful for Morphir, use of a Url for location and indexing concepts have come up in various business scenarios as Url is about addressing not just web work.

I'd be happy to submit a PR to add this.

— Reply to this email directly, view it on GitHub https://github.com/finos/morphir-elm/issues/1140#issuecomment-1935047047, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7SPJF7B4CBNZCB4NAUA3YSVH6TAVCNFSM6AAAAABDARHRTSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZVGA2DOMBUG4 . You are receiving this because you were mentioned.Message ID: @.***>

AttilaMihaly commented 9 months ago

Can we represent a URL as a custom type in user code? Something like this:

type alias URL =
  { scheme : Scheme
  , authority : Authority
  , path : Path
  , query : Query
  , fragment : Fragment
  }

I didn't get into the details of each part because I just wanted to demonstrate the idea.

I think we should start thinking in terms of an extension mechanism that allows people to add new libraries to extend the SDK because otherwise we will have maintenance issues.

DamianReeves commented 9 months ago

We did try this but there are limits to what we support at the API layer. I think we should consider what are the base types we support so we can move to the model you are suggesting @AttilaMihaly . But I don't think we are there yet, for both UUID and URL we are missing vital parts crucial to constructing these things.