Re: [Haskell] [Haskell-cafe] ANNOUNCE: ioctl 0.0.1

2015-09-13 Thread Alberto G. Corona
Did you managed to make it available for Windows?

2010-02-21 0:38 GMT+01:00 Maciej Piechotka :

> A package for type-safe I/O control. Currently only ioctl is supported.
>
> Currently simply a extract from my tuntap fork
>
> TODO:
> - Return the integer as well as structure (will break the API)
> - Port for Windows Network.Socket.IOCtl (as soon as I manage to setup
> some sane environment on this platform)
> - Wrapping around DeviceIoControl
>
> Example (in hsc):
> data NotRead = NotRead
> instance NotRead Int where
> ioctlReq _ = #const FIONREAD
>
> notRead s = ioctlsocket' s NotRead
>
> Regards
>
>
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>


-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


Re: [Haskell] [Haskell-cafe] [ANN]: the Helium compiler, version 1.8.1

2015-04-20 Thread Alberto G. Corona
Great!

How the type rules detailed in the "scripting the type inference engine"
paper are implemented?  it is possible to script the inference engine with
such rules? If so, are there some examples?

2015-04-20 10:36 GMT+02:00 Jurriaan Hage :

> Dear all,
>
> we have recently uploaded Helium 1.8.1, the novice friendly Haskell
> compiler, to Hackage.
>
> Improvements in this version
>  - Helium can again work together with our Java-based programming
> environment Hint.
>The jar file for Hint itself can be downloaded from the Helium website
> at:
>http://foswiki.cs.uu.nl/foswiki/Helium
>which also has some more documentation on how to use Hint and helium.
>  - the svn location if you are interested in the sources is now the
> correct one
>
>
> To install Helium simply type
>
> cabal install helium
> cabal install lvmrun
>
> Helium compiles with GHC 7.6.3 and 7.8.x, but does not yet compile with
> 7.10.
>
> Any questions and feedback are welcome at hel...@cs.uu.nl.
>
> best regards,
> The Helium Team
>
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
>



-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell


[Haskell] ANNOUNCE: hplayground: haskell client-side web framework

2014-07-25 Thread Alberto G. Corona
hplayground [1] is a haskell framework that compiles to JavaScript
with the haste [5] compiler.

It handles reactive effects  under a applicative-monad that controls
the modifications of the user interface.

It is quite easy to create dynamic, composable applications using
ordinary, beatiful, idiomatic haskell without special constructions.
Rather than a framework,  it is an EDSL.

Full reinversion of control avoid spagetty event handlers and the
monad confines the events and their effects to the subtree where they
appear avoiding the problems of declarative reactive frameworks.

There are examples running[4] the source code is in [1]

And there is a todo reference application [3]  running [2] too.

There is also a blog post about that[7]

Additionally, the syntax is almost identical to the formlet widgets in
MFlow[6]. So most of the hplaygroud code could run also in a server if
javascript is disabled. But MFlow and hplayground are completely
independent projects.

I hope that  you enjoy it as much as I enjoyed the development of it.

A big thanks to Anton Ekblad for his wonderful Haste compiler.

[1] https://github.com/agocorona/hplayground
[2] http://mflowdemo.herokuapp.com/todo.html
[3] https://github.com/agocorona/hplay-todo
[4] http://mflowdemo.herokuapp.com/noscript/wiki/browserwidgets
[5] http://http://haste-lang.org/
[6] http://hackage.haskell.org/package/MFlow
[7] 
http://haskell-web.blogspot.com.es/2014/07/hplayground-translate-your-console.html

-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: haste-perch

2014-06-18 Thread Alberto G. Corona
The readme in the Git repository tell more details

https://github.com/agocorona/haste-perch/blob/master/README.md

And also this blog post:

http://haskell-web.blogspot.com.es/2014/06/taming-html-dom-with-monads-and-monoids.html


2014-06-18 19:20 GMT+02:00 Alberto G. Corona :

> The syntax is similar to blaze-html, but haste-perch  uses the HTM-DOM in
> the browser to create DOM elements. blaze-html creates a html bytestring in
> the server that the browser must load.
>
> It uses Haste.DOM
>
>
> http://hackage.haskell.org/package/haste-compiler-0.2.99/docs/Haste-DOM.html
>
> Haste.DOM has primitives that invoke Javascript functions in browser like:
> For example newElem invoke  "createElement" in javascript
>
> Perch assemble a sequence of DOM calls that create the HTML tree directly
> in the browser. so you can create an application that run fully in the
> browser
>
> The tree can change depeding on different actions done by the user by
> changing the HTML tree dynamically. It is possible to create dynamic
> applications.
>
>
>
>
> 2014-06-18 18:11 GMT+02:00 Andrew Gibiansky :
>
> Could you elaborate on how this is better/different from blaze-html?
>>
>> I'm a bit confused - is it just the same thing but works with Haste,
>> while blaze-html doesn't? What's the main idea?
>>
>> Thanks!
>> Andrew
>>
>>
>> On Wed, Jun 18, 2014 at 7:02 AM, Alberto G. Corona 
>> wrote:
>>
>>> Hi,
>>>
>>> haste-perch defines builder elements (perchs) for Haste.DOM elements
>>> that are appendable, so that dynamic HTML can be created in the client in a
>>> natural way, like textual HTML, but programmatically and with the advantage
>>> of static type checking. It can be ported to other haskell-js compilers.
>>>
>>> http://hackage.haskell.org/package/haste-perch
>>>
>>> This program, when compiled with haste:
>>>
>>>   main= do
>>>withElem "idelem" $   build $ do
>>>div $ do
>>>  div $ do
>>>p "hello"
>>>p ! atr "style" "color:red" $   "world"
>>>
>>>return ()
>>>
>>> Creates these element:
>>>
>>>  <-- was already in the HTML
>>>
>>>  
>>>  hello 
>>>  world 
>>>  
>>>
>>>
>>>
>>> Since the creation is in the browser, that permit quite dynamic pages
>>> for data
>>> presentation, and interctive textual (a.k.a "serious") applications and,
>>> in general
>>> the development of client-side web frameworks using haskell with the
>>> haste compiler.
>>>
>>>
>>> See the README in the git repository:
>>>
>>> https://github.com/agocorona/haste-perch
>>>
>>> --
>>> Alberto.
>>>
>>> ___
>>> Haskell mailing list
>>> Haskell@haskell.org
>>> http://www.haskell.org/mailman/listinfo/haskell
>>>
>>>
>>
>
>
> --
> Alberto.
>



-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: haste-perch

2014-06-18 Thread Alberto G. Corona
The syntax is similar to blaze-html, but haste-perch  uses the HTM-DOM in
the browser to create DOM elements. blaze-html creates a html bytestring in
the server that the browser must load.

It uses Haste.DOM

http://hackage.haskell.org/package/haste-compiler-0.2.99/docs/Haste-DOM.html

Haste.DOM has primitives that invoke Javascript functions in browser like:
For example newElem invoke  "createElement" in javascript

Perch assemble a sequence of DOM calls that create the HTML tree directly
in the browser. so you can create an application that run fully in the
browser

The tree can change depeding on different actions done by the user by
changing the HTML tree dynamically. It is possible to create dynamic
applications.




2014-06-18 18:11 GMT+02:00 Andrew Gibiansky :

> Could you elaborate on how this is better/different from blaze-html?
>
> I'm a bit confused - is it just the same thing but works with Haste, while
> blaze-html doesn't? What's the main idea?
>
> Thanks!
> Andrew
>
>
> On Wed, Jun 18, 2014 at 7:02 AM, Alberto G. Corona 
> wrote:
>
>> Hi,
>>
>> haste-perch defines builder elements (perchs) for Haste.DOM elements that
>> are appendable, so that dynamic HTML can be created in the client in a
>> natural way, like textual HTML, but programmatically and with the advantage
>> of static type checking. It can be ported to other haskell-js compilers.
>>
>> http://hackage.haskell.org/package/haste-perch
>>
>> This program, when compiled with haste:
>>
>>   main= do
>>withElem "idelem" $   build $ do
>>div $ do
>>  div $ do
>>p "hello"
>>p ! atr "style" "color:red" $   "world"
>>
>>return ()
>>
>> Creates these element:
>>
>>  <-- was already in the HTML
>>
>>  
>>  hello 
>>  world 
>>  
>>
>>
>>
>> Since the creation is in the browser, that permit quite dynamic pages for
>> data
>> presentation, and interctive textual (a.k.a "serious") applications and,
>> in general
>> the development of client-side web frameworks using haskell with the
>> haste compiler.
>>
>>
>> See the README in the git repository:
>>
>> https://github.com/agocorona/haste-perch
>>
>> --
>> Alberto.
>>
>> ___
>> Haskell mailing list
>> Haskell@haskell.org
>> http://www.haskell.org/mailman/listinfo/haskell
>>
>>
>


