News for hackers. Stuff that matters.
Re:Type-safe GraphQL with OCaml by masklinn on Thursday November 30, 2017 @04:12PM (#15819577)
Haskell does not allow accidentally mixing floats and integers together. In fact it doesn't even allow mixing finite and infinite-precision integers together, despite using the same operator for all number additions:

    Prelude> (3::Int) + (4::Integer)

    <interactive>:2:13:
        Couldn't match expected type ‘Int’ with actual type ‘Integer’
        In the second argument of ‘(+)’, namely ‘(4 :: Integer)’
        In the expression: (3 :: Int) + (4 :: Integer)
        In an equation for ‘it’: it = (3 :: Int) + (4 :: Integer)
It's not by any means the only language with that property either.
Re:Type-safe GraphQL with OCaml by runeks on Friday December 01, 2017 @11:11AM (#15824711)
Off topic: why on earth does ghci print out that last “In an equation for ‘it’: it = […]” statement? Seems like something internal to ghci, and not something that’s relevant to the user.
Re:Type-safe GraphQL with OCaml by masklinn on Saturday December 02, 2017 @06:38AM (#15831483)
You'd have to check ghci's source itself, but I expect it just hands the bits over to GHC for evaluation and the relevant GHC API (sensibly) requires a name, for which ghci provides "it".