summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-09-18 00:17:39 +0100
committerjao <jao@gnu.org>2022-09-18 00:17:39 +0100
commit2e9bc4187f0094d202fc11aa05f0637edcabf9bb (patch)
tree1e3bfb9c3dfc41b377020b038c5278803e0468ed
parent391a047ce85b9bf1c7fe219e10104393efe722af (diff)
downloadxmobar-2e9bc4187f0094d202fc11aa05f0637edcabf9bb.tar.gz
xmobar-2e9bc4187f0094d202fc11aa05f0637edcabf9bb.tar.bz2
whitespace
-rw-r--r--src/Xmobar/Plugins/Kraken.hs14
-rw-r--r--xmobar.cabal8
2 files changed, 11 insertions, 11 deletions
diff --git a/src/Xmobar/Plugins/Kraken.hs b/src/Xmobar/Plugins/Kraken.hs
index 8f2e1cc..2345b3d 100644
--- a/src/Xmobar/Plugins/Kraken.hs
+++ b/src/Xmobar/Plugins/Kraken.hs
@@ -28,7 +28,7 @@ data Kraken = Kraken [String] String
instance Exec Kraken where
alias (Kraken _ a) = a
start (Kraken ps _) cb = do
- mvar <- newEmptyMVar
+ mvar <- newEmptyMVar
bracket (async $ reconnectOnConnectionClose $ wsClientApp ps mvar) cancel $ \_ -> do
let loop mv p = do
v <- takeMVar mv
@@ -39,7 +39,7 @@ instance Exec Kraken where
loop mvar (Map.fromList $ zip ps (repeat 0.0))
where
- display :: Map.Map String Double -> String
+ display :: Map.Map String Double -> String
display m = unwords $ sort $ map (\x -> fst x ++ ": " ++ show (snd x)) $ Map.toList m
reconnectOnConnectionClose :: ClientApp () -> IO ()
@@ -71,7 +71,7 @@ parseDoubleString v = do
Just num -> return num
Nothing -> typeMismatch "Double inside a String" v
-instance FromJSON Ask where
+instance FromJSON Ask where
parseJSON (Array v)
| V.length v == 3 = do
p <- parseDoubleString $ v V.! 0
@@ -87,7 +87,7 @@ data Bid = Bid {
, bidLotVolume :: Double
} deriving Show
-instance FromJSON Bid where
+instance FromJSON Bid where
parseJSON (Array v)
| V.length v == 3 = do
p <- parseDoubleString $ v V.! 0
@@ -102,7 +102,7 @@ data Close = Close {
, closeLotVolume :: Double
} deriving Show
-instance FromJSON Close where
+instance FromJSON Close where
parseJSON (Array v)
| V.length v == 2 = do
p <- parseDoubleString $ v V.! 0
@@ -117,12 +117,12 @@ data TickerInformation = TickerInformation {
, close :: Close
} deriving Show
-instance FromJSON TickerInformation where
+instance FromJSON TickerInformation where
parseJSON = withObject "P" $ \v -> TickerInformation
<$> v .: "a"
<*> v .: "b"
<*> v .: "c"
-
+
data Message =
Heartbeat
| TickerMessage { channelId :: Int, tickerInformation :: TickerInformation, channelName :: Text, tickerPair :: Text }
diff --git a/xmobar.cabal b/xmobar.cabal
index aae9441..ef94c8d 100644
--- a/xmobar.cabal
+++ b/xmobar.cabal
@@ -88,14 +88,14 @@ flag with_rtsopts
description: Use -with-rtsopts=-V0 to reduce wakeups.
default: True
-flag with_uvmeter
- description: UVMeter only useful to australians.
- default: False
-
flag with_weather
description: Enable weather plugin.
default: True
+flag with_uvmeter
+ description: UVMeter only useful to australians.
+ default: False
+
flag with_kraken
description: Enable Kraken plugin.
default: False