[Haskell-cafe] concatenate two Maybe String...
Damien Mattei
mattei at oca.eu
Tue Jan 8 14:05:22 UTC 2019
from the previous solution and posts i can deduce this solution to
concatanate N Maybe String, the function could be written:
(+++) = \x y -> (++) <$> x <*> y
this is basically equivalent to the previous one:
(+++) = liftM2 (++)
on f +++ mp +++ s i get results like:
resBDstrFloat =Just "-04.3982"
i will stay with those solutions.
Le 08/01/2019 08:47, Tom Ellis a écrit :
> On Mon, Jan 07, 2019 at 05:13:13PM +0100, Damien Mattei wrote:
>> just after in my code i have this to concatanate the two strings f and s
>> that are the first and second element of the array:
> ...
>> i do not want to do it using the hard way with case... of Just x ->
>> nothing .........
>
> Just do it the hard way and get some code that works. You can always
> "improve" it later if you like. "Hard" code that works is orders of
> magnitude more valuable that "easy" code that doesn't.
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.
>
--
Damien.Mattei at unice.fr, Damien.Mattei at oca.eu, UNS / OCA / CNRS
More information about the Haskell-Cafe
mailing list