Open robinp opened 5 years ago
This would be useful to do fmap join . sequenceA . listToMaybe on a query which normally returns [Only (Maybe a)]. With the magic sequence this becomes Only (Maybe a).
fmap join . sequenceA . listToMaybe
[Only (Maybe a)]
Only (Maybe a)
Or, to golf more, join . fromOnly . sequenceA . listToMaybe to get Maybe a.
join . fromOnly . sequenceA . listToMaybe
Maybe a
Only is defined in http://hackage.haskell.org/package/Only package
Only
This would be useful to do
fmap join . sequenceA . listToMaybe
on a query which normally returns[Only (Maybe a)]
. With the magic sequence this becomesOnly (Maybe a)
.