[Haskell-beginners] Monadic functions definitions for free monadic DSL

Sumit Raja sumitraja at gmail.com
Sat Oct 22 01:14:15 UTC 2016


> I feel like if you can figure out what you actually want Accept to do, it
> will become clearer.  Here's my attempt.  Accept takes a chan, takes a
> procedure to loop on, a procedure to accept on, and then returns the server
> chan to continue the loop.  I don't know if this is entirely right, but it
> type checks and hopefully it will give you some ideas.

As you've said Accept needs refinement. I tried writing a interpretUDP
which doesn't have an accept loop but does have a bind + listen. I
suspect that accept needs to move into the interpretTCP somehow and
the DSL needs to be Bind or similar. Bind makes more sense as well if
I wanted to write a pipes or a chan based interpreter.

Thanks for the rewrite and the pointers.

-Sumit


More information about the Beginners mailing list