-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: haste-perch

2014-06-18 Thread Alberto G. Corona
Hi,

haste-perch defines builder elements (perchs) for Haste.DOM elements that
are appendable, so that dynamic HTML can be created in the client in a
natural way, like textual HTML, but programmatically and with the advantage
of static type checking. It can be ported to other haskell-js compilers.

http://hackage.haskell.org/package/haste-perch

This program, when compiled with haste:

  main= do
   withElem "idelem" $   build $ do
   div $ do
 div $ do
   p "hello"
   p ! atr "style" "color:red" $   "world"

   return ()

Creates these element:

 <-- was already in the HTML
   
 
 hello 
 world 
 
   
   

Since the creation is in the browser, that permit quite dynamic pages for
data
presentation, and interctive textual (a.k.a "serious") applications and, in
general
the development of client-side web frameworks using haskell with the haste
compiler.


See the README in the git repository:

https://github.com/agocorona/haste-perch

--
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Monad.Reader #23 call for copy

2013-12-18 Thread Alberto G. Corona
Hi Edward:

I will send to you an updated copy of article about MFlow that I sent to
you for the past issue of TMR.
If you remember, we agreed to postpone it due to the quantity of material.
So I have priority now!.

Thanks




2013/12/18 Edward Z. Yang 

> Call for Copy: The Monad.Reader - Issue 23
> 
>
> Whether you're an established academic or have only just started
> learning Haskell, if you have something to say, please consider writing
> an article for The Monad.Reader!  The submission deadline for Issue 23
> will be:
>
> **Friday, January 17, 2014**
>
> The Monad.Reader
> 
>
> The Monad.Reader is a electronic magazine about all things Haskell. It
> is less formal than journal, but somehow more enduring than a wiki-
> page. There have been a wide variety of articles: exciting code
> fragments, intriguing puzzles, book reviews, tutorials, and even
> half-baked research ideas.
>
> Submission Details
> ~~
>
> Get in touch with me if you intend to submit something -- the sooner
> you let me know what you're up to, the better.
>
> Please submit articles for the next issue to me by e-mail (ezy...@mit.edu
> ).
>
> Articles should be written according to the guidelines available from
>
> http://themonadreader.wordpress.com/contributing/
>
> Please submit your article in PDF, together with any source files you
> used. The sources will be released together with the magazine under a
> BSD license.
>
> If you would like to submit an article, but have trouble with LaTeX
> please let me know and we'll work something out.
> ___
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>



-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Call for Contributions - Haskell Communities and Activities Report, November 2013 edition

2013-10-29 Thread Alberto G. Corona
Hi Janis: This is my report about MFlow:

MFlow is an innovative, Web framework of  the kind of other functional,
stateful frameworks like WASH(†) , Seaside Ocsigen or Racket. But MFlow
does not use continuation passing, but a backtracking monad that carries
out the synchronization of browser request and server process execution
state. This monad is on top of another "Workflow" monad that add effects of
logging and recovery of process/session state. Both are managed by an
application server that dispatch each request to the appropriate server
process. In case of timeout, the process is restarted using the state
recovering mechanism.

The logs generated are very small, so MFlow solves the problems of fat
serializaitions associated with stateful frameworks. Like the
continuation-based frameworks. MFlow invert back the inversion of control,
so, cotrary to MVC frameworks, programming multipage web application is
simple and natural.  At the same time MFlow is RESTful compliant. Not only
the URL use the REST style, but also any GET page in the stateful flow can
be pointed to with a REST URL.  That is unique for an stateful WF.

Additionally, besides, applicative formlets it also implement monadic
formlets by means of a page monad, that permits to dynamically change the
page content  and input fields depending on the  user input.  That is
called "page flows". Independent widgets can have its own flow within a
page.

HTML layout and text content can be added and modified later at runtime
using a wysiwyg tool, so there may be a complete separation of layout and
logic if wished.

Other features are widget autorefreshing in the page via implicit Ajax,
level-2 widgets (widgets that contain widgets), integration with
Persistent, integration of AWS.  JQuery integration, WAI integration.
blaze-html integration. push and complete execution traces for errors
(thanks to the backtracking monad).

MFlow has facilities for single page developments, that would need a lot of
 client side javascript has been packaged as composable haskell elements
that uses ajax internally to create dynamic interfaces that are type safe.

It may be considered the continuation of the great WASH framework.

More information:

There is a site, made using MFlow which includes demos at:

http://mflowdemo.herokuapp.com




2013/10/6 Janis Voigtlaender 

> [Transition in editorship of HCAR in progress!]
>
> Dear all,
>
> We would like to collect contributions for the 25th edition of the
>
> ==**==**
>  Haskell Communities & Activities Report
>
> http://www.haskell.org/**haskellwiki/Haskell_**Communities_and_Activities_
> **Report
>
> Submission deadline: 1 Nov 2013
>
>  (please send your contributions to hcar at haskell.org,
>  in plain text or LaTeX format)
> ==**==**
>
> This is the short story:
>
> * If you are working on any project that is in some way related
>   to Haskell, please write a short entry and submit it. Even if
>   the project is very small or unfinished or you think it is not
>   important enough --- please reconsider and submit an entry anyway!
>
> * If you are interested in an existing project related to Haskell that
>   has not previously been mentioned in the HCAR, please tell us, so
>   that we can contact the project leaders and ask them to submit an
>   entry.
>
> * Feel free to pass on this call for contributions to others that
>   might be interested.
>
> More detailed information:
>
> The Haskell Communities & Activities Report is a bi-annual overview of
> the state of Haskell as well as Haskell-related projects over the
> last, and possibly the upcoming six months. If you have only recently
> been exposed to Haskell, it might be a good idea to browse the
> previous edition --- you will find interesting projects described as
> well as several starting points and links that may provide answers to
> many questions.
>
> Contributions will be collected until the submission deadline. They
> will then be compiled into a coherent report that is published online
> as soon as it is ready. As always, this is a great opportunity to
> update your webpages, make new releases, announce or even start new
> projects, or to talk about developments you want every Haskeller to
> know about!
>
> Looking forward to your contributions,
>
> Mihai Maruseac and Janis Voigtlaender (for this edition)
>
>
> FAQ:
>
> Q: What format should I write in?
>
> A: The required format is a LaTeX source file, adhering to the template
> that is available at:
>
>  
> http://haskell.org/**communities/11-2013/template.**tex
>
> There is also a LaTeX style file at
>
>  
> http://haskell.org/**communities/11-2013/hcar.sty

Re: [Haskell] [Haskell-cafe] ANNOUNCE: MFlow 3.0

2013-07-13 Thread Alberto G. Corona
However, besides state synchronization is under development, state
persistence in MFlow is optional,  by using  the workflow monad instead of
the IO monad.  See for example this:

http://mflowdemo.herokuapp.com/shop



2013/7/10 Alberto G. Corona 

