[Haskell-cafe] Monad applied in Java

Ben.Yu at combined.com Ben.Yu at combined.com
Fri Dec 9 11:43:25 EST 2005

My apology to those who don't care about Java. Please trash this note.

I recently published two open source Java projects that are based on the 
Monad computation model learned from Haskell community.

1. A port for Parsec. This library is called Jparsec. It implements 
monadic parser combinator in Java. Not nearly as concise and clean because 
of the limitation of the Java language, but it implements the same idea. 
And it looks like the only monadic parser combinator lib in Java so far, 
according to my google homework. ;--)

url: http://docs.codehaus.org/display/JPARSEC/home

2. A light-weight Dependency Injection container that's built around the 
Monad model. 

If you see
<sequence id="mybean">
  <bean var="a1" class="A1"/>
  <bean var="a2" class="A2"/>
  <method class="X" name="create" args="$a1,$a2"/>

You'll know what I'm talking about --- do-notation. With a bunch of "bind" 
calls under the hood, it is equivalent as saying:
  a1 = bean "A1"
  a2 = bean "A2"
  method "X" "create" [a1,a2]

url: http://docs.codehaus.org/display/YAN/home

This is the only ioc container that uses Monad model in Java.

Just FYI. Any comment is welcome.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org//pipermail/haskell-cafe/attachments/20051209/93ed18bd/attachment.htm

More information about the Haskell-Cafe mailing list