> And there are certain classes of typed problems that are impossible
without this feature, so it is highly useful!

Can you expand on this? I imagine it's expressions all the way down and
type inference is still possible... so imagine it's a nice-to-have rather
than must-have.

Would like to understand more basically!
On Tue, 15 Nov 2016 at 17:40, OvermindDL1 <[email protected]> wrote:

> On Tuesday, November 15, 2016 at 9:30:23 AM UTC-7, Max Goldstein wrote:
>
> My impression is that it's a Haskell extension that's very commonly used.
> In the process of upgrading, I uncommented some signatures only for the
> compiler to tell me that they are incorrect, so this feature has been
> useful already.
>
>
> Oh it is very useful!  And there are certain classes of typed problems
> that are impossible without this feature, so it is highly useful!
>
> An example of usage in OCaml anyway (since I have a shell of it up right
> now):
> ```ocaml
> let f (x : 'x) =
>   let a (y : 'x) = ()
>   in a
>
> let b = f 42 3
> ```
> That compiles right, changing b to this though:  let b = f 42 3.14
> Causes this error:
> ```
> Line 6, 14: Error: This expression has type float but an expression was
> expected of type
>          int
> ```
> Where this compiles fine (and may not only be entirely unexpected but
> could hide major bugs later in the program!):
> ```ocaml
> let f x =
>   let a y = ()
>   in a
>
> let b = f 42 3.14
> ```
>
> --
> You received this message because you are subscribed to the Google Groups
> "Elm Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to