[Haskell-cafe] Ur tutorial, and a challenge
Marc Weber
marco-oweber at gmx.de
Wed Jul 27 12:54:51 CEST 2011
Excerpts from Christopher Done's message of Wed Jul 27 12:26:08 +0200 2011:
> Is TemplateHaskell fair game? Because if so these problems are not
> hard. Yesod employs static typing for templates. HaskellDB achieves
> injectionless static type checking even without TemplateHaskell, and
> templatepg has type safe SQL queries based on parsing the SQL itself
> and inspecting the types involved by asking the PostgreSQL server
> directly at compile time.
Which doesn't work because the result of querying is not accurate enough
(or has not been in the past?)..
Eg see here -> Only DB2 seems to return usable results.
http://www.haskell.org/haskellwiki/MetaHDBC
The main problem is: Does a field return a nullable value (thus Maybe?)
However if that changed I want to know about it :)
If you know databases inside out than you also know that its sometimes
faster to run a sophisticated custom query than doing all the work in
Haskell (after sending data over network).
Don't think HaskellDB supports all of those features.
I imagine that its easier to extend urweb in this regard.
However there are a lot new SQL based Haskell libraries I don't know
yet.
The difference is that Haskell's type system is bad at creating
temporary types unless you go the HList route?
http://hackage.haskell.org/package/records
Does this library address this?
While Haskell's type system is known to be touring complete this doesn't
mean that such code is easy to maintain.
I'm no longer up to date so all I said may be partially wrong :(
Marc Weber
More information about the Haskell-Cafe
mailing list