[Haskell-cafe] Function Stores

Cristian Baboi cristian.baboi at gmail.com
Fri Dec 28 16:49:56 EST 2007


Here is what I was able to come up with:


module Store where

data FStore1 a b  = Empty1 | FS1 ( a->b , FStore1 a b )

store1 :: (a->b) -> (FStore1 a  b)
store1 f = let x = FS1 (f, x) in x

data FStore2 a b = Empty2 | FS2 ( a->b , FStore2 a b, FStore2 a b )

store2 :: (a->b) -> (FStore2 a b)
store2 f = let x = FS2 (f,x,x) in x


First I tryed store1, but after a while it went out of business.
Second I tryed other business model with store2. Same result.

Then I tryed to make a street of stores.
After a while, they all went out of business.

Then I tryed to make several streets of stores.
After a while they all went out of business.

Then I tryed to make an infinite street of stores.
After a while they all went out of business.

Then, following some rumors that there is a store on that street with some  
function in stock that might be willing to give it away, I noticed that  
the street disappeared, and I cannot go to that store.

Can you help me find it ?


More information about the Haskell-Cafe mailing list