Maybe (pun intended) the catMaybes function from 
http://package.elm-lang.org/packages/krisajenkins/elm-exts/25.13.0/Exts-Maybe
will help you.

It has a signature of:

    catMaybes : List (Maybe a) -> List a

Which keeps all your Just a items in the list.

So adding a Nothing would be relatively straightforward:

    myFunc : List (Maybe a) -> Maybe (List a)
    myFunc listOfMaybes =
      case catMaybes listOfMaybes of
        [] ->
          Nothing

        aList ->
          Just aList

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