replace foo >>= return . bar with <&>

This commit is contained in:
Daniel Barlow 2024-10-31 00:38:35 +00:00
parent e15c42ff4a
commit ea313b7f6e

View File

@ -25,6 +25,7 @@ import Data.Time.ISO8601 qualified
import Debug.Trace (trace, traceShow)
import Text.XML
import Text.XML.Cursor as Cursor
import Data.Functor((<&>))
data Pos = Pos Float Float deriving (Show, Eq)
@ -91,10 +92,10 @@ elToPoint c =
Right $
Point
(Pos lat lon)
(listToMaybe ele >>= return . asFloat)
(listToMaybe ele <&> asFloat)
utime
(listToMaybe cadence >>= return . asInt)
(listToMaybe power >>= return . asInt)
(listToMaybe cadence <&> asInt)
(listToMaybe power <&> asInt)
Nothing
where
asFloat v = (read (Data.Text.unpack v) :: Float)