replace foo >>= return . bar with <&>
This commit is contained in:
parent
e15c42ff4a
commit
ea313b7f6e
@ -25,6 +25,7 @@ import Data.Time.ISO8601 qualified
|
|||||||
import Debug.Trace (trace, traceShow)
|
import Debug.Trace (trace, traceShow)
|
||||||
import Text.XML
|
import Text.XML
|
||||||
import Text.XML.Cursor as Cursor
|
import Text.XML.Cursor as Cursor
|
||||||
|
import Data.Functor((<&>))
|
||||||
|
|
||||||
data Pos = Pos Float Float deriving (Show, Eq)
|
data Pos = Pos Float Float deriving (Show, Eq)
|
||||||
|
|
||||||
@ -91,10 +92,10 @@ elToPoint c =
|
|||||||
Right $
|
Right $
|
||||||
Point
|
Point
|
||||||
(Pos lat lon)
|
(Pos lat lon)
|
||||||
(listToMaybe ele >>= return . asFloat)
|
(listToMaybe ele <&> asFloat)
|
||||||
utime
|
utime
|
||||||
(listToMaybe cadence >>= return . asInt)
|
(listToMaybe cadence <&> asInt)
|
||||||
(listToMaybe power >>= return . asInt)
|
(listToMaybe power <&> asInt)
|
||||||
Nothing
|
Nothing
|
||||||
where
|
where
|
||||||
asFloat v = (read (Data.Text.unpack v) :: Float)
|
asFloat v = (read (Data.Text.unpack v) :: Float)
|
||||||
|
Loading…
Reference in New Issue
Block a user