On Thursday, March 30, 2017 at 8:31:29 AM UTC+1, Aaron VonderHaar wrote:
>
> In your abstract example, instead of:
>
>     andThen2 : (Var2 -> a) -> Type2 -> Maybe a
>
> you should try to write:
>
>     getVar3 : Type2 -> Maybe Var3
>

A most informative discussion, thanks for this. I have kind of figured much 
of this out for myself but not quite so completely or neatly as you have 
shown here.

Instead of calling it 'getVar3', I am using names like 'whenWithVar3'. The 
'when' part better reflects that the operation will not always produce a 
result. 'whenWith' is a bit long, perhaps 'whenVar3' might be better?

model.study.status
|> whenProgressingSteps
|> Maybe.map Pivot.whenCurrent
|> Maybe.andThen whenScribbles
|> Maybe.map (Scribbles.update scribblesMsg model)
|> Maybe.withDefault model

But perhaps the 'get' and 'set' conventions are already better established 
from lenses or monocles?

-- 
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.

Reply via email to