> My plan is to synchronize MFlow servers using cloud Haskell since the
> state serialization is small. I´m working on it.  However continuation
> based frameworks can not synchronize state.  There is "swarm" in scala that
> generate portable continuations but this is not used in the context of web
> application since the state in a continuation is big and can not be
> synchronized fast enough. In other languages these states are not even
> portable between machines.
>
>
> 2013/7/10 Alexander Kjeldaas 
>
>> Here are some common-lisp web frameworks using continuations:
>>
>> http://common-lisp.net/project/cl-weblocks/
>> http://common-lisp.net/project/ucw/features.html
>>
>> What always worried me with these frameworks is how they could be made
>> robust in case of failures.  Storing all state in a database backend often
>> makes it possible to isolate failures.  However, it seems to me that it is
>> be possible to solve this in Haskell where state can be serialized and
>> synchronized between multiple machines using Cloud Haskell, something that
>> is error-prone or impossible in other languages.  But that step has never
>> been taken.
>>
>> Alexander
>>
>>
>> On Wed, Jul 10, 2013 at 4:48 PM, Alberto G. Corona 
>> wrote:
>>
>>> Thanks Adrian. The racket people where pioneers in this idea I think.
>>>
>>> There is another web framework in Ocaml, Osigen that it is also
>>> continuation based. MFlow is not continuation-based but it also define the
>>> navigation as a sequence. But only Seaside (and now MFlow) supports many
>>> flows in the same page. See for example this:
>>>
>>> [PDF] *Seaside* – A *Multiple* Control *Flow* Web Application 
>>> Framework<http://www.google.es/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=3&cad=rja&ved=0CEwQFjAC&url=http%3A%2F%2Fscg.unibe.ch%2Farchive%2Fpapers%2FDuca04eSeaside.pdf&ei=WnPdUYHPI-Ly7Aaa0oHQDA&usg=AFQjCNFxwsFQc9QsQCNPRFfD4t6ReQtP5g&sig2=_klwtzxIKW5UzAOUDOvFCw>
>>>
>>> There is also other: Apache Coccoon that run in a special kind of
>>> JavaScript. The continuation-based frameworks have the reputation of
>>> storing a lot of application state and to be non  scalable. MFlow
>>> uses backtracking and It does not have these problems.
>>>
>>>
>>> 2013/7/10 Adrian May 
>>>
>>>> Oh how nice!
>>>>
>>>> I have been looking at MFlow a lot lately and I think it's got
>>>> something quite special that Yesod, Happstack, etc don't seem to have, at
>>>> least, not as far as I know. I mean, look at this:
>>>>
>>>> sumWidget= pageFlow "sum" $ do
>>>>
>>>>   n1 <- p << "Enter first number"  ++> getInt Nothing <** submitButton 
>>>> "enter" <++ br
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   n2 <- p << "Enter second number" ++> getInt Nothing <** submitButton 
>>>> "enter" <++ br
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   n3 <- p << "Enter third number"  ++> getInt Nothing <** submitButton 
>>>> "enter" <++ br
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   p <<  ("The result is: "++show (n1 + n2 + n3))  ++>  wlink () << b 
>>>> << " menu"
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>   <++ p << "you can change the numbers in the boxes to see how the 
>>>> result changes"
>>>>
>>>> Is that pretty or what? That's the code for this:
>>>>
>>>> http://mflowdemo.herokuapp.com/noscript/fviewmonad
>>>>
>>>> To me that's a real technological step over and above the usual
>>>> servlets paradigm and I'd love to see more people getting involved. It
>>>> seems like Yesod and Happstack have a lot more manpower behind them, but
>>>> unless I've missed something, MFlow is going some

Re: [Haskell] [Haskell-cafe] ANNOUNCE: MFlow 3.0

2013-07-13 Thread Alberto G. Corona
I factored out the submit buttons.

Now the three text boxes appear in succession above a unique button below.

http://mflowdemo.herokuapp.com/noscript/fviewmonad

This is the new code:

sumWidget=  pageFlow "sum" $ do

  n ←  (do
   n1 ←  p << "Enter first number"   ++> getInt Nothing <++ br
   n2 ←  p << "Enter second number" ++> getInt Nothing <++ br
   n3 ←  p << "Enter third number"  ++> getInt Nothing <++ br
   return (n1+ n2 + n3))

  <**  pageFlow "button" (submitButton "submit")

   p <<  ("The result is: "++show n)  ++>  wlink () << b << " menu"
   <++ p << "you can change the numbers in the boxes to see how the
result changes"




2013/7/10 Adrian May 

> Oh how nice!
>
> I have been looking at MFlow a lot lately and I think it's got something
> quite special that Yesod, Happstack, etc don't seem to have, at least, not
> as far as I know. I mean, look at this:
>
> sumWidget= pageFlow "sum" $ do
>
>   n1 <- p << "Enter first number"  ++> getInt Nothing <** submitButton 
> "enter" <++ br
>
>   n2 <- p << "Enter second number" ++> getInt Nothing <** submitButton 
> "enter" <++ br
>
>   n3 <- p << "Enter third number"  ++> getInt Nothing <** submitButton 
> "enter" <++ br
>
>   p <<  ("The result is: "++show (n1 + n2 + n3))  ++>  wlink () << b << " 
> menu"
>
>   <++ p << "you can change the numbers in the boxes to see how the result 
> changes"
>
> Is that pretty or what? That's the code for this:
>
> http://mflowdemo.herokuapp.com/noscript/fviewmonad
>
> To me that's a real technological step over and above the usual servlets
> paradigm and I'd love to see more people getting involved. It seems like
> Yesod and Happstack have a lot more manpower behind them, but unless I've
> missed something, MFlow is going somewhere new and should be helped along.
>
> Adrian.
>
> PS. Besides Seaside, Racket is playing with the same ideas. They (Jay
> McCarthy) have something to say about performance but I didn't quite
> understand it.
>
>
>
> On 10 July 2013 06:41, Alberto G. Corona  wrote:
>
>> The third version of MFlow is out.
>>
>> http://hackage.haskell.org/package/MFlow
>>
>> MFlow is an all-heterodox web application framework, but very haskellish.
>>
>> Now MFlow support restful URLs.  It is the first stateful web framework
>> to my knowledge that supports it. The type safe routes are implicitly
>> expressed as normal monadic code within a navigation monad. The application
>> look as a normal imperative console application, but the navigation monad
>> goes back and forth to match the path of the URL. The user has control of
>> the state, that can roll-back or not when the navigation goes back
>> depending on the application needs. The state is in the form of normal
>> Haskell variables In a monadic computation, with the weird addition of
>> backtracking.
>>
>> The menu of the application below is implemented as an imperative-like
>> syntax, but the application navigate forward and backward to synchronize
>> with the requests of the web browser:
>> http://mflowdemo.herokuapp.com/
>>
>> This version support  in-page flows.
>>  What is that? look at this example:
>>
>> http://mflowdemo.herokuapp.com/noscript/fviewmonad
>>
>> These flows are implemented as formlets with a monad instance, and
>> callbacks which change the look. I call them "widgets":
>>
>>
>> http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html
>>
>>
>> Each page may have many  of these active widgets, each one running their
>> own flow. These widgets refresh themselves trough Ajax if they are enclosed
>> in the primitive "autoRefresh". If there is no Ajax or JavaScript
>> available, they gracefully degrade by refreshing the entire page:
>>
>> http://mflowdemo.herokuapp.com/noscript/combination
>>
>>
>> http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html
>>
>> The page flows and the multiflow idea was inspired in 
>> Seaside<http://www.seaside.st/>,
>> a great Smalltalk web framework and adapted to the pure recursive nature of
>> Haskell and the formlets.
>>
>> It also support some J

Re: [Haskell] [Haskell-cafe] ANNOUNCE: MFlow 3.0

2013-07-10 Thread Alberto G. Corona
My plan is to synchronize MFlow servers using cloud Haskell since the state
serialization is small. I´m working on it.  However continuation based
frameworks can not synchronize state.  There is "swarm" in scala that
generate portable continuations but this is not used in the context of web
application since the state in a continuation is big and can not be
synchronized fast enough. In other languages these states are not even
portable between machines.


2013/7/10 Alexander Kjeldaas 

> Here are some common-lisp web frameworks using continuations:
>
> http://common-lisp.net/project/cl-weblocks/
> http://common-lisp.net/project/ucw/features.html
>
> What always worried me with these frameworks is how they could be made
> robust in case of failures.  Storing all state in a database backend often
> makes it possible to isolate failures.  However, it seems to me that it is
> be possible to solve this in Haskell where state can be serialized and
> synchronized between multiple machines using Cloud Haskell, something that
> is error-prone or impossible in other languages.  But that step has never
> been taken.
>
> Alexander
>
>
> On Wed, Jul 10, 2013 at 4:48 PM, Alberto G. Corona wrote:
>
>> Thanks Adrian. The racket people where pioneers in this idea I think.
>>
>> There is another web framework in Ocaml, Osigen that it is also
>> continuation based. MFlow is not continuation-based but it also define the
>> navigation as a sequence. But only Seaside (and now MFlow) supports many
>> flows in the same page. See for example this:
>>
>> [PDF] *Seaside* – A *Multiple* Control *Flow* Web Application 
>> Framework<http://www.google.es/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=3&cad=rja&ved=0CEwQFjAC&url=http%3A%2F%2Fscg.unibe.ch%2Farchive%2Fpapers%2FDuca04eSeaside.pdf&ei=WnPdUYHPI-Ly7Aaa0oHQDA&usg=AFQjCNFxwsFQc9QsQCNPRFfD4t6ReQtP5g&sig2=_klwtzxIKW5UzAOUDOvFCw>
>>
>> There is also other: Apache Coccoon that run in a special kind of
>> JavaScript. The continuation-based frameworks have the reputation of
>> storing a lot of application state and to be non  scalable. MFlow
>> uses backtracking and It does not have these problems.
>>
>>
>> 2013/7/10 Adrian May 
>>
>>> Oh how nice!
>>>
>>> I have been looking at MFlow a lot lately and I think it's got something
>>> quite special that Yesod, Happstack, etc don't seem to have, at least, not
>>> as far as I know. I mean, look at this:
>>>
>>> sumWidget= pageFlow "sum" $ do
>>>
>>>   n1 <- p << "Enter first number"  ++> getInt Nothing <** submitButton 
>>> "enter" <++ br
>>>
>>>
>>>
>>>
>>>
>>>   n2 <- p << "Enter second number" ++> getInt Nothing <** submitButton 
>>> "enter" <++ br
>>>
>>>
>>>
>>>
>>>
>>>   n3 <- p << "Enter third number"  ++> getInt Nothing <** submitButton 
>>> "enter" <++ br
>>>
>>>
>>>
>>>
>>>
>>>   p <<  ("The result is: "++show (n1 + n2 + n3))  ++>  wlink () << b << 
>>> " menu"
>>>
>>>
>>>
>>>
>>>
>>>   <++ p << "you can change the numbers in the boxes to see how the 
>>> result changes"
>>>
>>> Is that pretty or what? That's the code for this:
>>>
>>> http://mflowdemo.herokuapp.com/noscript/fviewmonad
>>>
>>> To me that's a real technological step over and above the usual servlets
>>> paradigm and I'd love to see more people getting involved. It seems like
>>> Yesod and Happstack have a lot more manpower behind them, but unless I've
>>> missed something, MFlow is going somewhere new and should be helped along.
>>>
>>> Adrian.
>>>
>>> PS. Besides Seaside, Racket is playing with the same ideas. They (Jay
>>> McCarthy) have something to say about performance but I didn't quite
>>> understand it.
>>>
>>>
>>>
>>> On 10 July 2013 06:41, Alberto G. Corona  wrote:
>>>
>>>> The third version of MFlow is out.
>>>>
>>>> http://hackage.haskell.org/package/MFlow
>>>>
>>>> MFlow is an all-heterodox web application framework, but very
>>>> haskellish.
>>>>
>>>> Now MFlow support restful URLs.

