readFloat :: RealFloat float => (Token -> Maybe float) -> ReadValue float
readFloat f t = do
  v <- case scanTokens "" a of
         Right [L _ NEGATE, L _ (REALLIT x)] -> Just $ negate $ fromDouble x
         Right [L _ (REALLIT x)] -> Just $ fromDouble x
         Right [L _ tok] -> f tok
         Right [L _ NEGATE, L _ tok] -> negate <$> f tok
         _ -> Nothing
  return (v, dropSpaces b)
  where (a,b) = BS.span constituent t
        fromDouble = uncurry encodeFloat . decodeFloat
readFloat :: RealFloat float => (Token -> Maybe float) -> ReadValue float
readFloat f t = do
  v <- case scanTokens "" a of
         Right [L _ NEGATE, L _ (REALLIT x)] -> Just $ negate $ fromDouble x
         Right [L _ (REALLIT x)] -> Just $ fromDouble x
         Right [L _ tok] -> f tok
         Right [L _ NEGATE, L _ tok] -> negate <$> f tok
         _ -> Nothing
  return (v, dropSpaces b)
  where (a,b) = BS.span constituent t
        fromDouble = uncurry encodeFloat . decodeFloat
readFloat f t = do
  v <- case scanTokens "" a of
         Right [L _ NEGATE, L _ (REALLIT x)] -> Just $ negate $ fromDouble x
         Right [L _ (REALLIT x)] -> Just $ fromDouble x
         Right [L _ tok] -> f tok
         Right [L _ NEGATE, L _ tok] -> negate <$> f tok
         _ -> Nothing
  return (v, dropSpaces b)
  where (a,b) = BS.span constituent t
        fromDouble = uncurry encodeFloat . decodeFloat