I would personally imagine it as changing this:
```elm
type alias SurroundCB cb_data_type =
{ cb_data : Maybe cb_data_type
, text : String
}
surroundSelectionWith : (HelpersMsg msgType -> mappedType) -> SurroundData
-> Cmd mappedType
surroundSelectionWith mapper data =
surroundSelectionWithPort data
```
To become this:
```elm
exposed type alias SurroundCB cb_data_type =
{ cb_data : Maybe cb_data_type
, text : String
}
exposed surroundSelectionWith : (HelpersMsg msgType -> mappedType) ->
SurroundData -> Cmd mappedType
exposed surroundSelectionWith mapper data =
surroundSelectionWithPort data
```
And it does not use up an extra keyword either (though does mean that a
function cannot be called 'exposed', not sure they can right now anyway).
An alternative that would not break syntax highlighting in more poorly made
text editors could perhaps be changing it to be:
```
exposed SurroundCB
type alias SurroundCB cb_data_type =
{ cb_data : Maybe cb_data_type
, text : String
}
exposed surroundSelectionWith
surroundSelectionWith : (HelpersMsg msgType -> mappedType) -> SurroundData
-> Cmd mappedType
surroundSelectionWith mapper data =
surroundSelectionWithPort data
```
Where type union in either format could be like:
```elm
exposed(..) type HelpersMsg msgType
= HelpersMsg_Ignore
| HelpersMsg_DelayCmd (Cmd msgType)
exposed HelpersMsg(..)
type HelpersMsg msgType
= HelpersMsg_Ignore
| HelpersMsg_DelayCmd (Cmd msgType)
```
Now that I am seeing it I think the one where `exposed` is on the line
before is better, less lengthy if many constructors for a type and you need
to specify not-all.
On Monday, August 8, 2016 at 2:09:32 AM UTC-6, Peter Damoc wrote:
>
> How would that actually look in code?
>
> Could you produce some mock code to show your idea?
>
> You can use the Counter.elm from the elm architecture tutorial as a
> template.
>
>
>
>
> On Mon, Aug 8, 2016 at 10:44 AM, Robin Heggelund Hansen <
> [email protected] <javascript:>> wrote:
>
>> There's one thing that has always bothered me with Haskell, and now also
>> Elm, and that is how functions are exposed. My problem with the way it
>> currently works is that you have go to the top of the file to see/alter if
>> a function is exposed to the "outside world".
>>
>> In Clojure and F#, it is default for top-level vars/functions to be
>> public, and you need to use a "private" keyword to restrict access. Since
>> Elm currently explicitly exposes functions at the top, I thought it would
>> be good to propose a public keyword instead.
>>
>> I assume that this is largely a preference thing, but I think it's worth
>> a discussion. What do people think of having a public/private keyword to
>> restrict access to variables/functions in modules, instead of the exposing
>> keyword we have today?
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Elm Discuss" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to [email protected] <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> --
> There is NO FATE, we are the creators.
> blog: http://damoc.ro/
>
--
You received this message because you are subscribed to the Google Groups "Elm
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.