Question: The way to have ad-hoc polymorphism (function overloading) in Haskell is through type classes (see answers to [this](https://stackoverflow.com/questions/33177019/why-has-haskell-troubles-resolving-overloaded-operators), [this](https://stackoverflow.com/questions/30039135/haskell-ad-hoc-polymorphism) and [this](https://stackoverflow.com/questions/3944756/best-way-to-implement-ad-hoc-polymorphism-in-haskell) question, among others).

But I'm struggling to define an overloaded `mult` (product) function for the following cases:

```
mult: [Double] -> Double -> [Double]
mult: Double -> [Double] -> [Double]
mult: [Double] -> [Double] -> [Double]

```

Thanks

(At least, case 1 `[Double]*Double` and case 3 `[Double]*[Double]` would be necessary).

Answer: 
I've done a bit of experimenting with line-heights within input boxes and think I've come to some sort of conclusion. 

It appears that if the size of the font in an input box equals or exceeds the line height, then the box changes size and its content (but **not** placeholder) changes also to fit. This is obvious if you remove the heights from your example.

```css
  input, span {
    padding: 0;
    margin: 0;
    width: 100px;
    padding: 0;
    min-height: 0;
    display: inline-block;
    font-family: inherit;
    border: 2px solid red;
    vertical-align: middle;
  }

  input, input::-webkit-input-placeholder, span {
    line-height: 50px;
    font-size: 50px;
  }
```

```html

<input type="text" value="Text">
<input type="text" placeholder="Text">
<span>Text</span>
```

If you set the `font-size` to smaller than the line height, you no longer see the weird line-height effect and all the text sits on the same line:

```css
  input, span {
    padding: 0;
    margin: 0;
    width: 100px;
    padding: 0;
    min-height: 0;
    display: inline-block;
    font-family: inherit;
    border: 2px solid red;
    vertical-align: middle;
  }

  input, input::-webkit-input-placeholder, span {
    line-height: 50px;
    font-size: 45px;
  }

```

```html

<input type="text" value="Text">
<input type="text" placeholder="Text">
<span>Text</span>
```

Here's a side-by-side example: <http://codepen.io/Jivings/pen/OyOKOV>

I hope this helps, and at least brings you closer to a solution in your own CSS!
**Updated base on comments below**

In order to use the same `line-height` for each of the elements I updated the CSS to this:

```
*,
*:before,
*:after {
  -moz-box-sizing: border-box;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}

div {
  line-height: 50px;
  font-family: Arial;
}

input, span {
    border: 2px solid red;
    display: inline-block;
    font: 50px Arial;
    height: 60px;
    line-height: 60px;
    padding: 0;
    vertical-align: middle;
    width: 100px;
}
input {
    padding-top: 3px;
}

```

Basically you if use the same contain `height` and `line-height` the text will show correctly next to each other even if you change the font sizes. The font size must be at least 10px or so bigger than the height and line-height otherwise it will become skewed again.

You can [see my updated JS.Fiddle here](https://jsfiddle.net/ka1psLon/1/). Hope that helps.