[Haskell-cafe] do you have to use fix with forkio?

Lennart Augustsson lennart at augustsson.net
Fri Mar 6 04:04:25 EST 2009


Personally I would not use fix.  I don't think it improves readability.

  -- Lennart

2009/3/5 Daryoush Mehrtash <dmehrtash at gmail.com>:
> In this chat server implementation
> http://www.haskell.org/haskellwiki/Implement_a_chat_server
>
> forkIO is used with fix as in:
>
>     reader <- forkIO $ fix $ \loop -> do
>
>         (nr', line) <- readChan chan'
>         when (nr /= nr') $ hPutStrLn hdl line
>
>         loop
>
> Do you have to use fix?  Or is there a way to write this with a "let"?
>
> --
> Daryoush
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


More information about the Haskell-Cafe mailing list