News for hackers. Stuff that matters.
Re:Löb and möb: strange loops in Haskell by hgsgm on Monday January 30, 2023 @09:29AM (#34579964)
Are you saying it's weird that a function has an explicit type in Haskell? ("First-class" functions)

https://en.m.wikipedia.org/wiki/First-class_function

Re:Löb and möb: strange loops in Haskell by mrkeen on Monday January 30, 2023 @09:36AM (#34580057)
You can read those lower case letters as preceded by "for all", and it's up to the caller to choose which concrete type the letter should represent, as the function promises to return an implementation "for all" concrete types.

So if wrote the function foo,

    foo :: Int -> b
    
and you happened to need a BufferedReader, you could just get it by calling (foo 3). That's what the "thin air" comment is. Where could the implementation of BufferedReader possibly have come from?
Re:Löb and möb: strange loops in Haskell by gowld on Wednesday February 01, 2023 @05:57PM (#34619279)
That's impossible, but that's not what's happening here. There is no "-> b" at the end of the type signature upthread.

The example in the thread is more like

   foo :: Either (b -> Int) b
which is much easier:

   foo = Left (const 1) :: Either (b -> Int) b