Re: [Haskell] [Haskell-cafe] ANNOUNCE: MFlow 3.0

2013-07-10 Thread Alberto G. Corona
Thanks Adrian. The racket people where pioneers in this idea I think.

There is another web framework in Ocaml, Osigen that it is also
continuation based. MFlow is not continuation-based but it also define the
navigation as a sequence. But only Seaside (and now MFlow) supports many
flows in the same page. See for example this:

[PDF] *Seaside* – A *Multiple* Control *Flow* Web Application
Framework<http://www.google.es/url?sa=t&rct=j&q=&esrc=s&frm=1&source=web&cd=3&cad=rja&ved=0CEwQFjAC&url=http%3A%2F%2Fscg.unibe.ch%2Farchive%2Fpapers%2FDuca04eSeaside.pdf&ei=WnPdUYHPI-Ly7Aaa0oHQDA&usg=AFQjCNFxwsFQc9QsQCNPRFfD4t6ReQtP5g&sig2=_klwtzxIKW5UzAOUDOvFCw>

There is also other: Apache Coccoon that run in a special kind of
JavaScript. The continuation-based frameworks have the reputation of
storing a lot of application state and to be non  scalable. MFlow
uses backtracking and It does not have these problems.


2013/7/10 Adrian May 

> Oh how nice!
>
> I have been looking at MFlow a lot lately and I think it's got something
> quite special that Yesod, Happstack, etc don't seem to have, at least, not
> as far as I know. I mean, look at this:
>
> sumWidget= pageFlow "sum" $ do
>
>   n1 <- p << "Enter first number"  ++> getInt Nothing <** submitButton 
> "enter" <++ br
>
>   n2 <- p << "Enter second number" ++> getInt Nothing <** submitButton 
> "enter" <++ br
>
>   n3 <- p << "Enter third number"  ++> getInt Nothing <** submitButton 
> "enter" <++ br
>
>   p <<  ("The result is: "++show (n1 + n2 + n3))  ++>  wlink () << b << " 
> menu"
>
>   <++ p << "you can change the numbers in the boxes to see how the result 
> changes"
>
> Is that pretty or what? That's the code for this:
>
> http://mflowdemo.herokuapp.com/noscript/fviewmonad
>
> To me that's a real technological step over and above the usual servlets
> paradigm and I'd love to see more people getting involved. It seems like
> Yesod and Happstack have a lot more manpower behind them, but unless I've
> missed something, MFlow is going somewhere new and should be helped along.
>
> Adrian.
>
> PS. Besides Seaside, Racket is playing with the same ideas. They (Jay
> McCarthy) have something to say about performance but I didn't quite
> understand it.
>
>
>
> On 10 July 2013 06:41, Alberto G. Corona  wrote:
>
>> The third version of MFlow is out.
>>
>> http://hackage.haskell.org/package/MFlow
>>
>> MFlow is an all-heterodox web application framework, but very haskellish.
>>
>> Now MFlow support restful URLs.  It is the first stateful web framework
>> to my knowledge that supports it. The type safe routes are implicitly
>> expressed as normal monadic code within a navigation monad. The application
>> look as a normal imperative console application, but the navigation monad
>> goes back and forth to match the path of the URL. The user has control of
>> the state, that can roll-back or not when the navigation goes back
>> depending on the application needs. The state is in the form of normal
>> Haskell variables In a monadic computation, with the weird addition of
>> backtracking.
>>
>> The menu of the application below is implemented as an imperative-like
>> syntax, but the application navigate forward and backward to synchronize
>> with the requests of the web browser:
>> http://mflowdemo.herokuapp.com/
>>
>> This version support  in-page flows.
>>  What is that? look at this example:
>>
>> http://mflowdemo.herokuapp.com/noscript/fviewmonad
>>
>> These flows are implemented as formlets with a monad instance, and
>> callbacks which change the look. I call them "widgets":
>>
>>
>> http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html
>>
>>
>> Each page may have many  of these active widgets, each one running their
>> own flow. These widgets refresh themselves trough Ajax if they are enclosed
>> in the primitive "autoRefresh". If there is no Ajax or JavaScript
>> available, they gracefully degrade by refreshing the entire page:
>>
>> http://mflowdemo.herokuapp.com/noscript/combination
>>
>>
>> http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html
>>
>> The page flows and the multiflow idea was inspired in 
>> Seaside<http://www.seaside.st/>,
>> a great Smalltalk web framework and adapted to the pure re

[Haskell] ANNOUNCE: MFlow 3.0

2013-07-09 Thread Alberto G. Corona
The third version of MFlow is out.

http://hackage.haskell.org/package/MFlow

MFlow is an all-heterodox web application framework, but very haskellish.

Now MFlow support restful URLs.  It is the first stateful web framework to
my knowledge that supports it. The type safe routes are implicitly
expressed as normal monadic code within a navigation monad. The application
look as a normal imperative console application, but the navigation monad
goes back and forth to match the path of the URL. The user has control of
the state, that can roll-back or not when the navigation goes back
depending on the application needs. The state is in the form of normal
Haskell variables In a monadic computation, with the weird addition of
backtracking.

The menu of the application below is implemented as an imperative-like
syntax, but the application navigate forward and backward to synchronize
with the requests of the web browser:
http://mflowdemo.herokuapp.com/

This version support  in-page flows.
 What is that? look at this example:

http://mflowdemo.herokuapp.com/noscript/fviewmonad

These flows are implemented as formlets with a monad instance, and
callbacks which change the look. I call them "widgets":

http://haskell-web.blogspot.com.es/2013/06/the-promising-land-of-monadic-formlets.html


Each page may have many  of these active widgets, each one running their
own flow. These widgets refresh themselves trough Ajax if they are enclosed
in the primitive "autoRefresh". If there is no Ajax or JavaScript
available, they gracefully degrade by refreshing the entire page:

http://mflowdemo.herokuapp.com/noscript/combination

http://haskell-web.blogspot.com.es/2013/06/and-finally-widget-auto-refreshing.html

The page flows and the multiflow idea was inspired in
Seaside,
a great Smalltalk web framework and adapted to the pure recursive nature of
Haskell and the formlets.

It also support some JQuery widgets integrated: modal and not modal
dialogs, datePicker and other active widgets that handle other widgets.

It also support the older features: persistent state, WAI, blaze-html and
others integration, server process timeouts, Ajax, requirements,
 content management, caching of widget rendering and all the other previous
stuff.

I wish to thank some people for their feedback. Specially Adrian May for
his feedback and interest


-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] [Haskell-cafe] ANNOUNCE: btree-concurrent

2012-10-30 Thread Alberto G. Corona
Hi.
That´s fine. I missed an implementation of a  persistent b-tree in haskell.
I planned to do my own, but it is not trivial task.

