
Hello, HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation. I wonder if it is possible, not considering feasibility for the moment, to implement HaskellDB *without* using Singleton Types. Luke Palmer demonstrates in one blog post replacing type classes with data structures, so I wonder if this could also be applied in this setting. Best regards Günther

2010/4/25 Günther Schmidt
Hello,
HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation.
I wonder if it is possible, not considering feasibility for the moment, to implement HaskellDB *without* using Singleton Types.
Would you please define "singleton type"? Luke

lrpalmer:
2010/4/25 Günther Schmidt
: Hello,
HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation.
I wonder if it is possible, not considering feasibility for the moment, to implement HaskellDB *without* using Singleton Types.
Would you please define "singleton type"?
Funny, we had a discussion about this at work this week (in the context of adding singleton types to Cryptol to support some witness/proof work). A nice defn is Oleg's: http://okmij.org/ftp/Computation/lightweight-dependent-typing.html#Singleton "we define particular types such that the corresponding sets of values consist of only one value, the conceptual barrier between elements and sets of elements disappears" Which is the intuitive notion, I think. -- Don

Hello Luke, I mean something like data FirstName = FirstName data LastName = LastName data BirthDate = BirthDate ie. data FirstName data LastName data BirthDate In HaskellDB's case this is part of what's necessary to define individual columns. Another part is: instance FieldTag FirstName where fieldName = const "firstName" HaskellDB is using type level stuff quite heavily and since you're a bit of a wizkid on avoiding it where not necessary and keeping things "functional" I'm hoping you might come up with something. :) Best regards Günther Am 25.04.10 23:22, schrieb Luke Palmer:
2010/4/25 Günther Schmidt
: Hello,
HaskellDB makes extensive use of Singleton Types, both in its original version and the more recent one where it's using HList instead of the legacy implementation.
I wonder if it is possible, not considering feasibility for the moment, to implement HaskellDB *without* using Singleton Types.
Would you please define "singleton type"?
Luke
participants (3)
-
Don Stewart
-
Günther Schmidt
-
Luke Palmer