Skip to content

Commit

Permalink
Address warnigns about monomorphism restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
passy committed Nov 22, 2016
1 parent ba2681e commit 122c800
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/Console.hs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ imageToMap img = M.union initial extra
showPack :: Show a => a -> ByteString
showPack = BS8.pack . show

initial :: M.Map ByteString ByteString
initial = M.singleton "inline" $ (showPack . btoi . ciInline) img

extra :: M.Map ByteString ByteString
extra = M.fromList $ filterSnd [ ("name", ciName img)
, ("width", showPack <$> ciWidth img)
, ("height", showPack <$> ciHeight img)
Expand Down Expand Up @@ -78,9 +81,12 @@ renderImage pre post img =
params :: M.Map ByteString ByteString -> B.Builder
params = snd . M.foldrWithKey' f (True, mempty)
where
f k a (empty', b) = let start = if empty' then b else b <> B.char8 ';'
end = B.lazyByteString k <> B.char8 '=' <> B.lazyByteString a
in (False, start <> end)
f k a (empty', b) =
let start :: B.Builder
start = if empty' then b else b <> B.char8 ';'
end :: B.Builder
end = B.lazyByteString k <> B.char8 '=' <> B.lazyByteString a
in (False, start <> end)

isScreen :: IO Bool
isScreen = isPrefixOf "screen" <$> Env.getEnv "TERM"

0 comments on commit 122c800

Please sign in to comment.