Heute war doch ein recht spezieller Tag. Notartermin zwecks Vertragsunterzeichnung. Ich kann nur sagen daß mein Herz doch ziemlich in die Hose geruscht ist...
...noch nie habe ich so eine Menge Geld auf eine Karte gesetzt. Als nächstes nun wird bezahlt und dann beginnt der lange, schweißtreibende Weg zur Tilgung. Darüber später mehr.
Thursday, October 9, 2008
Wednesday, September 10, 2008
Hoare Triples and Thrists
While mousing through the L4.verified presentation that took place at Galois, I could not help but build an association bridge between Hoare triples and thrists. Especially when you go to p. 52 and thereabout.
Here is my take on the connection:
We have some commands that belong to a data type C, and C has two type parameters:
If commands are sequenced, the postconditions of the former commands must imply the preconditions of the latter. This is referred to as the composition rule and corresponds to appending two thrists.
Now, in Ωmega the situation is even prettier, because C need not be a two-type-parameter entity, but can be parameterized over arbitrary kinds. The built-in evaluation mechanism (type functions) allow the most powerful constructs. (Haskell will get something similar at the type level, called type families, with GHC v6.10.)
Here is my take on the connection:
We have some commands that belong to a data type C, and C has two type parameters:
The first type parameter can be interpreted as the precondition of the command while the second as its postcondition ({P} and {Q} in Hoare's notation). This convention employs the types-as-properties interpretation.data C :: * -> * -> * where
C1 :: ... -> C a b
If commands are sequenced, the postconditions of the former commands must imply the preconditions of the latter. This is referred to as the composition rule and corresponds to appending two thrists.
Now, in Ωmega the situation is even prettier, because C need not be a two-type-parameter entity, but can be parameterized over arbitrary kinds. The built-in evaluation mechanism (type functions) allow the most powerful constructs. (Haskell will get something similar at the type level, called type families, with GHC v6.10.)
Wednesday, September 3, 2008
Saudades
Monday, September 1, 2008
Meme evolution
While I am missing family induced distraction, I use the opportunity of reading old papers that I always wanted to revisit.
Yesterday, while reading "A History of Haskell" I was amused by the sentence:
Some preconditions are needed for this to happen:
Now, how can I ensure that I periodically can enjoy the state of minimal disturbances?
Yesterday, while reading "A History of Haskell" I was amused by the sentence:
"Wadler misunderstood what Fasel had in mind, and type classes were born!"This is a concrete case of "meme evolution" (in Dawkins' sense): a mutation of a meme (by transcription error) finds a new habitat where it thrives and blossoms.
Some preconditions are needed for this to happen:
- communication
- loosening of amorphous ideas
- an open mind, not shying away from listening to the unknown
Now, how can I ensure that I periodically can enjoy the state of minimal disturbances?
Saturday, August 30, 2008
Generalized Monads --> Gonads :-)
Here is the usual (basic) definition of monads:
Let's see how this restriction can be lifted...
No idea whether this can produce something relevant for our lives :-)
Cheers,
Gabor
This is very much restricted to ordinary function types!class Monad m where
return :: a -> m a
(>>=) :: m a -> (a -> m b) -> m b
Let's see how this restriction can be lifted...
Since the semantics of gonads are already eminently taken, I settled for the name Geonad.class Category (~>) => Geonad (g (~>)) where
return :: a ~> g (~>) a
(>>=) :: g (~>) a ~> (a ~> g (~>) b) ~> g (~>) b
No idea whether this can produce something relevant for our lives :-)
Cheers,
Gabor
Thursday, August 28, 2008
Category
With lots of rejoicing, today I discovered that the base-3.0 library, to be distributed with the upcoming GHC 6.10, will contain the Control.Category type class. This is exactly what is needed to put Thrist (~>) into a general context!
Can't wait till September...
PS: It is also a nice surprise that Ashley Yakeley, the maintainer of this module is an old-time Dylan person :-)
Sometime I have to blog about the lots of developers who share a common Haskell/Dylan heritage.
Can't wait till September...
PS: It is also a nice surprise that Ashley Yakeley, the maintainer of this module is an old-time Dylan person :-)
Sometime I have to blog about the lots of developers who share a common Haskell/Dylan heritage.
Tuesday, August 26, 2008
I'd like to see, but do you want to Show?
So, yesterday I tried to implement
The long story comes next, if you are interested.
First of all, what do we want? In my paper I define a nice thrist
But the first obstacle was immediate: When the thrist has more than one element the hidden existential type appears, but the compiler does not know that this (a ~> x) has a Show instance!
So I hoped to extend the context to require Show (forall a b . a ~> b) that is I want all saturations of the type constructor (~>) to be Showable. But GHC does not like this syntax...
At his point I started some fundamental thinking...
Since the type of the thrist only reveals the beginning and the end, there may be arbitrary non-showable types hidden inside, even if the resulting type conveys the illusion of Showability. To wit:
So what are our remaining options? Ganesh has brought Show2 to my attention, I might look at it soon, but it won't solve the above problem.
We can say goodbye to (,) and define something like:
Who knows?
PS: Ωmega cheats, of course. It frobs the Show functionality of the underlying Haskell implementation. It also prints functions as <fn>.
instance Show (Thrist (a ~> b)) where ...... and ran against several walls. The short story is: Forget it!
The long story comes next, if you are interested.
First of all, what do we want? In my paper I define a nice thrist
[('A', 33), (65, 'a')]l :: Thrist (,) Char Charand the Ωmega interpreter readily prints it. I wanted to do the same in Haskell too, as a pretty extension of my thrist package. I started like this:
instance Show (a ~> b) => Show (Thrist (~>) a b)I even managed to show singleton thrists (which hold just one element).
show Nil = "[]l"
But the first obstacle was immediate: When the thrist has more than one element the hidden existential type appears, but the compiler does not know that this (a ~> x) has a Show instance!
So I hoped to extend the context to require Show (forall a b . a ~> b) that is I want all saturations of the type constructor (~>) to be Showable. But GHC does not like this syntax...
At his point I started some fundamental thinking...
Since the type of the thrist only reveals the beginning and the end, there may be arbitrary non-showable types hidden inside, even if the resulting type conveys the illusion of Showability. To wit:
[(5, id), (id, 42)]l :: Thrist (,) Int IntWe can enter such a thing, but there is no hope to show it :-(
So what are our remaining options? Ganesh has brought Show2 to my attention, I might look at it soon, but it won't solve the above problem.
We can say goodbye to (,) and define something like:
newtype Pair a b = (Show a, Show b) => Pair (a, b)There is some hope that Thrist Pair a b can be declared as a Show2 instance.
Who knows?
PS: Ωmega cheats, of course. It frobs the Show functionality of the underlying Haskell implementation. It also prints functions as <fn>.
Subscribe to:
Posts (Atom)
