English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Help with Elliom syntax
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-11-04 (14:37)
From: Sylvain Le Gall <sylvain@l...>
Subject: Re: Help with Elliom syntax

On 04-11-2010, Till Crueger <Till.Crueger@gmx.net> wrote:
> On Thu, 04 Nov 2010 13:31:35 +0100, Sylvain Le Gall <sylvain@le-gall.net>  
> wrote:
>> Most of the time you have an ~a parameter.
>> Example:
>> div ~a:[a_class ["statistics"]] [ h2 [pcdata "Statistics"]; ... ]
> Thanks for the help again.
> Is there a place where such things are documented? Because I was not able  
> to figure out how to do this using the Elliom developer manual.

Well, you have to figure how nullary/.../star works.
All is in the type ;-)

E.g. for nullary 
type ('a, 'b) nullary = ?a:'a attrib list -> unit -> 'b elt 
val br : ([< core ], [> `Br ]) nullary
type core = [ `Class | `Id | `Title ] 

So you know that br accept only a_class, a_id and a_title...

I would recommend you to learn by examples, because ocsigen is a big
application and can be pretty hard to learn. There are already good
websites around:

Sylvain Le Gall