Because you're giving an alias to the *type*, not the variant tag.
Haskell has a PatternSynonyms extension that I've not used heavily, but
Elm doesn't give you anything to work with here.
Except for module names. Like I said, I'll try to fix this as best I can and 
see if it makes sense to pursue. My current plan is to topologically sort the 
graph, break any cycles with extra generics, and then hide the generics in 
`Internal` modules. Not 100% it'll work, but we'll see. It's fairly complex, 
but I would feel better about that than presenting long names with no escape.

Oh duh, good point... When the namespace is flattened, aliases only shorten the 
specific declaration aliased and not all of its nested declarations.
Yea, exactly. At that point, you're not flattening a bundle of code, you're 
just renaming a value.

Anyhoo, my next steps as I see them (roughly in order, but some can be 
parallelized):

  1.  Decide what writes could/should look like. Only a first pass as I'm sure 
people on the Elm side will have strong opinions here.
  2.  See if I can use a module per struct.
  3.  Update doc on the security discussion and the default value discussion.
  4.  Prod Evan on Elm discourse to see if he's willing to support some sort of 
byte array.
  5.  Build a fixed width numeric library.
  6.  Write the Elm library.
  7.  Build out the compiler plugin in either Haskell or C++.

Let me know if I missed anything. And thanks for the help and insights.
--Prasanth

________________________________
From: Ian Denhardt <i...@zenhack.net>
Sent: Friday, May 31, 2019 7:43 PM
To: 'Kenton Varda' via Cap'n Proto; David Renshaw; Kenton Varda
Cc: Prasanth Somasundar; 'Kenton Varda' via Cap'n Proto
Subject: Re: [capnproto] Cap'n Proto for Elm

And in fact you can't even do:

    type JSON = Pipeline'Stage'Worker'Globl'Value'JSON

    case ... of
        JSON -> ...

Because you're giving an alias to the *type*, not the variant tag.
Haskell has a PatternSynonyms extension that I've not used heavily, but
Elm doesn't give you anything to work with here.

-Ian

Quoting 'Kenton Varda' via Cap'n Proto (2019-05-31 19:10:18)
>    On Fri, May 31, 2019 at 2:54 PM David Renshaw <[1]dwrens...@gmail.com>
>    wrote:
>
>    Note that Prasanth's example aliases a module that's at an intermediate
>    point in the nested hierarchy. I doubt that Haskell would let you do
>    something like:
>    �  type Global = Pipeline'Stage'Worker'Global;
>    �  ...
>    �  case Global'Value'JSON: ...
>    �  case Global'Value'NUMBER: ...
>
>    Oh duh, good point... When the namespace is flattened, aliases only
>    shorten the specific declaration aliased and not all of its nested
>    declarations.
>    Yeah I guess that's tough...
>    -Kenton
>
>    --
>    You received this message because you are subscribed to the Google
>    Groups "Cap'n Proto" group.
>    To unsubscribe from this group and stop receiving emails from it, send
>    an email to [2]capnproto+unsubscr...@googlegroups.com.
>    Visit this group at [3]https://groups.google.com/group/capnproto.
>    To view this discussion on the web visit
>    [4]https://groups.google.com/d/msgid/capnproto/CAJouXQkbbtky0PLWJCc%3D3
>    GmjHvsxbZK9TtGAfBhCRxr%2BSyF%2B0Q%40mail.gmail.com.
>
> Verweise
>
>    1. mailto:dwrens...@gmail.com
>    2. mailto:capnproto+unsubscr...@googlegroups.com
>    3. https://groups.google.com/group/capnproto
>    4. 
> https://groups.google.com/d/msgid/capnproto/CAJouXQkbbtky0PLWJCc%3D3GmjHvsxbZK9TtGAfBhCRxr%2BSyF%2B0Q%40mail.gmail.com?utm_medium=email&utm_source=footer

-- 
You received this message because you are subscribed to the Google Groups 
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to capnproto+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/capnproto.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/capnproto/BYAPR11MB259943EBE40A425CC7207EB3C51A0%40BYAPR11MB2599.namprd11.prod.outlook.com.

Reply via email to