how the IO and STM is managed? . The serialization- deserialization is
automatic  or programmer must write the cached blocks?  (i suppose that the
block reads are automatic on data requests).

The state in the disk is coherent at every moment?. I mean, if there is a
program failure, the state in the btree in the file would be coherent?

For example, if I write two TVars in two different blocks within the same
STM transaction, do I have the guarantee that either both updated values
will be in the file storage or none of them  will be?


Alberto


2012/10/30 Johan Brinch 

> Greetings Haskellers,
>
> We are pleased to announce this new package, featuring a concurrent
> b-tree developed as part of our master's thesis on backup systems. The
> package features code related to STM, caching, QuickCheck and of
> course concurrency and parallelism.
>
> And it's also on Hackage:
> http://hackage.haskell.org/package/btree-concurrent
>
> In case the build fails on Hackage and the documentation doesn't work,
> it's also available here:
> http://hindsight.dk/doc/html/btree-concurrent
>
>
> Credits to Thomas Conway of Melbourne University, for discussions
> related to the implementation, and to our supervisor Ken Friis Larsen
> of University of Copenhagen.
>
>
> And now, the description of the package:
> =
>
> A backend agnostic, concurrent BTree with relaxed balance[1] written
> in Haskell using a mix of IO operations and pure STM.
>
> Although the code does work, it is neither production-ready nor complete.
>
> Features include:
> * Caching: While nodes are periodically saved on persistent storage
> (e.g. disk) they are cached in-memory during operations.
>
> * Live flushing: It is possible to save the current version of the
> tree to disk and run modifying operations at the same time. The nodes
> are updated buttom-up to ensure a valid tree in the case of a crash.
>
> * Backend agnosticism: A simple API is used as an abstraction for the
> persistent storage.
>
> * Verification: The test-suite uses QuickCheck to compare the trees
> behaviour to that of Data.Map.
>
> Deficients include:
> * Memory greedy. Nodes are not stored in a compact fashion and are
> constantly being serialised/deserialised.
>
> * findMin and findMax are incomplete and may fail (see the TODO for
> details).
>
> * The implementation does not parallelise well.
>
>
> [1] B-trees with relaxed balance, K. S. Larsen & R. Fagerberg,
> Parallel Processing Symposium, 1995. Proceedings., 9th International
>
> --
> Johan Brinch & Morten Brøns-Pedersen
>
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>



-- 
Alberto.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: MFlow-0.1.5

2012-09-18 Thread Alberto G. Corona
Hi haskellers and specially the web developers.

http://hackage.haskell.org/package/MFlow-0.1.5.3

MFlow is a is a Web framework with some unique, and I mean unique,
characteristics that I find exciting:

- It is a Web application server that start and restart on-demand
stateful web server processes (not request.-response)
  This means that all the page navigation can be coded in a single
procedure. This increases readability of the programmer code. I woul
call it
a anti-node.js.  Buit usual request-response (stateless) server
processes are also allowed

- When the process is invoqued as result of an URL request, the Web
app server not only restart the process but also recover its execution
state. The enclosing Workflow monad provides the thread state
persistence. There are state timeouts and process timeouts defined by
the programmer. Processes with no persistent state (transient) are
possible.

-The user interface is made of widgets. They are  formlets with added
formatting,   attributes, validations, modifiers and callbacks, that
are composable, so the pieces are reusable and return type safe
responses to the calling process. Even the links are part of widgets
and return back type safe inputs at compile time to the calling server
process. Tho glue these components, ordinary applicative combinators
and other extra combinators are used.

- The widgets and the communication don´t make assumptions about the
architecture, so it can be adapted to non-web environments. This
versions has interface for WAI-warp, Hack, Text.XHtml (xhtml) , and
Haskell Server Pages.

-The widget rendering can be converted to ByteStrings automatically
with special combinators. A mix of widgets with different formats can
be combined in the same source file. For example Text.Html and HSP
(Haskell server pages)

-These widgets can be cached, to avoid widget rendering on every interaction.

-To handle the back button, and because the processes are stateful,
they can run backwards until the response match. This is transparent
for the programmer, thanks to the embedded FlowM monad.

-All the code is in pure Haskell. No deployment, special scripts,
formats etc are necessary.

-Besides automatic state persistence, TCache provides transactions and
user data persistence, that can be configured for SQL databases.
Default persistence in files permit very rapid prototyping. Just code
and run it with runghc.

-Has AJAX support

All of this sounds very complicated, but really it is simple!. Most of
these things are transparent. The resulting code is quite readable and
has very little plumbing!

There is a non trivial example that some of these functionalities
embedded here that you can run:

 
http://hackage.haskell.org/packages/archive/MFlow/0.1.5.3/doc/html/MFlow-Forms.html

Take a look and tell me your opinion.  I hope that you find it as
exciting as me.

 I´m looking for people  to collaborate in the development of MFlow.

Although still it is experimental, it is being used in at least one
future commercial project. So I have te commitment to continue its
development. There are many examples in the documentation and in the
package.

Alberto

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: Workflow-0.5.8.0

2011-12-09 Thread Alberto G. Corona
This is A new version of the package workflow.   I probably will
change the name of this package since it is  too generic.

A workflow can be seen as a persistent thread that executes a monadic
computation. Therefore, it can be used in very time consuming
computations such are CPU intensive calculations with intermediate
results or with  procedures that are most of the time waiting for the
response of a process or an user, that are prone to comunication
failures, timeouts or shutdowns.

Workflow has a   operation, called "step" that lift the monadic
computation to the Workflow monad. This bring services of transparent
state loogging, so that the computation can be restarted at the point
of stop/failure.  Additionally , the package has persistent queues,
persistent data collections, and persistent timeouts (whit which the
workflow can wait for days, months or even years, more than the
average time between failures). This is important for programming
office workflow or in election processes where the user has a limited
time to decide/vote.

This version has many improvements: it admits Data.Binary
serialization for logging (besides RefSerialize of previous versions).
. It also has  an EDSL of high level monadic combinators that
represent workflow patterns. For example, split, merge,
synchronization, votation etc.

There are examples in the online documentation and some demos in the package.

My motivation for developping Workflow is to use it in a project for
electronic democracy in the Web. If anyone is interested in the
package Workflow and/or electronic democracy, I will be happy to talk
with him.

Hope to be useful

Alberto.

___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: TCache 0.8

2011-04-12 Thread Alberto G. Corona
Tired of your persistence layer?

Take persistence the haskelll way. Besides the backward compatible stuff,
TCache now defines persistent STM variables (DBRef's) that  leverages the
traditional haskell reference syntax to perform fast in-memory database
transactions and inter-object references. It includes indexing, triggers and
an straightforward pure-haskell query language based on record field
relations.

http://hackage.haskell.org/package/TCache-0.8.0.2

This version includes a lot of changes and must be considered beta. Please
submit any bugs, comments and so on.

Cheers!
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Fwd: [Haskell-cafe] Question about memory usage

2010-08-16 Thread Alberto G. Corona
It is not repeated because fiblist is pure and has no arguments. Otherwise
it would be repeated.



2010/8/14 Tako Schotanus 

> I was reading this article:
>
> http://scienceblogs.com/goodmath/2009/11/writing_basic_functions_in_has.php
>
> And came to the part where it shows:
>
>
> > fiblist = 0 : 1 : (zipWith (+) fiblist (tail fiblist))
>
>
> Very interesting stuff for somebody who comes from an imperative world of
> course.
> But then I read that "Once it's been referenced, then the list up to where
> you looked is concrete - the computations *won't* be repeated."
> and I started wondering how that works.
> Because this seems to mean that functions could have unknown (to the
> caller) memory requirements.
> How does one, programming in Haskell, keep that in check?
> And when does that memory get reclaimed?
>
> Cheers,
> -Tako
>
> ___
> Haskell-Cafe mailing list
> haskell-c...@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] Announce: Properties-0.0.2

2010-06-13 Thread Alberto G. Corona
http://hackage.haskell.org/package/properties-0.0.2

 Properties can
use QuickCheck properties in the same way than assertions are used,
for causal debugging of real programs. It also add an human readable
structure for grouping properties for classes or libraries. The
properties can then be tested in the instance´s body or in programs as
if they were assertions. The main advantage is that the compliance of
properties can be done with the complete data range that the real
application generates (hopefully, with an pleasant separation of real
code and debug code).

This is a simple example:


stringProperty= [Property

"length" (\(x, y)-> length (x++y)== length x + length y)]


main= do
let s=  "hello "
let s2= "world"
print $ s++ s2 `verify
`
stringProperty `with
`(s,s2)
print "that's all!"

It is possible to check quickCheck style properties.

 The same example with a quickCheck-style property:

