[Haskell-cafe] Channel9 Interview: Software Composability and the Future of Languages

Bulat Ziganshin bulat.ziganshin at gmail.com
Wed Jan 31 11:46:15 EST 2007


Hello Tomasz,

Wednesday, January 31, 2007, 12:01:16 PM, you wrote:

>> there are also many other similar issues, such as lack of good syntax
>> for "for", "while", "break" and other well-known statements,

> On the other hand you have an ability to define your own control
> structures.

i have a lot, but their features are limited, both in terms of
automatic lifting and overall syntax. let's consider

while (hGetBuf h buf bufsize == bufsize)
  crc := updateCrc crc buf bufsize
  break if crc==0
  print crc

how this can be expressed in Haskell, without losing clarity?

>> inability to use "return" inside of block and so on

> "inability" is an exaggeration - you can use the ContT monad
> transformer, which even allows you to choose how "high" you
> want to jump. But you probably already know this and just want to point
> that it is cumbersome?

don't know and don't want to use such a hard way. there is a simpler
solution, but it still requires to write more boilerplate code than C:

res <- doSomething
if isLeft res  then return$ fromLeft res  else do
let (Right x) = res
...



-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Haskell-Cafe mailing list