Copyright | (c) 2020 Cedric Liegeois |
---|---|
License | BSD3 |
Maintainer | Cedric Liegeois <ofmooseandmen@yahoo.fr> |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Types and functions for working with (signed) lengths in metres, kilometres, nautical miles or feet.
Synopsis
- data Length
- feet :: Double -> Length
- kilometres :: Double -> Length
- metres :: Double -> Length
- nauticalMiles :: Double -> Length
- lengthP :: ReadP Length
- readLength :: String -> Maybe Length
- toFeet :: Length -> Double
- toKilometres :: Length -> Double
- toMetres :: Length -> Double
- toMillimetres :: Length -> Double
- toNauticalMiles :: Length -> Double
The Length
type
A length with a resolution of 1 micrometre.
Smart constructors
Read
lengthP :: ReadP Length Source #
Parses and returns a Length
formatted as (-)float[m|km|nm|ft].
e.g. 3000m, 2.5km, -154nm or 10000ft.
Conversions
toKilometres :: Length -> Double Source #
toKilometres l
converts l
to kilometres.
toMillimetres :: Length -> Double Source #
toMillimetres l
converts l
to millimetres.
toNauticalMiles :: Length -> Double Source #
toNauticalMiles l
converts l
to nautical miles.