quickCheckProperty x y=  length (x++y)== length x + length y

main= do
let s=  "hello "
let s2= "world"
print $ s++ s2   `verify
`
[Property "stringSumLength" $ uncurry quickCheckProperty] `with
`(s,s2)
print "that's all!"


The package include a more sophisticated example.

I Hope that this would be useful


Alberto
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE IDynamic-0.1

2009-10-16 Thread Alberto G. Corona
IDynamic is  variant of Data.Dynamic that can be indexed, serialized.,
stored, transmitted trough communications etc. So it can be used in abstract
data containers, persistence, communications etc.
http://hackage.haskell.org/package/IDynamic


I Just uploaded it, so the documentation has not been created by Hackage.
However I uincluded an example in the pachage.

{-# OPTIONS -XTypeSynonymInstances #-}
module Main where
import Data.IResource
import Data.IDynamic
import Data.Typeable

instance IResource Int where
   keyResource x=  "I"
   serialize = show
   deserialize = read
   defPath _= "saved/"

instance IResource String where
   keyResource x=  take 5 x
   serialize = show
   deserialize = read
   defPath _= "saved/"


main= do
  putStrLn "see the code to know the meaning of he results"
  registerType :: IO Int   -- register both datatypes
(Int, and String)
  registerType :: IO String

  let x= 1 :: Int
  let list= [IDynamic x, IDynamic "hello, how are you"]
--typical Dynamic usage
  let assoc= zip (map keyResource list) list

  print $ lookup (keyResource (5 ::Int)) assoc   -- lookup a
IDynamic object from a container and show it

  mapM writeResource list
  mds ←   readResource $  IDynamic  "hello"   -- save both
objects
  case mds of
Nothing →  error "must have been Just!"   --why?
Just ds →  do
 putStrLn $ serialize ds
-- serialize the dynamic object and print it
 let str= fromIDyn  ds ::   String   --
casting
 putStrLn str
   -- print the string read

 let y=  fromIDyn  ds ::   Int   -- casting
error
 print y
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANN: Workflow-0.5.5, TCache-0.6.4 RefSerialize-0.2.4

2009-09-24 Thread Alberto G. Corona
Hi

I'm proud to announce Workflow 0.5.5. This is a package intended to define
workflows as sequences of actions with he usual do notation. Such actions
may include wait for events, queue messages, etc perform processing etc for
days weeks or even years without regards for shutdowns and restarts.

Technically, Workflow includes a monad transformer that encapsulates any
computation in a state monad that bring  automatic state logging and
recovery.  A workflow can be viewed as a thread that persist across planeed
or unplanned application shutdowns.  When recovering the excution is resumed
at the last action that was logged. The process continues at the same state
as if not interruption took place.

Any feedback will be appreciated.

Besides state logging and recovery, there are a number of communication
primitives that are aware of persistence across reinitiations such are
persistent queues, persistent timeouts, or wait for events in the STM monad.
These primitives permits inter-woikflow communications and communications
with external threads. I hope that this package would be useful for very
long computations, either the programs that are CPU intensive and produce
valuable intermediate data or  programs that wait for actions from users and
others processes during days or weeks. That is typical in web applications.
 Such programs can be defined in a single monadic procedure transparently,
without regards of saving intermediate results or reinitiations at the
correct point.

This new version is not restricted to handle a single type. Every
intermediate data must be an instance of Read and Show. For complex data
types,  other persistence mechanisms can be used (see documentation).

The package is at:

http://hackage.haskell.org/package/Workflow
http://hackage.haskell.org/packages/archive/Workflow/0.5.5/Workflow-0.5.5.tar.gz


The tar archive has the documentation and some examples. Among them, a
simulation of workflow for the creation and approval of documents, with two
levels of approval and approval timeouts, It uses most of  the features of
the package.

NOTE: cabal install reports Tar checksum errors when installed, however,
such errors do not appear by downloading the tar.gz archive and
decompressing it with the unix or windows tools. I do not know why cabal
install behaves as such.


Here is a simple example: This is a counter that shows a sequence of
numbers, one a second:

*module Main where
import Control.Concurrent(threadDelay)
import System.IO (hFlush,stdout)

count n= do
   putStr (show n ++ " " ) >> hFlush stdout >> threadDelay
100
   count (n+1)

main= count 0
*
This is the same program, with the added feature of remembering the last
count after interruption (sequence.hs):

*module Main where
import Control.Workflow
import Control.Concurrent(threadDelay)
import System.IO (hFlush,stdout)

mcount n= do
   step $  putStr (show n ++ " " ) >> hFlush stdout >> threadDelay
100
   mcount (n+1)

main= do
  registerType :: IO ()
  registerType :: IO Int
  let start= 0 :: Int
  startWF  "count"  start   [("count", mcount)] :: IO ()
*
This is the execution log:

*Worflow-0.5.5demos>runghc sequence.hs
0 1 2 3 4 5 6 7 sequence.hs: win32ConsoleHandler
sequence.hs: sequence.hs: interrupted
Worflow-0.5.5demos>
Worflow-0.5.5demos>runghc sequence.hs
7 8 9 10 11 
*


This package uses TCache and RefSerialize.   I also uploaded new versions of
these packages with extensive documentation and examplles included in the
tar.gz archives ( cabal install also repor checksum errors, but are OK when
downloading and installing by hand):

http://hackage.haskell.org/package/TCache

http://hackage.haskell.org/packages/archive/TCache/0.6.4/TCache-0.6.4.tar.gz


http://hackage.haskell.org/package/RefSerialize

http://hackage.haskell.org/packages/archive/RefSerialize/0.2.4/RefSerialize-0.2.4.tar.gz
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: jhc 0.6.1

2009-06-24 Thread Alberto G. Corona
One question that is not clear in the documentation:Is JHC just a Haskell 98
compiler? Has some extensions?

2009/6/23 John Meacham 

>
> Hi, this is to announce the release of jhc 0.6.1. The jhc homepage with
> distribution information is at http://repetae.net/computer/jhc/
>
> The main new feature in this release is a much simplified
> cross-compilation mechanism. While cross-compilation was always possible
> with jhc, it used to involve manually copying the C file and calling gcc
> with the right options on it, now this is taken care of by jhc.
>
> A (popular) example would be setting up an iPhone cross compilation
> target. For instance with the SDK setup I have, I would simply add the
> following to a file ~/.jhc/targets.ini
>
>[iphone]
>cc=arm-apple-darwin
>cflags+=-I/usr/local/arm-apple-darwin/include
>merge=le32
>
> then you can compile iphone binaries with
>
>; jhc --cross -miphone HelloWorld.hs
>
> the targets mechanism is extensible at run-time and I have included
> native unix, win32, osx-intel and osx-powerpc targets. But certainly
> many more interesting ones are possible. Some I have tested have been a
> nokia N770 as a target and an atheros MIPS based router running dd-wrt.
>
>
> There is more information on cross compilation in the jhc manual at
> http://repetae.net/computer/jhc/manual.html#crosscompilation
>
> jhc is also now available in the repetae yum repository which you can
> get at via
>
>; rpm -i http://repetae.net/yum/repetae-repo-1.0-3.noarch.rpm
>; yum install jhc
>
>
> Enjoy!
>
>John
>
> --
> John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
> ___
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: jhc 0.6.0 Haskell Compiler

2009-03-19 Thread Alberto G. Corona
The last version still uses a region inference algoritm instead of a garbage
collector?.

2009/3/17 John Meacham 

> Hi, I am pleased to announce jhc 0.6.0, It has been a long time since an
> official release, so there have been a lot of changes. Jhc is an
> optimizing haskell compiler that focuses on creating fast and portable
> code. Jhc is still mainly of interest to jhc hackers and developers than
> the general haskell public, but it is starting to see use in embedded
> development with haskell so I decided to make more public announcements
> of major releases in the future.
>
> some links:
>
> The jhc homepage:
> http://repetae.net/computer/jhc/
>
> Installation Instructions:
> http://repetae.net/computer/jhc/building.shtml
>
> The jhc manual:
> http://repetae.net/computer/jhc/manual.html
>
> And I am happy to announce, there is now a yum repository*  for jhc and my
> other projects (such as DrIFT), so if you use an rpm based linux
> distribution, you can keep up to date with jhc official releases by
> doing:
>
>; rpm -i  http://repetae.net/yum/repetae-repo-1.0-3.noarch.rpm
>; yum install jhc
>
>
> A couple recent changes:
>
> jhc now comes bundled with the 'containers' and 'applicative' library
> making it much easier to compile many haskell programs out there.
> (Data.Graph, Data.IntMap, Data.IntSet, Data.Map, Data.Sequence,
> Data.Set, Data.Tree, Control.Applicative, Control.Arrow,
> Control.Category, Data.Foldable, Data.Traversable)
>
> signifigant speed and resource usage improvements in compilation time.
>
> transparent cross compilation support for creating windows programs on a
> unix box. (or iPhone/Nokia Tablet/etc..)
>
>
> If you are interested in jhc development, please sign up on the jhc
> mailing list here: http://www.haskell.org/mailman/listinfo/jhc
>
>John
>
> * I would love to get proper 'deb's and BSD packages built also
>  automatically, if anyone wants to help with this, please join the list
>  and let us know.
>
>
> --
> John Meacham - ⑆repetae.net⑆john⑈
> ___
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: Data.TCache 0.5.5

2009-01-09 Thread Alberto G. Corona
The main addition of this versión is the capablity to safely
handle transact, and serialize to permanent storage many datatypes
simultaneously in the same piece of code and incrementally.

Just register each new datatype (with registerType :: ). So it is not
necessary to glue all types in advance in a single algebraic datatype. I
suppose taht "enhanced composablility" applies to this feature.

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/TCache

In this release:
   Added a Data.TCache.Dynamic.  (SEE dynamicsample.hs)
 - Can handle, transact, and serialize to disk many datatypes
simultaneously and incrementally
 - Dynamic uses the same interface than TCache and add
*DResource(s) calls for handling many
   datatypes simultaneously
 - Safe dynamic data handling trough a lighter, indexable and
serializable version of Data.Dynamic
 - Added KEY object for retrieving any object of any type.


Data.Tcache is a transactional cache with configurable persistence.
It tries to simulate Hibernate
for Java or Rails for Ruby. The main difference is that transactions
are done in memory trough STM.
There are transactional cache implementations for some J2EE servers
like JBOSS.

TCache uses STM. It can  atomically apply a function to a list of
cached objects. The resulting
objects go back to the cache (withResources). It also can retrieve
these objects (getResources).
Persistence can be syncronous (syncCache)  or asyncronous, wtih
configurable time between cache
writes and configurable cache clearance strategy. the size of the
cache can be configured too .
All of this can be done trough clearSyncCacheProc. Even the TVar
variables can be accessed
directly (getTVar) to acceess all the semantic of atomic blocks
while maintaining the persistence of the
TVar updates.

Persistence can be defined for each object: Each object must have a
defined key, a default filename
path (if applicable). Persistence is pre-defined in files, but the
readResource writeResource and
delResource methods can be redefined to persist in databases or
whatever.

There are  Samples in the package that explain the main features.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] announce: Workflow-0.1

