view demo/more/meta.urs @ 1017:34ba25d6af3b

Inlining threshold for Mono_reduce
author Adam Chlipala <adamc@hcoop.net>
date Sun, 25 Oct 2009 12:48:50 -0400
parents 16f7cb0891b6
children 6bcc1020d5cd
line wrap: on
line source
con meta = fn (db :: Type, widget :: Type) =>
                    {Nam : string,
                     Show : db -> xbody,
                     Widget : nm :: Name -> xml form [] [nm = widget],
                     WidgetPopulated : nm :: Name -> db -> xml form [] [nm = widget],
                     Parse : widget -> db,
                     Inject : sql_injectable db}

val int : string -> meta (int, string)
val float : string -> meta (float, string)
val string : string -> meta (string, string)
val bool : string -> meta (bool, bool)

val textarea : string -> meta (string, string)

val allContent : ts ::: {(Type * Type)} -> $(map meta ts) -> $(map fst ts) -> folder ts -> xbody

val allWidgets : ts ::: {(Type * Type)} -> $(map meta ts) -> folder ts
                 -> xml form [] (map snd ts)

val allPopulated : ts ::: {(Type * Type)} -> $(map meta ts) -> $(map fst ts) -> folder ts
                   -> xml form [] (map snd ts)

val allPopulatedTr : ts ::: {(Type * Type)} -> $(map meta ts) -> $(map fst ts) -> folder ts
                     -> xml ([Tr] ++ form) [] (map snd ts)

val ensql : avail ::: {{Type}} -> ts ::: {(Type * Type)} -> $(map meta ts) -> $(map snd ts) -> folder ts
            -> $(map (sql_exp avail [] []) (map fst ts))