2008-11-11 Thread Alberto G. Corona
I needed to to define multiuser web workflows in the most transparent way. I
wondered if a state monad could transparently bring automatic checkpointing
of each action and automatic resume after failure. In this way a long living
computation could be expressed in a single monadic computation.

Additionally,  for inter process communications,  this package  includes a
primitive for  activating a workflow whenever any action result meet certain
condition. There are also primitives for start/restart processes,  retrieval
of intermediate results and unsafe IO actions inside the state monad...

http://hackage.haskell.org/cgi-bin/hackage-scripts/package/Workflow


Cabal description:

Transparent low level support (state logging, resume of the computation,
wait for data condition) for long living, event driven processes.

 Workflow give the two first services to any monadic computation of type
(a-> m a) usually m=IO

f x >>=\x'-> g x' >>= \x''->... z

by prefixing the user with the method "step":

step f x >>= \x'-> step g x' >>= \x''->...

This means that a workflow can be described with the familiar "do" notation.
In principle, there is no other limitation on the syntax but the restriction
(a -> m a): All computations consume and produce the same type of data. do
notation is supported fully.




Workflow export a few primitives that bring the following services:

- transparent checkpointing of each step in permanent storage using TCache
(step)
- resume of the monadic computation at the last checkpoint after soft or
hard interruption
- use of versioning techniques for storing object changes (using
RefSerialize)
- retrieval of the object at any previous step
- suspend the computation (waitFor) until the input object meet certain
conditions. useful for inter-workflow comunications.


At the end of the workflow all the intermediate data is erased. see demos
and the header of Control.TCache for documentation.


This is a piece of code is a loop that imput numbers (demo.hs). there is
another process, that check the numbers entered and return Finish when match
the desired number. that is detected by this thread and finalize. When
number of tries are 9, The process finish, this is detected by the other
process and finalizes also.
That ilustrates the use of event handling (waitFor) and step execution.


askNumbers name d = do
  step2 $  threadDelay 5000   --
wait for the other tread to process.

  r <- step (waitFor anything) d   --
get the last value of the object with key "try-finish", to look for the
other thread actions
  case r of

   Finish msg ->  step2 $ print
msg   --the
other thread sent a finalize response

   Try 9 num  ->  step1 $ return $ Finish  "sorry, no more
guesses" --send finalization to the wait thread

   _ -> do
 nd <- step  (askNumber name) d
 askNumbers name nd
  where
  anything= \_-> True
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: RefSerialize-0.2.1

2008-11-03 Thread Alberto G. Corona
actualized to  0.2.3 due to some errors in the cabal description. Sorry,
some needed module was not exported.

2008/11/2 Alberto G. Corona <[EMAIL PROTECTED]>

> I uploadad 
> RefSerialize<http://hackage.haskell.org/cgi-bin/hackage-scripts/package/RefSerialize>
> to  Hackage .
>
> Read, Show and Data.Binary do not check for repeated references to the same
> data address. As a result, the data is serialized multiple times when
> serialized. This is a waste of space in the filesystem  and  also a waste of
> serialization time. but the worst consequence is that, when the serialized
> data is read, it allocates multiple copies in memory for the same object
> referenced multiple times. Because multiple referenced data is very typical
> in a pure language such is Haskell, this means that the resulting data loose
> the beatiful economy of space and processing time that referential
> transparency permits.
>
> This package allows the serialization and deserialization of large data
> structures without duplication of data, with
> the result of optimized performance and memory usage. It is also useful for
> debugging purposes.
>
> There are automatic derived instances for instances of Read/Show, lists and
> strings. the deserializer contains a almos complete set of Parsec.Token
> parsers for deserialization.
>
>  Every instance of Show/Read is also a instance of Data.RefSerialize
>
>  The serialized string has the form "expr( var1, ...varn) where
> var1=value1,..valn=valueN " so that the
> string can ve EVALuated.
>
>  See demo.hs and tutorial. I presumably will add a entry in
> haskell-web.blogspot.com
>
>  To develop: -derived instances for Data.Binary
>  -serialization to/from ByteStings
>
> I wrote this module because I needed to serialize lists of verisions of the
> same data with slight modifications between each version.
>
>
> This is a short tutorial (in tutorial.txt)
>
>
>
> runW applies showp, the serialization parser of the instance Int for the
> RefSerialize class
>
> Data.RefSerialize>let x= 5 :: Int
> Data.RefSerialize>runW $ showp x
> "5"
>
> every instance of Read and Show is an instance of RefSerialize.
>
> rshowp is derived from showp, it labels the serialized data with a variable
> name
>
> Data.RefSerialize>runW $ rshowp x
> " v8 where {v8= 5; }"
>
> Data.RefSerialize>runW $ rshowp [2::Int,3::Int]
> " v6 where {v6= [ v9,  v10]; v9= 2; v10= 3; }"
>
> while showp does a normal show serialization
>
> Data.RefSerialize>runW $ showp [x,x]
> "[5, 5]"
>
> rshowp variables are serialized memory references: no piece of data that
> point to the same addrees is serialized but one time
>
> Data.RefSerialize>runW $ rshowp [x,x]
> " v9 where {v6= 5; v9= [ v6, v6]; }"
>
> This happens recursively
>
> Data.RefSerialize>let xs= [x,x] in str = runW $ rshowp [xs,xs]
> Data.RefSerialize>str
> " v8 where {v8= [ v10, v10]; v9= 5; v10= [ v9, v9]; }"
>
> the rshowp serialized data is read with rreadp. The showp serialized data
> is read by readp
>
> Data.RefSerialize>let xss= runR rreadp str :: [[Int]]
> Data.RefSerialize>print xss
> [[5,5],[5,5]]
>
> this is the deserialized data
>
> the deserialized data keep the references!! pointers are restored! That is
> the whole point!
>
> Data.RefSerialize>varName xss !! 0 == varName xss !! 1
> True
>
>
> rShow= runW rshowp
> rRead= runR rreadp
>
> Data.RefSerialize>rShow x
> " v11 where {v11= 5; }"
>
>
> In the definition of a referencing parser non referencing parsers can be
> used and viceversa. Use a referencing parser
> when the piece of data is being referenced many times inside the serialized
> data.
>
> by default the referencing parser is constructed by:
>
> rshowp= insertVar showp
>rreadp= readVar readp
> but this can be redefined. See for example the instance of [] in
> RefSerialize.hs
>
> This is an example of a showp parser for a simple data structure.
>
> data S= S Int Int deriving ( Show, Eq)
>
> instance  Serialize S  where
> showp (S x y)= do
> xs <- rshowp x  -- rshowp parsers can be inside showp
> parser
> ys <- rshowp y
> return $ "S "++xs++" "++ys
>
>
>
> readp =  do
> symbol "S" -- I included a (almost) complete Parsec
> for deserialization
> x <- rreadp
> y <- rreadp
> return $ S x y
>
> there is a mix between referencing and no referencing parser here:
>
> Data.RefSerialize>putStrLn $ runW $ showp $ S x x
> S  v23 v23 where {v23= 5; }
>
>
> (I corrected some errors in this file here)
>
>
>
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] ANNOUNCE: RefSerialize-0.2.1

2008-11-02 Thread Alberto G. Corona
I uploadad 
RefSerialize
to  Hackage .

Read, Show and Data.Binary do not check for repeated references to the same
data address. As a result, the data is serialized multiple times when
serialized. This is a waste of space in the filesystem  and  also a waste of
serialization time. but the worst consequence is that, when the serialized
data is read, it allocates multiple copies in memory for the same object
referenced multiple times. Because multiple referenced data is very typical
in a pure language such is Haskell, this means that the resulting data loose
the beatiful economy of space and processing time that referential
transparency permits.

This package allows the serialization and deserialization of large data
structures without duplication of data, with
the result of optimized performance and memory usage. It is also useful for
debugging purposes.

There are automatic derived instances for instances of Read/Show, lists and
strings. the deserializer contains a almos complete set of Parsec.Token
parsers for deserialization.

 Every instance of Show/Read is also a instance of Data.RefSerialize

 The serialized string has the form "expr( var1, ...varn) where
var1=value1,..valn=valueN " so that the
string can ve EVALuated.

 See demo.hs and tutorial. I presumably will add a entry in
haskell-web.blogspot.com

 To develop: -derived instances for Data.Binary
 -serialization to/from ByteStings

I wrote this module because I needed to serialize lists of verisions of the
same data with slight modifications between each version.


This is a short tutorial (in tutorial.txt)



runW applies showp, the serialization parser of the instance Int for the
RefSerialize class

Data.RefSerialize>let x= 5 :: Int
Data.RefSerialize>runW $ showp x
"5"

every instance of Read and Show is an instance of RefSerialize.

rshowp is derived from showp, it labels the serialized data with a variable
name

Data.RefSerialize>runW $ rshowp x
" v8 where {v8= 5; }"

Data.RefSerialize>runW $ rshowp [2::Int,3::Int]
" v6 where {v6= [ v9,  v10]; v9= 2; v10= 3; }"

while showp does a normal show serialization

Data.RefSerialize>runW $ showp [x,x]
"[5, 5]"

rshowp variables are serialized memory references: no piece of data that
point to the same addrees is serialized but one time

Data.RefSerialize>runW $ rshowp [x,x]
" v9 where {v6= 5; v9= [ v6, v6]; }"

This happens recursively

Data.RefSerialize>let xs= [x,x] in str = runW $ rshowp [xs,xs]
Data.RefSerialize>str
" v8 where {v8= [ v10, v10]; v9= 5; v10= [ v9, v9]; }"

the rshowp serialized data is read with rreadp. The showp serialized data is
read by readp

Data.RefSerialize>let xss= runR rreadp str :: [[Int]]
Data.RefSerialize>print xss
[[5,5],[5,5]]

this is the deserialized data

the deserialized data keep the references!! pointers are restored! That is
the whole point!

Data.RefSerialize>varName xss !! 0 == varName xss !! 1
True


rShow= runW rshowp
rRead= runR rreadp

Data.RefSerialize>rShow x
" v11 where {v11= 5; }"


In the definition of a referencing parser non referencing parsers can be
used and viceversa. Use a referencing parser
when the piece of data is being referenced many times inside the serialized
data.

by default the referencing parser is constructed by:

rshowp= insertVar showp
   rreadp= readVar readp
but this can be redefined. See for example the instance of [] in
RefSerialize.hs

This is an example of a showp parser for a simple data structure.

data S= S Int Int deriving ( Show, Eq)

instance  Serialize S  where
showp (S x y)= do
xs <- rshowp x  -- rshowp parsers can be inside showp
parser
ys <- rshowp y
return $ "S "++xs++" "++ys



readp =  do
symbol "S" -- I included a (almost) complete Parsec
for deserialization
x <- rreadp
y <- rreadp
return $ S x y

there is a mix between referencing and no referencing parser here:

Data.RefSerialize>putStrLn $ runW $ showp $ S x x
S  v23 v23 where {v23= 5; }


(I corrected some errors in this file here)
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


[Haskell] ANNOUNCE: Data.TCache 0.5.1

2008-10-28 Thread Alberto G. Corona
I uploaded TCache to hackage.org.

Data.Tcache is a transactional cache with configurable persistence. It tries
to simulate Hibernate for Java or Rails for Ruby. The main difference is
that transactions are done in memory trough STM. There are transactional
cache implementations for some J2EE servers like JBOSS.

TCache uses STM . It can  atomically apply a function to a list of cached
objects. The resulting objects go back to the cache (withResources). It also
can retrieve these objects (getResources).  Persistence can be syncronous
(syncCache)  or asyncronous, wtih configurable time between cache writes and
configurable cache clearance strategy. the size of the cache can be
configured too . All of this can be done trough clearSyncCacheProc. Even the
TVar variables can be accessed directly (getTVar) to acceess all the
semantic of atomic blocks while maintaining the persistence of the TVar
updates.

Persistence can be defined for each object.: Each object must have a defined
key, a default filename path (if applicable). Persistence is pre-defined in
files, but the readResource writeResource and delResource methods can be
redefined to persist in databases or whatever.

There is a sample.hs that explain the main features.
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell


Re: [Haskell] Announce: Yi 0.5.0.1

2008-10-08 Thread Alberto G. Corona
and..
integrated compiler error location in source code; Very important for rapid
application development

and overall:
Integrated GHCI debugger: VERY important for Haskell Newbies. for
understanding the haskell execution strategy. for interactive teaching.

2008/10/8 Jean-Philippe Bernardy <[EMAIL PROTECTED]>

> I'm pleased to announce the 0.5 release of the Yi editor.
>
> ## Yi
> Yi is a text editor written and extensible in Haskell. The
> long-term goal of the Yi project is to provide the editor of
> choice for Haskell programmers.
>
> Yi is not a finished product. This is a beta-quality release. However, Yi
> has
> become a lot more usable than previously, so if you feel like testing it,
> now
> might be a good time to take a look.
>
> ## Installation
> Using cabal install:
>
>  cabal install yi-0.5.0.1
>
> If you want unix console support, pass the -fvty option to cabal install.
>
> ## Features
> * A purely functional editor core
> * Key-bindings written as parsers of the input
> * Emacs, Vim and partial Cua emulations provided by default
> * Unix Console front-end (Gtk2Hs frontend is not supported in this release)
>
> * Static configuration (XMonad style) for fast load
> * Haskell support:
>* Lexical highlighting
>* Layout-aware parenthesis-matching
>* Auto-indentation
>* cabal-build within the editor
>
> ## Links
> * [download](http://hackage.haskell.org/cgi-bin/hackage-scripts/package/yi
> )
> * [FAQ](http://haskell.org/haskellwiki/Yi/FAQ)
> * [homepage](http://haskell.org/haskellwiki/Yi)
> * [blog and release notes](http://yi-editor.blogspot.com/)
> * [check and report issues](http://code.google.com/p/yi-editor/issues/list
> )
> * [darcs repository](http://code.haskell.org/yi)
> * [get involved](mailto:[EMAIL PROTECTED])
>
> ## Credits
>
> This release is brought to you by:
>
> * Allan Clark
> * Corey O'Connor
> * Gustav Munkby
> * Gwern Branwen
> * Jean-Philippe Bernardy
> * Jeff Wheeler
> * Nicolas Pouillard
> * Thomas Schilling
> * Tristan Allwood
>
> and all the contributors to the previous versions.
> ___
> Haskell mailing list
> Haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell
>
___
Haskell mailing list
Haskell@haskell.org
http://www.haskell.org/mailman/listinfo/haskell